Greetings. Does anyone know how to switch bot states? Maybe someone

can show the code?
To have some kind of layer between the bot and the service, which stores the states and switches them.

7 ответов

18 просмотров

You can save the state of the user in a storage like Redis or a database. And whenever you have a new update, retrieve the state from the storage and run logics accordingly.

https://github.com/telegraf/telegraf/blob/v4/src/scenes/stage.ts#L45

you can do it with scenes in telegraf

Гений-Без Ни Автор вопроса

Using Java Spring)))

Гений Без Ни
Using Java Spring)))

you can use and FSM library that can allow you to store states in caching system like redis or in database

Гений-Без Ни Автор вопроса
iba
you can use and FSM library that can allow you to ...

I heard about Spring state machine. I know what is Redis, but never used it.

Похожие вопросы

Карта сайта