Replies: 4 comments
-
So I ended up doing something like this for the time being
I put that code in my errors.py file and import that function into my other source code files. I use the
While this works I MUCH prefer to simply have 2 bots to toggle between so I do not have to wait X amount of seconds. Ill wait for feedback on this thread. |
Beta Was this translation helpful? Give feedback.
-
You're getting this error because you're doing something wrong, but no one can help figure out what you're actually doing without showing your code and bot in chats. Anyway, the code snippet provided in the comment to this question smells a bit, instead you can use the client session middleware to implement retries without changing your code in the handlers at all. Read more >> |
Beta Was this translation helpful? Give feedback.
-
Unfortunately your reply isnt helpful. It is not necessary to show my code for an error message such as
I have the following test code to trigger a
My bot spams telegram messages using the following
Here are the corresponding telegram chat logs which triggers the
What my test code does is stress test my bot to understand the limits of how many messages my bot can send into a chat. I need a solution for when my bot is rate limited on All these interactions with the telegram game bot sometimes trigger a What is an effective strategy to deal with this issue described above? Simply linking to a poorly documented I was looking at For example, I am trying the following
In theory, this The best solution in my mind is using 2 bots, and swapping between the two as 1 is rate limited. Please advise if it is allowed to use 2 bots for this purpose? Thank you |
Beta Was this translation helpful? Give feedback.
-
So this is what I ended up doing
Since I cannot get a clear answer whether I can use multiple bots to handle a situation where a bot is deactivated due to TelegramRetryAfter, I am going to implement a solution with multiple bots. |
Beta Was this translation helpful? Give feedback.
-
I am building a telegram gaming bot. My bot sends messages to the chat the bot operates in. The bot responds to the users in the chat. Sometimes the users spam commands to the bot. The bot is also printing required game information into the chat.
The load on the bot described above sometimes results in the following error
Please notice that the error messages refers to the following url for help
https://core.telegram.org/bots/faq#my-bot-is-hitting-limits-how-do-i-avoid-this
Contained within the avoid-this url, is the following documentation on limits imposed on a bot within a particular chat group
and
This two pieces of documentation appear at odds with each other.
I am looking for a viable strategy to deal with this particular exception, namely
Flood control exceeded on method 'SendMessage'
. When this error message is pushed into my bot, by telegram, I cannot even send a message to the group indicating the bot has been put on timeout for X number of seconds.What is my recourse here? Is it possible to have 2 bots in the chat? Meaning, that if Bot_A is timed-out, I can swap Bot_A with Bot_B until Bot_A comes back online?
I understand the reasoning of why telegram wants to impose these limits on their API. These limits present a severe obstacle for my use case and I am curious and probing for possible answers and solutions!
Just for brevity, here is how I am handling errors, I have an
errors.py
file which is imported where the bot is initBeta Was this translation helpful? Give feedback.
All reactions