Answer the question
In order to leave comments, you need to log in
How to store the state of a chatbot?
I am writing a chat bot for VKontakte and there was a need to save the state of the dialogue with the user.
More specifically: until the user selects the Foo command, the Bar command will not be available to him
How to implement this behavior?
Bot uses vk callback api and asp.net core web api
Answer the question
In order to leave comments, you need to log in
You can store the current state of the dialog with the user in the database or at least in memory (in the form of a dictionary "user id - state").
I recommend reading about state machines, for example here: https://habr.com/ru/post/160105/
it seems that there is a payload for this,
you can read here
https://vk.com/dev/bots_docs_3?f=4.%2BKeyboards%2...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question