Skip to content

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

@CrsiX

Description

@CrsiX

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions