Discord.py: Raise an error when being rate limited

Created on 29 May 2020  路  2Comments  路  Source: Rapptz/discord.py

The Problem

With the changes to rate limits for changing vc names, can we get an error raised when being rate limited or an option to not wait for the rate limit to be up?

The Ideal Solution

Either an error or option to not retry rate limited requests

The Current Solution

There is none other than to wait for the rate limit to be up.

Summary

Waiting for rate limits to finish causes big delays in command execution as the request will wait (sometimes a long time) for rate limits to be up.

suggestion

Most helpful comment

This tends to be brought up sometimes in the official server and the answer is currently no. I'm not overly a fan of shifting responsibility of this to the user as it could lead them to spam 429s and eventually get themselves banned -- something a library should avoid and I do not want to take the blame for it.

If you want to do this when you can use asyncio.wait_for with a reasonable timeout and handle it that way -- this way the library does what it wants to do and nothing breaks.

All 2 comments

This tends to be brought up sometimes in the official server and the answer is currently no. I'm not overly a fan of shifting responsibility of this to the user as it could lead them to spam 429s and eventually get themselves banned -- something a library should avoid and I do not want to take the blame for it.

If you want to do this when you can use asyncio.wait_for with a reasonable timeout and handle it that way -- this way the library does what it wants to do and nothing breaks.

I'd like to suggest that an exception is only thrown if the wait isn't reasonable anymore, for example above 1 minute
All these threads above me with confused users, speak for themselves. I _really_ don't get why you're against this. At least elaborate in what case this might happen:

as it could lead them to spam 429s and eventually get themselves banned

or could a compromise perhaps be reached, where the library waits for the rate-limit to pass, until it either passes or the threshold has been reached, and then raises the exception?
@Rapptz

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jzburda picture jzburda  路  3Comments

Yolotroll101 picture Yolotroll101  路  3Comments

synbitz picture synbitz  路  3Comments

JackL0 picture JackL0  路  3Comments

Spyder-exe picture Spyder-exe  路  3Comments