Discord API Documentation
website·Indexed 31 days ago
https://discord-userdoccers.vercel.app/Technical documentation for integrating with Discord, covering the Gateway WebSocket API, Voice connections, and HTTP interfaces. Includes detailed specifications for application commands, interactions, OAuth2 authentication, rate limits, and resource objects such as guilds, messages, and user settings.
What's inside Discord
- Applications are Discord entities representing games, services, and other integrations that can be added to a guild. They provide the foundation for implementing OAuth2 authentication, rich presence, bots, and other third-party integrations within the Discord ecosystem.
Overview of the Discord Gateway API
The Gateway API provides a secure WebSocket connection allowing clients to receive real-time events (e.g., channel updates, role creation) and occasionally update or request resources (e.g., updating voice state). All communication is encapsulated in Gateway event payloads consisting of an Opcode (op) and a data object (d).Overview of Discord Directories
A directory in Discord is a special type of channel containing a list of directory entries. These entries consist of guilds and scheduled events that have been made discoverable by the community. Any user with access to the directory channel can view these entries and join the associated guilds. Directories are most commonly utilized within student hubs.Overview of Discord Voice Connections
Voice connections use a separate UDP-based connection for RTC (Real-Time Communication) data transmission alongside the Voice Gateway. Clients must be able to receive UDP packets, potentially requiring UDP Hole Punching to bypass firewalls or NAT. If UDP is not supported, a WebRTC connection should be implemented instead. Note that 'Go Live' streams require a separate connection to a different voice server; only microphone and camera data use the standard voice connection.Overview of Premium Referrals (Nitro Trials)
Premium referrals, also known as Nitro trials, allow Nitro subscribers to share up to three 2-week Nitro subscriptions with friends. To be eligible, the recipient must not have had an active Nitro subscription in the past 12 months. Referral links expire after 48 hours.Overview of Discord Messages
Messages are the primary communication unit in Discord. They can contain text, images, and other media. Additionally, system-level content such as polls, system messages, and calls are represented as message objects.Overview of Discord Family Center
Family Center is a parental control solution that allows parents (Requestors) to monitor the activities of teens (Linked Users) on Discord. While it does not allow parents to view actual message content, it provides visibility into:
- Users messaged (DMs and Group DMs)
- Users called (DMs and Group DMs) in the last week
- Friends added in the last week
- Guilds joined in the last week
- Guilds the teen has sent messages to in the last week
A single parent account can be connected to a maximum of 8 accounts.
Overview of Discord Message Components
Message components are interactive elements that can be added to messages sent by an app or bot. They are defined in thecomponentsfield of a message object as an array of Action Rows. Components are used to create accessible and customizable user interfaces within Discord messages.Understand Discord Channel objects
Channels are the primary interaction mechanism in Discord. All conversations, including text and voice interactions within guilds or group DMs, occur within a channel object.Understand Discord user types and limitations
Discord users are categorized as either 'bot' or 'normal'. Bot users are automated accounts attached to an application and owned by a user. A key difference is that bot users do not have a limitation on the number of guilds they can join, whereas normal users do.Understand the Monetization Store Page structure
The
monetization_store_pageobject provides details about a guild's monetization setup and consists of two primary components:guild: A Store Page Guild object containing the specific guild information related to the store.role_subscription: A Store Page Role Subscription object containing the guild's role subscription details.
Understand the Discord Gateway API
The Gateway API uses secure WebSocket connections (RFC 6455) to maintain persistent, stateful connections between a client and Discord servers. It is used to send and receive real-time events to track and update local state.