Discord limits how many requests a bot can send to its API. There is a global limit of 50 requests per second per bot, plus separate per-route limits that Discord reports in response headers. When a bot goes over, Discord answers with a 429 status and a retry_after value, and the bot must wait that long.

Why does Discord rate limit bots at all?

Discord runs one API for millions of bots. Without limits, a single faulty or abusive bot could slow the service for everyone else. Rate limits keep the load fair.

For anyone sending direct messages through a bot, the limits matter for a practical reason. A bot that ignores them gets pushed back, and a bot that keeps ignoring them risks a temporary restriction. Sending carefully is the cheaper path.

Everything on this page about Discord's rules comes from Discord's own rate limit documentation. Check that page for the current wording, because Discord can change it.

What are per-route limits and buckets?

Discord applies per-route rate limits to many individual endpoints. A route is one kind of API call, such as sending a message. Some limits depend on the HTTP method used.

Discord also says that per-route limits are shared across a set of similar endpoints. Each shared limit is called a bucket, and the X-RateLimit-Bucket header gives the bucket a unique identifier. Discord recommends using that header as the unique identifier for a rate limit.

In plain terms, two different routes can draw from the same allowance. A bot that tracks limits by URL alone can therefore be wrong. A bot that tracks them by bucket follows what Discord is actually counting.

What is the global rate limit?

Discord states that all bots can make up to 50 requests per second to its API. This is the global limit. It applies across all routes together, on top of any per-route limit.

Requests that carry no authorization header are limited by IP address instead.

What do the rate limit headers mean?

Discord sends rate limit information back in the headers of its responses. A well-behaved bot reads them on every response, not only after an error.

The X-RateLimit-Scope values tell a bot what kind of limit it hit. According to Discord, user means a per-bot or per-user limit, global means a per-bot or per-user global limit, and shared means a per-resource limit.

What does a 429 response look like?

A 429 status means Too Many Requests. Discord's response body includes these fields:

  • message: a message saying the bot is being rate limited.
  • retry_after: the number of seconds to wait before submitting another request.
  • global: a value showing whether the bot is being globally rate limited.
  • code: an optional integer, present for some limits.

Discord's guidance is that an application should rely on the Retry-After header or the retry_after field to decide when to retry. The wait time comes from Discord, not from a guess.

What are invalid request limits and temporary bans?

Discord also counts failed requests. According to the documentation, an invalid request is one that results in a 401, 403 or 429 status. The limit is 10,000 invalid requests per 10 minutes.

IP addresses that go over this limit are automatically and temporarily restricted from accessing the Discord API. Discord adds that if a bot is only occasionally banned this way, it is most likely not a global rate limit issue. The documentation attributes it to a spike of unhandled errors that crossed the threshold.

The lesson is practical. A bot that keeps retrying a request that was already refused is not just slow. It is building up invalid requests that count against it.

Why should Discord's numbers never be hardcoded?

Discord states that rate limits should not be hard coded into an app. Instead, an app should parse the response headers, both to avoid hitting a limit and to react when it does.

There are three reasons this is the right approach:

  1. Limits differ by route and bucket, so no single number fits every call.
  2. Discord can change a limit at any time, and a hardcoded copy goes stale without warning.
  3. The headers describe the bot's actual situation at that moment, which no fixed table can.

BotLunar follows the same rule. It never stores Discord's own limits as constants. It reads them from the response headers, and it slows down when Discord pushes back.

How does BotLunar handle Discord's rate limits?

BotLunar sends direct messages through a bot that the customer creates and owns in the Discord Developer Portal. Four behaviors keep that sending inside Discord's limits.

  1. A pace of BotLunar's own. Each sending bot sends at most 12 direct messages a minute, which is one every 5 seconds. This is a safety limit set by BotLunar. It is deliberately slower than Discord allows, so a bot should rarely touch Discord's limits in the first place.
  2. Slowing down when Discord pushes back. If Discord answers with a rate limit response and a Retry-After value, BotLunar slows that bot down and resumes when it is allowed to. The campaign continues.
  3. One bot at a time. Only the bot that was pushed back slows down. The other sending bots in the campaign carry on at their own pace.
  4. Honoring the wait. BotLunar reads the value Discord supplies, rather than substituting its own idea of how long to wait.

The 12 a minute figure is a setting that the BotLunar team can change, not a number written into the sending code.

Do more sending bots really add capacity?

Yes. Discord counts rate limits per bot token. Two sending bots are therefore two separate budgets, not one budget used twice.

A campaign targets exactly one server, and it can be split across several sending bots. Each bot sends at most 12 direct messages a minute, and a server's pace is the sum of its sending bots. Four sending bots can send up to 48 a minute between them, each still sending one every 5 seconds. More sending bots finish a campaign sooner. The mass DM campaigns page shows how a campaign is set up, and the pricing page lists how many bots each plan includes.

One thing does not change with more bots. A frequency cap applies to each member across all campaigns combined. That is one message in any 24 hours on Lunar Daily, or one in any 7 days on Lunar Weekly. More bots finish a campaign sooner, and they never let one member hear from you more often.

Do backup bots make a campaign faster?

No. A campaign has one main bot and up to 2 backup bots. A backup bot takes over only if the main bot goes offline. Backup bots never send at the same time as the main bot, so they add no speed. They help a campaign finish.

The backup bots page explains the failover in more detail. For setting up a bot from the start, follow the setup guide.

How can a team stay inside the limits?

Most limit trouble comes from habits, not from the numbers themselves. A few practices help any bot, whatever tool it uses:

  • Read the headers on every response and treat them as the source of truth.
  • Track limits by bucket, using the X-RateLimit-Bucket header, not by URL.
  • Wait for the retry_after value before trying again.
  • Do not retry a refused request in a tight loop, since failed requests count toward the invalid request limit.
  • Send at a pace that sits well below the limit, so a busy moment does not become a pushback.

BotLunar applies these ideas for its customers automatically, so a campaign can run without anyone watching a rate limit counter.

Frequently asked questions

What is Discord's global rate limit for bots?

Discord's documentation states that all bots can make up to 50 requests per second to its API. Per-route limits apply in addition to this.

What does a Discord 429 error mean?

A 429 status means Too Many Requests: the bot went over a rate limit. The response includes a retry_after value, the number of seconds to wait before submitting another request.

Can a bot be banned for hitting rate limits?

Discord says that IP addresses exceeding 10,000 invalid requests per 10 minutes are automatically and temporarily restricted from the API. Invalid requests are those that return 401, 403 or 429. Slowing down when told to, and not retrying refused requests in a loop, avoids this.

Does BotLunar send as fast as Discord allows?

No. BotLunar limits each sending bot to 12 direct messages a minute, which is deliberately slower than Discord allows. Adding sending bots raises the total pace, because Discord counts limits per bot token.

Should I hardcode Discord's limits in my own bot?

No. Discord states that rate limits should not be hard coded. Read the response headers instead, and wait for the Retry-After value when Discord pushes back.

Next step

To see how a campaign is paced and how sending bots are added, read the BotLunar setup guide. To try it yourself, start the 7 day free trial on Lunar Weekly from the pricing page.