ESN Docs

Docs › Discord bots

Fix "We are being rate limited" (429 Too Many Requests) on a Discord bot

3 min readUpdated Nov 3, 2026

Why your Discord bot logs "We are being rate limited" or gets HTTP 429, what the global, per-route and Cloudflare limits are, and how to stop hitting them.

In the console, discord.py logs something like:

WARNING discord.http We are being rate limited. PATCH https://discord.com/api/v10/channels/123... responded with 429. Retrying in 287.45 seconds.

HTTP 429 means "Too Many Requests": your bot asked Discord to do the same kind of thing too often. A single warning now and then is normal and harmless, because the library waits and retries. A constant stream, or waits of minutes, means something in your code is looping.

The limits that matter #

LimitWhat happens
Per-route (each endpoint, per channel or server)The request waits. Some are very strict: renaming a channel is limited to about 2 times per 10 minutes, which is why live-counter channels lag.
Global (about 50 requests per second per bot)All requests wait for a moment.
Invalid requests (10,000 responses of 401, 403 or 429 in 10 minutes)Discord's Cloudflare blocks the IP address for a while (often shown as error 1015 or an HTML page instead of JSON).
Connections (1,000 logins per day)Discord ends all sessions and resets your token. Crash-restart loops cause this.
Creating slash commands (200 per day per server)Syncing commands fails until the limit resets.

1. Find which request is limited #

The warning names the method and route. PATCH /channels/… is usually a channel rename or edit, PUT …/commands is command syncing, POST /channels/…/messages is sending messages, PATCH …/members/… is changing nicknames or roles.

2. Remove the loop that causes it #

  • Channel or nickname counters updated every few seconds: update at most every 10 minutes, and only when the number changed.
  • Changing the bot's status in a tight loop: once a minute is plenty.
  • Sending lots of messages or DMs at once: queue them and space them out. Mass DMs also get bots flagged as spam.
  • Syncing commands in on_ready or on every start of a big bot: on_ready can run many times. Sync in setup_hook, or only when your commands change.
  • Fetching instead of using the cache: await bot.fetch_user(id) calls the API every time; bot.get_user(id) uses memory.

A safe pattern for a regular job is a task loop with a sensible interval:

from discord.ext import commands, tasks


class Stats(commands.Cog):
    def __init__(self, bot: commands.Bot) -> None:
        self.bot = bot
        self.last_name = None
        self.update_counter.start()

    async def cog_unload(self) -> None:
        self.update_counter.cancel()

    @tasks.loop(minutes=10)                     # not seconds
    async def update_counter(self) -> None:
        channel = self.bot.get_channel(123456789012345678)
        if channel is None:
            return
        new_name = f"Members: {channel.guild.member_count}"
        if new_name != self.last_name:          # only call the API when it changed
            await channel.edit(name=new_name)
            self.last_name = new_name

    @update_counter.before_loop
    async def before(self) -> None:
        await self.bot.wait_until_ready()

3. Fix crash loops #

If your bot crashes on start and the host restarts it again and again, each start is a new login. Hundreds of logins in a day use up the 1,000-per-day limit and Discord resets your token. Fix the crash first (read the first error in the console), and don't add your own "restart on crash" loop on top of the host's.

4. Let the library handle 429s #

discord.py and discord.js already read Discord's retry headers and wait the right time. Don't catch 429 errors and retry straight away yourself: retrying early counts as more invalid requests and can lead to the Cloudflare block.

Blocked even though your bot is quiet? #

The Cloudflare block applies to an IP address. On any shared host, several bots can share an IP, so a noisy neighbour can affect it. If you've checked your own bot and the block keeps coming back, open a ticket in the ESN Systems Discord with the time and the error.

FAQ #

Is one rate limit warning a problem?

No. Occasional warnings are normal; the library waits and continues. Worry when they repeat constantly or the wait is minutes long.

Why does my channel counter only update every few minutes?

Channel name edits are limited to about 2 per 10 minutes per channel. No code can go faster.

My token was reset and I got an email from Discord.

The bot probably hit the daily connection limit through a crash-restart loop. Fix the crash, reset the token, update .env and start once.

Want a host that shows you these errors live? ESN bot servers have a live console, crash logs and Python 3.12/3.13 or Node.js 22/24. Bot hosting from $0.50/month. See bot plans · or paste your error into /botfix in the ESN Systems Discord.

Still stuck? Use the live chat on the panel or ask in the ESN Systems Discord. Last updated November 3, 2026.