Closed OrbitPodium closed 5 years ago
@OrbitPodium - Sorry. I don’t understand you. is default message. If Bot does not know Questions. It will answer default message. If you don't want to show user to default message just comment it out this line or add/modify it yourself.
@setkyar Yes this is the default message but if you start the chat and give a wrong command (see my attachment on red color) the bot answers the default message. After that, if you give right command (see my attachment on green color) the bot answers the respective message but after that, if there's no message from chat user, the bot goes to a loop in default message. I have to comment out the default message to avoid the default message cycle. Have you understand the issue? if the chat user gives no message the bot turns in default loop.
@OrbitPodium It worked fine on my one. But, I will check it out again. And will solve it out. 👍
@OrbitPodium Does not loop in my side.
@setkyar I simply deploy the github repository and after that, made a composer install, make migrations and seed and voilá: the bot is working! Could you have in mind a reason for this loop? Of course i could code a workaround but i'm keeping understand why this happen on my installation.
I got the same error.
I've solved it using this:
` if (!empty($command)) { // Handle command $bot_answer = Answer::where('command', '=', strtolower($command))->first();
if ($bot_answer) {
$this->bot->send(new Message($message['sender']['id'], $bot_answer->answer));
} else {
//Default
$this->bot->send(new Message($message['sender']['id'], 'Sorry. I don’t understand you.'));
}
}`
@OrbitPodium Thanks, I will check out and will fix on next release.
Hello,
I had install this app but after my "hi" message, bot answers me "hello" and takes in a loop "Sorry. I don’t understand you." in "app/Messenger/Helpers/Messenger.php" file, the foreach cycle assumes $command = ""; and it allways fall in default message. I comment the line "$this->bot->send(new Message($message['sender']['id'], 'Sorry. I don’t understand you.'));" and after that seems work fine. you think review this issue?