API Feature Suggestion: allow setup for a webhook so a message will be sent to you when your bot gets rate limited. #7387
Replies: 2 comments 3 replies
-
I think that’s called rate-limit headers man 😭 |
Beta Was this translation helpful? Give feedback.
-
Discord gives you all sorts of info about your limits in the response to most requests. You can use this info to create these notifications yourself. See the Rate Limit Docs for more info Rate limits are usually per "bucket" (groups of routes), and it is possible to be limited in only one bucket while not being limited in other buckets. For example, your bot might be rate limited in a specific channel due to users there spamming commands, but will still be able to message other channels. Being ratelimited globally will only happen if you do something very wrong and spam a lot of bad requests, so a webhook like this wouldn't even make much sense. It is pretty normal for bots to hit rate-limis in specific buckets from time to time (for example due to multiple users spamming commands like mentioned above) and your bot should just handle this by queuing requests or implementing features like command cooldowns. If you are getting globally rate-limited, you are likely doing something very wrong. Using a proper bot library is highly recommended as these handle rate limits properly for you and you should never run into any issues with rate limits with them. You can find some libraries here or by searching on github |
Beta Was this translation helpful? Give feedback.
-
Like a customizable web hook message that will be sent when your bot gets rate limited. It will say for how long and you can customize if it pings you or not.
Beta Was this translation helpful? Give feedback.
All reactions