#How to wait for a followup message?

11 messages · Page 1 of 1 (latest)

tender needle
#

Hello, I'd like to know what the best would be to have a user send a followup message after a reply from thr chat bot is sent. For example, I want the bot to ask someone for their name and the bot will wait for that reply then perform some logic. What would be the best way to do this? We didn't want to reply on the uset adding a token like "#Name" at the beginning so we're using a database to keep track of the sessions set up but I'd like to know if there's a better idea.

Thank you in advance.

silver crypt
#

You can wait for user to send next message like for a minute if didn't answered then stop waiting and exit

slate cedar
tender needle
slate cedar
#

do you use any database?

tender needle
#

Yes, I do. MySQL in particular

slate cedar
#

how i do in my bot is every user has a 'context' field

so for a booking chat flow, for example, user context is updated like this

Context on start menu -> context is 'start' or null
chooses booking option -> set context 'booking-0'
next booking question -> next context, 'booking-1'

and so on

#

so check the context and validate each answer how you want

#

or... just use dialogflow

#

which also does this

tender needle
#

Thank you, I thought I could use some JavaScript solutions but I guess I can't avoid using databases.