J
J
James_Obry2022-02-04 18:50:15
Bots
James_Obry, 2022-02-04 18:50:15

How to save the machine state of a telegram bot user?

Hello, I am writing a telegram bot in the python language and the aiogram library, I also use machine states, but the problem is that it is reset after the bot is restarted

bot = Bot(config.bot_token)
storage = MemoryStorage()
dp = Dispatcher(bot, storage=storage)

Does anyone know how to make it so that it is not reset, what to replace MemoryStorage() with so as not to use the database?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LXSTVAYNE, 2022-02-04
@lxstvayne

No way, you will need a database so that the data is not reset after a restart. You can use the state stores available in aiogram, or write your own, which will, for example, store everything in a text editor, but this is a bad idea.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question