Search code examples
pythonpython-telegram-bot

Python Telegrambot requires /start every time the bot is restarted


I created a bot with the python-telegram-bot library and the user has the ability to navigate through the states, but when there is a bug, I need to restart the bot and when I restart the bot, the user needs to type /start again in order to communicate with the bot, instead of this, is there a method that I can let the user to continue from whichever state the user was in the bot before?


Solution

  • The states of ConversationHandler are stored in memory by default, that's true. If you want these states to be persisted across reboots of your python script, please have a look at PTBs built-in persistency setup.


    Disclaimer: I'm currently the maintainer of python-telegram-bot.