arealibusadrealiora / tori-scan-bot

Telegram notifications bot for Tori.fi.
2 stars 0 forks source link

Something's wrong with /start #2

Closed arealibusadrealiora closed 3 weeks ago

arealibusadrealiora commented 2 months ago

After /start command, the user is asked for their preferred language. But for some reason, they're getting asked twice. Most likely the problem is with /start command processing.

arealibusadrealiora commented 1 month ago

So, the problem is that after select_language, the main_menu function then calls start again. And it only happens on the first run. Can't see why yet.

arealibusadrealiora commented 1 month ago

It happens only on the very-very first run for the user -- e.g. for the new user. For example, if you will stop the bot.py, delete the database, then start the bot.py again -- you won't see this issue, it will work correctly: recognizing that the user doesn't have any saved settings and will ask the user for their preferred language only once.

To reproduce the issue, you can do the following:

  1. Stop the bot.py;
  2. Stop the bot in Telegram as the user (by pressing stop and block, for example);
  3. Optionally(?): Delete the conversation;
  4. Start bot.py again;
  5. Delete the database;
  6. Start the bot as the user in Telegram;
  7. And in that case the user will be asked for the language twice.