NEW 📢 Black Friday: our launch offer ends 30 Nov. Up to 70% off your first month on every game!See plans
Black FridayUp to 70% off your first month, ends 30 NovEnds in 9d 04h 00mBlack FridayUp to 70% off your first month, ends 30 NovEnds in 9d 04h 00mBlack FridayUp to 70% off your first month, ends 30 NovEnds in 9d 04h 00m

How to avoid Discord rate limits and bot bans

Discord bot hostingUpdated Oct 28, 20264 min read

Discord limits how fast a bot may send requests. A normal bot rarely notices, but a loop that edits many messages, reacts in bulk or messages many people can hit the limit, and some behaviour gets a bot banned outright. Discord's rules decide both; this page is how to stay clear.

What a rate limit looks like

Discord answers a request that came too fast with status 429 Too Many Requests and a time to wait. Libraries handle it for you: they wait and retry.

  • discord.py logs a warning that starts with We are being rate limited.
  • discord.js waits quietly. To see it, log the REST rateLimited event: client.rest.on('rateLimited', console.log).

A few of these are normal. A steady stream in Console means your code sends too much, and commands start to feel slow.

How to stay inside the limits

  • Do work once. Keep results you already have instead of asking Discord again every time someone runs a command.
  • Do not call the API once per member or channel in a loop. Use bulk actions where they exist, such as bulk delete.
  • Slow down loops that send, edit or react, with a short wait between steps.
  • Answer slash commands in time. Discord needs a reply within three seconds; for slow work, defer first and follow up: Common Discord bot errors and what they mean.
  • Run one copy of the bot. The same token running on your PC and on the server answers every command twice and doubles your requests. Stop the copy at home once the bot is hosted.
  • Do not retry failed requests in a tight loop. Discord temporarily blocks an address that sends too many failed requests (unauthorized, forbidden or rate limited) in a short time.

What can get a bot banned

  • Unwanted direct messages to many people.
  • Spam, including joining servers to advertise.
  • Self-bots: logging in with a normal account's token instead of a bot token. Discord does not allow it, and we do not host them; the Bot tab refuses an account token when you paste it. See Discord bot hosting rules and fair use.
  • A leaked token that someone else misuses: How to keep your Discord bot token safe.

If your bot is already limited

  1. Stop the bot, read Console to find which action repeats, fix it and start again: How to read your Discord bot's console and logs.
  2. Add a wait or a limit to the part of the code that retries.
  3. If you think someone else used the token, press Reset Token in the Developer Portal and paste the new one with Replace token on the Bot tab, under Discord.

Already hosting your bot somewhere else? Move it to us

OUR LATEST BLOGS