Replies: 1 comment 1 reply
-
Are you using a Conversation object? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
this is my botman handle after showing this message "Hey There! How are you?" when I reply like good or bad then it will repeat the handle function instead of giving me a this reply "'You said: good"
Please give me a solution if you also face the similar situation
public function handle()
{
$botman = app('botman');
$botman->hears('{message}', function($botman, $message) {
// dd($message);
if ($message == 'hello') {
$this->askName($botman);
}else{
$botman->reply("Type 'hello' for demo ...");
}
});
$botman->listen();
}
public function askName($botman)
{
$botman->ask('Hey There! How are you?', function(Answer $answer) {
$ans = $answer->getText();
$botman->say('Hello, ' . $ans . '! How can I assist you?', function() use ($botman) {
// You can continue the conversation here
$botman->ask('What can I do for you?', function(Answer $answer) {
// Handle user's response here
$response = $answer->getText();
$botman->reply('You said: ' . $response);
});
});
});
Beta Was this translation helpful? Give feedback.
All reactions