Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when sending a card #103

Open
iuriguilherme opened this issue Nov 9, 2021 · 9 comments
Open

Crash when sending a card #103

iuriguilherme opened this issue Nov 9, 2021 · 9 comments

Comments

@iuriguilherme
Copy link
Contributor

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
@DO97
Copy link

DO97 commented Nov 9, 2021

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?

@iuriguilherme
Copy link
Contributor Author

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.

@DO97
Copy link

DO97 commented Nov 14, 2021

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?

@iuriguilherme
Copy link
Contributor Author

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

@nikitastykov
Copy link
Contributor

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

@DO97
Copy link

DO97 commented May 5, 2022

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.

@Hatry1337
Copy link

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

@DO97
Copy link

DO97 commented Jun 30, 2022

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.

@Hatry1337
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants