REST API (HTTPS)
Stateless CRUD operations over https://discord.com/api/v10/. Used for channels, roles, guild settings, bans, kicks, message modifications, and audit logs.
Discord exposes robust programming interfaces that enable automated moderation systems, forensic audit tooling, custom event handlers, and community management bots.
REST API (HTTPS)
Stateless CRUD operations over https://discord.com/api/v10/. Used for channels, roles, guild settings, bans, kicks, message modifications, and audit logs.
Gateway API (WebSockets)
Bi-directional, real-time WebSocket connection (wss://gateway.discord.gg). Emits events such as MESSAGE_CREATE, GUILD_MEMBER_ADD, INTERACTION_CREATE, and guild state synchronizations.
Interactions & Slash Commands
Low-latency event-driven architecture. Supports slash commands (/command), user/message context menus, modal popups, and UI components (buttons, select menus).
Incoming Webhooks
One-way posting endpoints allowing third-party services (GitHub, Sentry, Stripe, moderation scripts) to push rich embeds directly to channels without a full bot client.
Discord enforces strict rate limits to guarantee system stability and prevent abuse:
X-RateLimit-Limit: Maximum allowable requests in the current window.X-RateLimit-Remaining: Remaining request allowance before exhaustion.X-RateLimit-Reset-After: Seconds until the current bucket window replenishes.X-RateLimit-Bucket: Unique hash identifying the route bucket.retry_after parameter to prevent temporary network IP bans.Modern bot development requires declaring Gateway Intents:
1 << 0): Guild lifecycle and metadata.1 << 1) (Privileged): Track joins, leaves, member updates.1 << 2): Audit log events, ban/unban dispatches.1 << 15) (Privileged): Required to inspect plain-text message contents for keyword filtering and custom regex automod..env) or secret vaults.flags: 64 (Ephemeral) on slash commands containing sensitive moderation logs or user warnings.