Rate Limited
Your bot sends too many requests to the Discord API, or too many requests that fail. It is temporarily blocked and stops responding for a few minutes, then works again.
What You See
- The bot is online but stops answering for a few minutes, then comes back
- Messages, reactions or role changes are delayed
- Errors with HTTP status 429 in the console:
429 Too Many Requests
discord.errors.HTTPException: 429 Too Many Requests (error code: 0)
Two Kinds of Limits
On KataBump, your bot is subject to Discord's own limits and to two limits per hosting account:
| Limit | Triggered when... |
|---|---|
| Global rate limit | More than 250 requests per minute to the Discord API |
| Error rate limit | More than 25 failed requests in less than a minute |
Full details and block durations: Discord Rate Limits.
Failed Requests Count Too
The error rate limit is the one that surprises people: a bot can be blocked while sending few requests, if many of them fail. Typical failing requests:
| Discord error | Cause | Prevention |
|---|---|---|
50007 Cannot send messages to this user | DMing users who closed their DMs | Catch the error and don't retry; avoid mass DMs |
50013 Missing Permissions | Acting without the right role/permission | Check permissions before the request |
10008 Unknown Message | Editing/deleting a message that no longer exists | Catch the error, don't loop on it |
10062 Unknown interaction | Replying too late | See Unknown Interaction |
How to Fix It
- Find the loop: a command or event that sends many requests in a row (welcome DMs to every member, bulk role updates, status changes every second...)
- Handle errors instead of retrying blindly — a request that failed once will usually fail again
- Use the cache: read data from
guild.members.cache/guild.get_member()instead of fetching it every time - Use events rather than polling the API on a timer
- Check for duplicate instances: two copies of the bot double every request
Log Rate Limits (discord.js)
discord.js waits automatically when Discord asks it to. Log these events to see which route is being limited:
client.rest.on('rateLimited', (info) => {
console.warn(`[rate limit] ${info.method} ${info.route} — retry in ${info.timeToReset} ms`);
});
If your bot legitimately needs more than 250 requests per minute, contact the team on Discord to discuss raising your threshold.
Check the error index or open a ticket on Discord.