You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They say that you should not hard code the retry timeout:
Because we may change rate limits at any time and rate limits can be different per application, rate limits should not be hard coded into your bot/application. In order to properly support our dynamic rate limits, your bot/application should parse for our rate limits in response headers and locally prevent exceeding the limits as they change.
Right now the RequestException is caught and a CouldNotSendNotification exception is thrown. The latter only includes the message keyword from the response sent by Discord API. The other keywords like retry_after and global are being discarded.
One fix for this could be to include the original RequestException exception as the previous exception to the thrown CouldNotSendNotification. Exceptions have 3 constructor arguments, the message, code and previous exception. Only the message part is currently used. Setting the previous exception should make it possible for the Laravel app to get the body of the original Discord response from the original exception and parse out the retry_after or other data.
The text was updated successfully, but these errors were encountered:
Discord sends back data in the response body when there is a rate limit error.
See: https://discord.com/developers/docs/topics/rate-limits
They say that you should not hard code the retry timeout:
Right now the
RequestException
is caught and aCouldNotSendNotification
exception is thrown. The latter only includes themessage
keyword from the response sent by Discord API. The other keywords likeretry_after
andglobal
are being discarded.One fix for this could be to include the original
RequestException
exception as the previous exception to the thrownCouldNotSendNotification
. Exceptions have 3 constructor arguments, the message, code and previous exception. Only the message part is currently used. Setting the previous exception should make it possible for the Laravel app to get the body of the original Discord response from the original exception and parse out theretry_after
or other data.The text was updated successfully, but these errors were encountered: