Retry-After is the number of seconds Discord tells a bot to wait before sending another request after it has been rate limited. It arrives on an HTTP 429 response, as a header and as a retry_after field in the body. A careful sender waits that long, then carries on. It is an instruction, not a punishment.
Where does Retry-After appear?
Discord's rate limit documentation says that when a rate 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 determine when to retry.
The body has these fields, according to the documentation:
| Field | Meaning |
|---|---|
| message | A message saying you are being rate limited |
| retry_after | The number of seconds to wait before submitting another request |
| global | Whether the limit is the global one |
| code | An error code for some limits, optional |
The value can have decimals. In Discord's own example the header says 65 and the body says 64.57, so use what Discord sends rather than rounding it yourself.
What are the other rate limit headers?
Discord also returns optional headers on most API responses, so a bot can see a limit coming before it is hit.
- X-RateLimit-Limit: the number of requests that can be made.
- X-RateLimit-Remaining: the number of requests still allowed.
- X-RateLimit-Reset: the epoch time at which the limit resets.
- X-RateLimit-Reset-After: the total time in seconds until the current bucket resets.
- X-RateLimit-Bucket: a unique string naming the limit.
- X-RateLimit-Scope: on 429 responses only, whether the limit is per bot, global or per resource.
The article on Discord bot rate limits explains buckets and the global limit in more detail.
What should a sender do on a 429?
- Stop sending to that route for the number of seconds given.
- Wait the full time. Do not shorten it.
- Resume with the next request.
- Log it, so a pattern becomes visible.
A sender that retries immediately turns one 429 into many. Discord's documentation also describes a limit on invalid requests, meaning 401, 403 and 429 responses, which at the time of writing is 10,000 per 10 minutes, after which an application is temporarily restricted. Check the page for the current figure.
How does BotLunar use Retry-After?
BotLunar reads Discord's limits from its responses, and never hardcodes them. When Discord asks a bot to wait, that bot waits exactly as long as asked and carries on, and the campaign's estimated finish time updates. The other bots keep sending, because Discord counts limits per bot.
On top of that, 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, slower than Discord would allow, so a bot should rarely meet a 429 in the first place. The article on why bots get rate limited covers the causes.
Is Retry-After a ban?
No. It is Discord telling the bot to slow down. Repeatedly ignoring it is what leads to stricter restrictions. A bot that behaves is not penalized for having been told to wait.
How does it affect a campaign?
A pause from Retry-After lengthens a campaign a little. The estimated finish time shown in BotLunar reflects it. If you need a campaign to finish sooner, add sending bots within your plan, as the article on how long a campaign takes explains. A backup bot does not help here, because it takes over only when the main bot goes offline, and a bot being told to wait is not offline.
Where can I read more?
Discord's rate limit page is the authority. The setup guide covers how BotLunar paces sending. Always check Discord's page for current wording, because Discord can change it.
Frequently asked questions
Is Retry-After in seconds?
Yes. Discord's documentation says retry_after is the number of seconds to wait before submitting another request.
Can I ignore a short Retry-After?
No. Wait the full time Discord gives, even when it is under a second.
Does a 429 mean something is wrong with my bot?
Not necessarily. It means the bot asked too often for a route. Pacing avoids most of them.
Do backup bots help with Retry-After?
No. They take over only if the main bot goes offline. Adding sending bots divides the work.
Next step
Read the BotLunar setup guide to see pacing in a real campaign, or start the 7 day free trial on Lunar Weekly from the pricing page.