Chist-Sergey / P3000TLBOT

Open-Source Telegram-bot for memorising birthday dates.
GNU General Public License v3.0
1 stars 0 forks source link

Bot won't start because of "bot was blocked by the user" #6

Open Chist-Sergey opened 3 weeks ago

Chist-Sergey commented 3 weeks ago

It doesn't happen in a testing enviroment.

No error handlers are registered, logging exception.
Traceback (most recent call last):
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/ext/_application.py", line 1173, in process_update
    await coroutine
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/ext/_basehandler.py", line 141, in handle_update
    return await self.callback(update, context)
  File "/dir/username/P3000TLBOT/src/bot_functions.py", line 107, in birthday_loop
    await context.bot.send_message(
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/ext/_extbot.py", line 2644, in send_message
    return await super().send_message(
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/_bot.py", line 388, in decorator
    result = await func(self, *args, **kwargs)  # skipcq: PYL-E1102
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/_bot.py", line 814, in send_message
    return await self._send_message(
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/ext/_extbot.py", line 514, in _send_message
    result = await super()._send_message(
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/_bot.py", line 566, in _send_message
    result = await self._post(
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/_bot.py", line 476, in _post
    return await self._do_post(
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/ext/_extbot.py", line 332, in _do_post
    return await super()._do_post(
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/_bot.py", line 504, in _do_post
    return await request.post(
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/request/_baserequest.py", line 168, in post
    result = await self._request_wrapper(
  File "/dir/username/P3000TLBOT/venv/lib/python3.10/site-packages/telegram/request/_baserequest.py", line 316, in _request_wrapper
    raise Forbidden(message)
telegram.error.Forbidden: Forbidden: bot was blocked by the user

Somehow it's raised during the message part, but I think it's the misleading part. It should NOT send message to a user who has the bot blocked. It SUPPOSED to send a message to a user who have initialised the bot by the "start" command, which also unblocks the bot if it were ever previously blocked. Should I try to except this error?

Chist-Sergey commented 3 weeks ago

Temporary fixed by removing every non-group chat id from database.

Chist-Sergey commented 1 week ago

It's far worse than that. The bot is not starting at all, even if it tells you so. For now, it's best to use a stable release.

Chist-Sergey commented 1 week ago

Logs say dat the 'birthdy_start' function tries to open a chat with a wrong file name. It should open a 12345.txt file, but tries to open a 12345.txt.txt file. This case is under investigation. Status: reproducing.