Search code examples
facebook-messengerfacebook-chatbot

Show facebook chat bot has seen message


How can I send a facebook messenger response that acknowledges seeing the input but does not deliver a message?


Use Case:

I am attempting to improve my chat bot by better handling of multiple rapid inputs.
For example:

User: Order a pizza.
Bot: What toppings would you like?
User: cheees
User: cheese

It usually happens if the user misspelled a word and quickly sends a corrected spelling as in the example.
The bot currently processes the first input of cheees and prepares a response. Then processes the second input of cheese as if it is an answer to the undelivered response.

So I am detecting if a second input is received before delivering the first in order to cancel that response, but I want to at least show that the first input was seen while waiting for the second input's response to be delivered.


Solution

  • It's definitely possible. There are sender actions. You're looking for mark_seen what exactly makes messages being seen by your bot.

    I would have several recommendations here:

    • Always mark messages as seen. From the user perspective it shows that there is someone on the other side.
    • Prior to sending a message, you should consider sending a typing indicator for a second. This is how the user is used to see chat with his friends.
    • You could also wait one or two seconds before processing the user input if you receive something else.

    We've build in these solutions into Amio Bot Builder. Feel free to use it or copy it.