Discord · 429
Discord 429: rate limited
Discord caps how fast a bot may call its API. A single 429 is normal and your library handles it. Being blocked outright means something in your bot is looping.
What you are seeing
API
429 Too Many Requests: You are being rate limited.Cloudflare
You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently.Ordinary rate limits
Every API route has its own limit, and there is a global limit of 50 requests a second per bot. discord.js and discord.py both track these and queue requests so they are not exceeded, which means a burst of work makes your bot slower rather than broken. Seeing the occasional rate-limit warning in your logs is expected.
The temporary block
The Cloudflare message is different, and more serious. Discord counts invalid requests — ones that come back 401, 403 or 429 — and a bot that makes 10,000 of them in ten minutes is blocked from the API for a while. No amount of waiting inside your code helps; the requests have to stop.
The cause is nearly always a loop: retrying a request that will never succeed (a message to a channel the bot cannot see, a DM to a user who has blocked it), editing a message every second, or a command that triggers itself. Look for a request inside a loop or a timer, and for errors being retried rather than handled.
Restart loops
A bot that crashes the moment it logs in, and is restarted automatically, logs in over and over. Discord allows 1000 logins a day before it resets the token. Our automatic restarts are there to bring a bot back from a rare crash, not to paper over one that happens on every start, so if the console shows the same error each time, fix that error before starting the bot again.
On shared infrastructure many bots can share an address, and a block can occasionally come from a neighbour rather than from you. If you are certain your bot is not looping and the block keeps coming back, tell us in the support server.
FAQ
Questions
How long does the block last?
Discord does not publish an exact duration; it is usually around an hour. Starting the bot again sooner just adds to the count, so stop it, fix the loop, and wait.
Should I add my own delays between requests?
Usually no — the library already paces requests correctly. Add a delay only around your own repeating work, such as a status update, which should run every few minutes rather than every few seconds.