mau_mau_bot icon indicating copy to clipboard operation
mau_mau_bot copied to clipboard

Crash when sending a card

Open iuriguilherme opened this issue 3 years ago • 9 comments

There is an ongoing bug which fails to check if a card can be sent and as a consequence doesn't record the play, doesn't update the hand, etc. and leads to timeout skipping to the next player, allowing the sticker to be sent to the group but not removing the card from the hand and not finishing the current play.

Trace:

2021-11-09 11:42:02,292 - utils - ERROR - Message text is empty
Traceback (most recent call last):
  File "/home/iuri/git/iuriguilherme/mau_mau_bot/utils.py", line 92, in send_async
    bot.sendMessage(*args, **kwargs)
  File "/home/iuri/.local/share/virtualenvs/mau_mau_bot-hie6xpcQ/lib/python3.7/site-packages/telegram/bot.py", line 57, in decorator
    result = func(self, *args, **kwargs)
  File "/home/iuri/.local/share/virtualenvs/mau_mau_bot-hie6xpcQ/lib/python3.7/site-packages/telegram/bot.py", line 82, in decorator
    result = self._request.post(url, data, timeout=kwargs.get('timeout'))
  File "/home/iuri/.local/share/virtualenvs/mau_mau_bot-hie6xpcQ/lib/python3.7/site-packages/telegram/utils/request.py", line 272, in post
    **urlopen_kwargs)
  File "/home/iuri/.local/share/virtualenvs/mau_mau_bot-hie6xpcQ/lib/python3.7/site-packages/telegram/utils/request.py", line 210, in _request_wrapper
    raise BadRequest(message)
telegram.error.BadRequest: Message text is empty

iuriguilherme avatar Nov 09 '21 02:11 iuriguilherme

Could you please provide more informations about the status of the game?

My two cents: is it Sanic mode? One player has left the chat or has been removed from the group, right?

DO97 avatar Nov 09 '21 14:11 DO97

I'm confident no player left the chat during the game, but I remember the game mode has never been set.

That stack trace comes from a bot which was in the same group as @unobot using the HEAD of the repository with unchanged settings. In the same group there was the @gameebot, one bot that keeps a persistent keyboard in the group for everyone.

The issue was happening with @unobot at first so I came up with a second bot to see if it was a network problem, telegram bot api problem, etc. - also because I could then change logging level to DEBUG and see what was happening.

I haven't dumped the logging.DEBUG but I couldn't see anything obvious there, I would need to troubleshoot the code step by step to find the exact place where there's a problem.

iuriguilherme avatar Nov 09 '21 15:11 iuriguilherme

Since you're using a copy of @unobot, Sanic mode is settled by default (if you didn't change the code).

Could you please provide the link to your group?

DO97 avatar Nov 14 '21 11:11 DO97

It would be https://t.me/joinchat/bD3i0o7K2CtjMDIx

iuriguilherme avatar Nov 14 '21 16:11 iuriguilherme

Hi @iuriguilherme , did you resolve the issue? I have the same exact one. Please let me know

nikitastykov avatar Nov 29 '21 21:11 nikitastykov

Hi @iuriguilherme , did you resolve the issue? I have the same exact one. Please let me know

Long ago I got the same error and I'm pretty sure it depends on the "status_update" function in your cases too. One of your group admins has probably removed one of the players from the group. Alternatively, one of the players may have probably left the group in the middle of a game.

Try to remove the "status_update" function from bot.py and see what happens. It's bugged and can't be precise. Skip and kick commands are a nice solution to this problem and are always available to the players.

DO97 avatar May 05 '22 16:05 DO97

idk if it's that, but after i changed inline feedback to 100% in Bot Father, bot stopped crashing Screenshot_20220628_234649 Screenshot_20220628_234828

Hatry1337 avatar Jun 28 '22 20:06 Hatry1337

idk if it's that, but after i changed inline feedback to 100% in Bot Father, bot stopped crashing Screenshot_20220628_234649 Screenshot_20220628_234828

I'm not sure if you got the same error, but yes, 100% is required.

DO97 avatar Jun 30 '22 11:06 DO97

idk if it's that, but after i changed inline feedback to 100% in Bot Father, bot stopped crashing Screenshot_20220628_234649 Screenshot_20220628_234828

I'm not sure if you got the same error, but yes, 100% is required.

Yes, error is same.

Hatry1337 avatar Jun 30 '22 12:06 Hatry1337