RateĀ limits
Limits are per bot, so another bot never eats your budget. The SDKs queue and retry for you; here is what they handle.
REST
| Limit | Value |
|---|---|
| All requests of a bot | 50 per second (global: true when hit) |
| Posts and uploads per channel | 5 per 5 seconds (an edit that sends allowed_mentions counts as a post) |
| Wrong tokens per client address | 30 a minute |
| A channel's slow mode | applies to bots like to members, unless the bot has Manage messages |
A 429 carries a Retry-After header and:
{"message": "You are being rate limited.", "retry_after": 1.2, "global": false}
Wait retry_after seconds, then retry.
Gateway
| Limit | Value |
|---|---|
| Frames from the bot | 120 a minute, at most 4096 bytes each |
| Live connections per bot | 3 (plus 6 resumable sessions) |
| Presence updates | 5 per 60 seconds per bot; extra ones are dropped |
| Too many frames, IDENTIFYs or connections | closed with 4008 |
Interactions
| Limit | Value |
|---|---|
| Command runs per member | 20 a minute |
| Clicks and modal submits per member | 30 a minute |
| Messages per interaction | 5 in total (first answer, the deferred message and follow-ups) |
| Answer window | 15 minutes |
What the SDKs do
Both SDKs read the rate-limit headers, queue requests per bucket and retry a 429 after retry_after. They also keep the heartbeat, resume within the window and reconnect with back-off. Their sections on rate limits and reconnects: TypeScript, Go.