A Discord bot gets rate limited when it sends requests faster than Discord permits, so Discord answers 429 with a Retry-After value. Retrying too soon, ignoring headers, one bot doing everything, or opening many direct messages quickly are the usual causes. The fix is to wait as told and pace each bot.
What does being rate limited look like?
Discord's rate limit documentation says that when a limit is exceeded the API returns an HTTP 429 response with a JSON body, and that an application should rely on the Retry-After header or the retry_after field to decide when to retry.
A rate limit is not a ban. It is Discord telling a bot to wait. What happens next depends on whether the bot listens. The article on Discord bot rate limits explains how buckets and headers work. This article looks at the causes from the sender's side.
What causes a bot to be rate limited?
- Sending too fast. A loop that fires as quickly as it can will hit the limit for sending messages and for opening direct messages.
- Ignoring Retry-After. Retrying straight away turns one 429 into a stream of them.
- Opening many direct messages quickly. Discord's user resource documentation says that opening a significant amount of direct messages too quickly may get a bot rate limited or blocked from opening new ones.
- One bot carrying the whole job. A single bot has a single budget, because Discord counts limits per bot token.
- Repeated invalid requests. Discord's documentation says an application that makes too many invalid requests, meaning 401, 403 or 429 responses, is temporarily restricted, and gives the figure as 10,000 per 10 minutes at the time of writing. Check the page for the current number.
Causes 2 and 5 feed each other. A bot that keeps retrying through 429s collects invalid requests.
Is a refused direct message a rate limit?
No. A refusal for a closed inbox is a different thing. Discord's opcodes and status codes documentation lists 50007, "Cannot send messages to this user", separately from 40003, "You are opening direct messages too fast". The first is about the person, the second is about speed. The article on error 50007 covers the first.
What should a sender do when rate limited?
- Wait exactly as long as Discord asks, then carry on.
- Read the headers on every response, not only after an error.
- Slow down the bot that was pushed back and leave the others alone.
- Never retry in a tight loop.
BotLunar does this automatically. When Discord pushes back, that bot waits as long as asked and resumes, and the others carry on. Nothing is hammered.
How does BotLunar avoid rate limits in the first place?
BotLunar paces each bot at no more than 12 direct messages a minute, one every 5 seconds. That figure is BotLunar's own safety limit, deliberately slower than Discord would allow, and it is an owner setting, never hardcoded. BotLunar also reads Discord's limits from its responses and does not assume them.
Because Discord counts limits per bot token, a server's pace is the sum of its sending bots. More sending bots mean a campaign finishes sooner without any one bot going faster. The article on how long a campaign takes works through the arithmetic, and more than one bot in a server shows how to add bots.
Does sending faster ever pay off?
Only by adding sending bots, not by pushing one bot to go faster. Frequency matters too. BotLunar's frequency cap counts each member across every campaign and every bot together, so more bots never let one member hear from you more often. Faster delivery to the same people is a good thing. More messages to the same person is a problem.
What if the main bot gets rate limited mid-campaign?
A bot being pushed back is slowing down, not offline. A backup bot takes over only if the main bot goes offline, and backups never send at the same time as the main bot. The campaign page shows an estimated finish time that updates when a bot slows down. See what happens when a bot goes offline.
Frequently asked questions
Does being rate limited mean my bot is banned?
No. Discord is telling the bot to wait. A bot that ignores the instruction and keeps going risks a stricter restriction.
Can I turn the pace up?
Not per bot. BotLunar's per-bot pace is a safety limit. Add sending bots within your plan to finish sooner.
Why do my messages stop for a while?
Likely a rate limit response or quiet hours. BotLunar waits as long as Discord asks, and holds messages in quiet hours rather than failing them.
Is a 429 an error in my campaign?
No. It is a pause that Discord asked for. The campaign carries on afterwards.
Next step
Read the BotLunar setup guide to see how pacing and the estimated finish time look in a real campaign, or start the 7 day free trial on Lunar Weekly from the pricing page.