-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Order of messages from multiple bot.replyWithTyping() is not correct in Messenger .. #543
Comments
Node JS is asynchronous, so it displays which ever parts of the code loads first. I guess "second!" comes after "first!" because there is one more letter. Botkit has a nice conversation feature that deals with the issue. Try:
This should be enough to deal with text messages. If you want to avoid this issue when sending heavier messages to the users (eg: images attachment), consider reading about the |
Thanks devhaoy for the quick response. You are right, it was the number of characters in the message determining the order. Good catch. :) convo.say() is displaying the messages in the correct order. I need to display a message with attachment(that has buttons) after displaying the text messages. I'm trying as below, but the message with attachment(bot.reply()) gets displayed first and then the convo.say() messages in the correct order.
I have added |
Try this
You don't need to enable Note that the switch statement system above is one of many ways of handling the buttons. There is a built-in Threads function in Botkit that is widely use, you should refer to past issues and the readme files to learn more about it. |
Thanks devhaoy! The below code worked fine -
|
Hello,
I'm trying to display multiple messages using bot.replyWithTyping() as follows -
The result I see in the Messenger App is as below -
First!
Third!
Second!
Any idea why the order is messed up? I also tried using bot.reply() but no luck.
The text was updated successfully, but these errors were encountered: