Hi guys so what i'm trying to do here is when the botman hears something that already in the code it will return if statement, if it hears something other than that it will go get reply from dialogflow. Is it possible or not? I'm new to botman and trying to develop it for school project.
Below is my code: I still don't know how to do it and don't know if it is possible.
if ($input == 'School info'){
$bot->reply('Give some info about school');
}
else{
//get reply from dialogflow
$dialogflow = DialogFlow::create('en');
$botman->middleware->received($dialogflow);
$botman->hears('(input.*)', function ($bot) {
$extras = $bot->getMessage()->getExtras();
$bot->reply($extras['apiReply']);
})->middleware($dialogflow);
}
});