Privileged intents
GUILD_MEMBERS(1 << 1)GUILD_PRESENCES(1 << 8)MESSAGE_CONTENT(1 << 15) needed to read message text outside mentions and DMs- Enable them in the Developer Portal; verified bots in 100 or more servers need approval.
Interaction responses
1PONG (HTTP endpoint ping)4CHANNEL_MESSAGE_WITH_SOURCE5DEFERRED_CHANNEL_MESSAGE_WITH_SOURCE (thinking...)6DEFERRED_UPDATE_MESSAGE,7UPDATE_MESSAGE (components)8AUTOCOMPLETE_RESULT,9MODAL- Respond within 3 seconds; follow up with the token for 15 minutes. Flag 64 makes a reply ephemeral.
Commands
PUT /applications/{app_id}/commandsglobal (bulk overwrite)PUT /applications/{app_id}/guilds/{guild_id}/commandsinstant, for testing- Option types: 3 STRING, 4 INTEGER, 5 BOOLEAN, 6 USER, 7 CHANNEL, 8 ROLE, 9 MENTIONABLE, 10 NUMBER, 11 ATTACHMENT
Mentions and markdown
<@USER_ID>,<@&ROLE_ID>,<#CHANNEL_ID><t:UNIX:R>timestamps; styles t T d D f F R- **bold** *italic* __underline__ ~~strike~~ ||spoiler|| `code`, ```lang blocks
- Use allowed_mentions to stop a bot from pinging @everyone by accident.
Rate limit headers
X-RateLimit-Limit,X-RateLimit-RemainingX-RateLimit-Reset-After(seconds),X-RateLimit-BucketX-RateLimit-Global,X-RateLimit-Scopeon 429- Global limit 50 requests per second; 10,000 invalid requests per 10 minutes leads to a temporary IP ban.
Common errors
50001 Missing Accessbot cannot see the channel50013 Missing Permissionsrole order or channel overwrites10062 Unknown interactionresponded after 3 seconds40060 Interaction has already been acknowledged4014 Disallowed intent(s)Gateway close code: enable the intent in the portal
Source: discord.com/developers/docs.
Last checked against official documentation: