Back to All

Need the bot to save user progress and be able to restore it also after session expires

I'm working on branched-story bot and I need this latter to remember the user's progress, and so his/her choices, but this also AFTER the chat session expires.

For example, if a user completes the 2nd chapter of the story and comes back after 3 hours, I need the bot to remember the user completed the 2nd chapter, in order to let the user continue from that point and without making him doing all the story again.

I also need the bot to actually remember which choices the user made, always AFTER the session expired. If for example the user decided in the 2nd chapter to kill a character, then in the 3rd chapter this character shouldn't appear and the story should be formed on the choices selected by the user.
Basically the user's progress should be kept without being resetted.

Because I can't remove the session expire time, then I guess I should connect my bot to a server and/or a database and use SOME Third-Party API or what?

What can I do? And please, be the most detailled possible, because I've already read the docs about webhook, api, and so on, and I honestly didn't understand much.

The bot was published on Telegram.