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

Bot can't send all inline callback query responses when the incoming messages are spammed #1

Open
CrsiX opened this issue Sep 11, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@CrsiX
Copy link
Member

CrsiX commented Sep 11, 2020

Currently (29f6dc4), the inline reply via update.callback_query.answer can't always be send. This happens on extreme spamming of inline keyboard buttons, e.g. when a user clicks on an inline button more than appr. ten times a second. A AfterReply exception will be raised, because the bot always tries to reply. And the Telegram API seems to limit the bot's responses per second.

Such an exception may look like this: telegram.error.RetryAfter: Flood control exceeded. Retry in X seconds where the X is a number of seconds obviously.

This is related to hopfenspace/MateBot#24 because it may be solved with a response queue for all bot replies. However, the two bugs use very different reply methods, so this may be hard to achieve.

An approach to fix this is capturing this exception and just waiting for the specified time without answering any further bot requests so that the limit is not exceeded. The downside of this is that a legitimate user doesn't get his reply, too.

@CrsiX
Copy link
Member Author

CrsiX commented Sep 21, 2020

The milestone was set to Advanced Features because it looks like it's really heavy to fix this issue. And it doesn't matter so much anyway. The internal structure of the bot is not affected by those errors, e.g. adding externals is working even if the message that holds that counter is not updated anymore.

@CrsiX CrsiX transferred this issue from hopfenspace/MateBot Aug 13, 2021
@CrsiX CrsiX added the bug Something isn't working label Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant