J
J
justslipknot2019-02-27 16:49:49
API
justslipknot, 2019-02-27 16:49:49

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

2 answer(s)
R
Rebel028, 2019-02-27
@Rebel028

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/

S
Stockholm Syndrome, 2019-02-27
@StockholmSyndrome

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 question

Ask a Question

731 491 924 answers to any question