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
Rate limits occasionally lead to errors. #9418
Comments
This sounds like a bad idea. If you're consistently reaching the only code path that can have this happen, you're getting a 429 without at least some of the ratelimit info, see: Lines 677 to 680 in e870bb1
And it's likely a Cloudflare 429 from other times people have hit this. There's no good way to reschedule this even if it did make sense at that point, and it's better to error out when you've got a pathological case that got picked up by cloudflare than to keep trying anyhow. |
My concern is that I was able to trigger this condition with a single user (On a different network/ IP). Using a bot for moderation, it is safe to assume that even a server with a dozen or so online users would overwhelm the bot easily. That doesn't make sense, how are other unverified bots able to avoid this issue? |
Summary
Occasionally, rate limits result in errors instead of warnings. In this case the request is not rescheduled.
Reproduction Steps
For testing, a simple bot is created that will await message.delete() when on_message(message) is called.
Users will produce simulated spam in an attempt to overwhelm the API rate limit.
Minimal Reproducible Code
Expected Results
The bot will re-schedule all DELETE requests that are missed while the bot was rate limited
WARNING discord.http We are being rate limited. DELETE https://discord.com/api/v10/channels/XXXXXXXXXX/messages/XXXXXXXXXX responded with 429. Retrying in 0.XX seconds.
Actual Results
For some few messages, instead of deleting the message, the following error message is displayed
Intents
discord.Intents.all()
System Information
Checklist
Additional Context
No response
The text was updated successfully, but these errors were encountered: