Embedded App SDK Reference
The Embedded App SDK handles making RPC calls between your application and Discord. It is designed to assist developers in developing interactive Activities like games.
To learn more about building Activities, check out our Building an Activity tutorial or explore our Sample Projects.
Install the SDK
Section titled “Install the SDK”The Embedded App SDK is available via npm and GitHub.
In your frontend JavaScript project directory, install using your package manager of choice.
npm install @discord/embedded-app-sdkAfter installing, you can import and instantiate the SDK in your project.
import { DiscordSDK } from "@discord/embedded-app-sdk";
const discordSdk = new DiscordSDK(DISCORD_CLIENT_ID);SDK Methods
Section titled “SDK Methods”| Name | Description |
|---|---|
| ready | Resolves when your app has successfully connected to the Discord client |
| subscribe | Subscribe to an Embedded App SDK Event |
| unsubscribe | Unsubscribe to an Embedded App SDK Event |
| close | Close an Embedded App |
ready()
Section titled “ready()”Resolves when your app has successfully connected to the Discord client.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”ready(): Promise<void>
SDK Usage
Section titled “SDK Usage”async function setup() {
await discordSdk.ready();
// The rest of your app logic
}subscribe()
Section titled “subscribe()”Used to subscribe to a specific event from the list of SDK Events.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”Depends on the event. Refer to the Required Scopes for the specific event you are subscribing to.
Signature
Section titled “Signature”subscribe<Event>(event: Event, listener: (data: EventPayloadData<Event>) => void, ...subscribeArgs: Partial<EventPayloadData<Event>>): Promise<EventEmitter>
await discordSdk.subscribe("SDK_EVENT_NAME", eventHandler, args);unsubscribe()
Section titled “unsubscribe()”Used to unsubscribe to SDK Events that your app has already subscribed to.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”The EventPayloadData will vary based on the event you are unsubscribing from. See the specific event for details.
unsubscribe<Event>(event: Event, listener: (data: EventPayloadData<Event>) => void, ...subscribeArgs: Partial<EventPayloadData<Event>>): Promise<EventEmitter>
await discordSdk.unsubscribe("SDK_EVENT_NAME");close()
Section titled “close()”Used to close your app with a specified code and reason.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”close(code: RPCCloseCodes, message: string): void
SDK Usage
Section titled “SDK Usage”discordSdk.close(RPCCloseCodes.CLOSE_NORMAL, "You exited from app");SDK Commands
Section titled “SDK Commands”Developers can use these commands to interact with the Discord client. The following SDK commands are prefixed with .commands, such as, discordSDK.commands.authenticate.
| Name | Description |
|---|---|
| authenticate | Authenticate an existing client with your app |
| authorize | Authorize a new client with your app |
| captureLog | Forward logs to your own logger |
| encourageHardwareAcceleration | Presents a modal dialog to allow enabling of hardware acceleration |
| getChannel | Returns information about the channel, per the channel_id |
| getChannelPermissions | Returns permissions for the current user in the currently connected channel |
| getEntitlements | Returns a list of entitlements for the current user |
| getInstanceConnectedParticipants | Returns all participants connected to the instance |
| getPlatformBehaviors | Returns information about supported platform behaviors |
| getRelationships | Allows your app to access a user’s Discord Friends list, their pending requests, and blocked users. This scope is part of our Social SDK - submit for access here. Social SDK Terms apply, including Section 5(a)(ii) to the data you obtain |
| getSkus | Returns a list of your app's SKUs |
| initiateImageUpload | Presents the file upload flow in the Discord client |
| openExternalLink | Allows for opening an external link from within the Discord client |
| openInviteDialog | Presents a modal dialog with Channel Invite UI without requiring additional OAuth scopes |
| openShareMomentDialog | Presents a modal dialog to share media to a channel or DM |
| setActivity | Modifies how your activity's rich presence is displayed in the Discord client |
| setConfig | Set whether or not the PIP (picture-in-picture) is interactive |
| setOrientationLockState | Set options for orientation and picture-in-picture (PIP) modes |
| shareLink | Presents a modal for the user to share a link to your activity with custom query params |
| startPurchase | Launches the purchase flow for a specific SKU, per the sku_id |
| userSettingsGetLocale | Returns the current user's locale |
authenticate()
Section titled “authenticate()”Authenticate an existing client with your app.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”authenticate(args: AuthenticateRequest): Promise<AuthenticateResponse>
await discordSdk.commands.authenticate({
access_token: 'ACCESS_TOKEN_STRING'
});authorize()
Section titled “authorize()”Authorize a new client with your app.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”authorize(args: AuthorizeRequest): Promise<AuthorizeResponse>
await discordSdk.commands.authorize({
client_id: DISCORD_CLIENT_ID,
response_type: "code",
state: "",
prompt: "none",
scope: [
// "applications.builds.upload",
// "applications.builds.read",
// "applications.store.update",
// "applications.entitlements",
// "bot",
"identify",
// "connections",
// "email",
// "gdm.join",
"guilds",
// "guilds.join",
// "guilds.members.read",
// "messages.read",
// "relationships.read",
// 'rpc.activities.write',
// "rpc.notifications.read",
// "rpc.voice.write",
// "rpc.voice.read",
// "webhook.incoming",
],
});captureLog()
Section titled “captureLog()”Forward logs to your own logger.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”captureLog(args: CaptureLogRequest): Promise<void>
await discordSdk.commands.captureLog({
level: 'log',
message: 'This is my log message!'
});encourageHardwareAcceleration()
Section titled “encourageHardwareAcceleration()”Presents a modal dialog to allow enabling of hardware acceleration.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ⛔️ | ⛔️ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”encourageHardwareAcceleration(): Promise<EncourageHardwareAccelerationResponse>
await discordSdk.commands.encourageHardwareAcceleration();getChannel()
Section titled “getChannel()”Returns information about the channel for a provided channel ID.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”- [guilds] for guild channels
- [guilds, dm_channels.read] for GDM channels. dm_channels.read requires approval from Discord.
Signature
Section titled “Signature”getChannel(args: GetChannelRequest): Promise<GetChannelResponse>
await discordSdk.commands.getChannel({
channel_id: discordSdk.channelId,
});getChannelPermissions()
Section titled “getChannelPermissions()”Returns permissions for the current user in the currently connected channel.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”- guilds.members.read
Signature
Section titled “Signature”getChannelPermissions(): Promise<GetChannelPermissionsResponse>
await discordSdk.commands.getChannelPermissions();getEntitlements()
Section titled “getEntitlements()”Returns a list of entitlements for the current user.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”getEntitlements(): Promise<GetEntitlementsResponse>
await discordSdk.commands.getEntitlements();getInstanceConnectedParticipants()
Section titled “getInstanceConnectedParticipants()”Returns all participants connected to the instance.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”getInstanceConnectedParticipants(): Promise<GetInstanceConnectedParticipantsResponse>
await discordSdk.commands.getInstanceConnectedParticipants();getPlatformBehaviors()
Section titled “getPlatformBehaviors()”Returns information about supported platform behaviors.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”getPlatformBehaviors(): Promise<GetPlatformBehaviorsResponse>
await discordSdk.commands.getPlatformBehaviors();getRelationships()
Section titled “getRelationships()”Returns the current user's relationships.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”- relationships.read
Signature
Section titled “Signature”getRelationships(): Promise<GetRelationshipsResponse>
await discordSdk.commands.getRelationships();getSkus()
Section titled “getSkus()”Returns a list of SKU objects. SKUs without prices are automatically filtered out.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”getSkus(): Promise<GetSkusResponse>
await discordSdk.commands.getSkus();initiateImageUpload()
Section titled “initiateImageUpload()”Presents the file upload flow in the Discord client.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”initiateImageUpload(): Promise<InitiateImageUploadResponse>
await discordSdk.commands.initiateImageUpload();openExternalLink()
Section titled “openExternalLink()”Allows for opening an external link from within the Discord client.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”openExternalLink(args: OpenExternalLinkRequest): Promise<OpenExternalLinkResponse>
await discordSdk.commands.openExternalLink({
url: 'string url'
});openInviteDialog()
Section titled “openInviteDialog()”Presents a modal dialog with Channel Invite UI without requiring additional OAuth scopes.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”openInviteDialog(): Promise<void>
await discordSdk.commands.openInviteDialog();openShareMomentDialog()
Section titled “openShareMomentDialog()”Presents a modal dialog to share media to a channel or direct message.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ⛔️ | ⛔️ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”openShareMomentDialog(args: OpenShareMomentDialogRequest) Promise<void>
await discordSdk.commands.openShareMomentDialog({
mediaUrl: 'DISCORD_CDN_URL'
});setActivity()
Section titled “setActivity()”Modifies how your Activity's Rich Presence data is displayed in the Discord client. The inner activity field is a partial Activity object.
Read the guide on Using Rich Presence with the Embedded App SDK for more usage details.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”- rpc.activities.write
Signature
Section titled “Signature”setActivity(args: SetActivityRequest): Promise<Activity>
await discordSdk.commands.setActivity({
activity: {
type: 0,
details: 'Details',
state: 'Playing'
}
});setConfig()
Section titled “setConfig()”Set whether or not the PIP (picture-in-picture) is interactive.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ⛔️ | ⛔️ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”setConfig(args: SetConfigRequest): Promise<SetConfigResponse>
await discordSdk.commands.setConfig({
use_interactive_pip: true
})setOrientationLockState()
Section titled “setOrientationLockState()”Locks the application to specific orientations in each of the supported layout modes.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ⛔️ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”setOrientationLockState(args: SetOrientationLockStateRequest): Promise<void>
import {Common} from '@discord/embedded-app-sdk';
await discordSdk.commands.setOrientationLockState({
lock_state: Common.OrientationLockStateTypeObject.LANDSCAPE,
picture_in_picture_lock_state: Common.OrientationLockStateTypeObject.LANDSCAPE,
grid_lock_state: Common.OrientationLockStateTypeObject.UNLOCKED
});shareLink()
Section titled “shareLink()”Presents the user with a modal to share a link
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”shareLink(args: ShareLinkRequest): Promise<ShareLinkResponse><void>
const { success } = await discordSdk.commands.shareLink({
message: 'This message is shared alongside the link!',
custom_id: 'some_custom_id',
});
success ? console.log('User shared link!') : console.log('User did not share link!');startPurchase()
Section titled “startPurchase()”Launches the purchase flow for a specific SKU ID.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ⛔️ | ⛔️ |
Required Scopes
Section titled “Required Scopes”No scopes required
Signature
Section titled “Signature”startPurchase(args: StartPurchaseRequest): Promise<StartPurchaseResponse>
await discordSdk.commands.startPurchase({sku_id: skuId});userSettingsGetLocale()
Section titled “userSettingsGetLocale()”Returns the current user's locale.
Supported Platforms
Section titled “Supported Platforms”| Web | iOS | Android |
|---|---|---|
| ✅ | ✅ | ✅ |
Required Scopes
Section titled “Required Scopes”- identify
Signature
Section titled “Signature”userSettingsGetLocale(): Promise<UserSettingsGetLocaleResponse>
await discordSdk.commands.userSettingsGetLocale();SDK Events
Section titled “SDK Events”Developers may use the following events alongside the subscribe() SDK method to subscribe to events from Discord and supported devices.
| Name | Description |
|---|---|
| READY | non-subscription event sent immediately after connecting, contains server information |
| ERROR | non-subscription event sent when there is an error, including command responses |
| VOICE_STATE_UPDATE | sent when a user's voice state changes in a subscribed voice channel (mute, volume, etc.) |
| SPEAKING_START | sent when a user in a subscribed voice channel speaks |
| SPEAKING_STOP | sent when a user in a subscribed voice channel stops speaking |
| ACTIVITY_LAYOUT_MODE_UPDATE | Received when a user changes the layout mode in the Discord client |
| ORIENTATION_UPDATE | Received when screen orientation changes |
| CURRENT_USER_UPDATE | Received when the current user object changes |
| CURRENT_GUILD_MEMBER_UPDATE | Received when the current guild member object changes |
| THERMAL_STATE_UPDATE | Received when Android or iOS thermal states are surfaced to the Discord app |
| ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE | Received when the number of instance participants changes |
| RELATIONSHIP_UPDATE | Received when a relationship of the current user is updated |
| ENTITLEMENT_CREATE | Received when an entitlement is created for a SKU |
Non-subscription event sent immediately after connecting, contains server information.
Required Scopes
Section titled “Required Scopes”No scopes required
Sample Event Payload
Section titled “Sample Event Payload”{
"v": 1,
"config": {
"cdn_host": "cdn.discordapp.com",
"api_endpoint": "//discord.com/api",
"environment": "production"
}
}Non-subscription event sent when there is an error, including command responses.
Required Scopes
Section titled “Required Scopes”No scopes required
Sample Event Payload
Section titled “Sample Event Payload”{
"code": 4006,
"message": "Not authenticated or invalid scope"
}VOICE_STATE_UPDATE
Section titled “VOICE_STATE_UPDATE”Received when a user's voice state changes in a subscribed voice channel (mute, volume, etc).
Required Scopes
Section titled “Required Scopes”- rpc.voice.read
Sample Event Payload
Section titled “Sample Event Payload”{
"voice_state": {
"mute": false,
"deaf": false,
"self_mute": false,
"self_deaf": false,
"suppress": false
},
"user": {
"id": "190320984123768832",
"username": "test 2",
"discriminator": "7479",
"avatar": "b004ec1740a63ca06ae2e14c5cee11f3",
"bot": false
},
"nick": "test user 2",
"volume": 110,
"mute": false,
"pan": {
"left": 1.0,
"right": 1.0
}
}SPEAKING_START
Section titled “SPEAKING_START”Received when a user in a subscribed voice channel speaks.
Required Scopes
Section titled “Required Scopes”- rpc.voice.read
Sample Event Payload
Section titled “Sample Event Payload”{
"channel_id": "7173758092142710784",
"user_id": "7173758143913005056"
}SPEAKING_STOP
Section titled “SPEAKING_STOP”Received when a user in a subscribed voice channel stops speaking.
Required Scopes
Section titled “Required Scopes”- rpc.voice.read
Sample Event Payload
Section titled “Sample Event Payload”{
"channel_id": "7173758211307081728",
"user_id": "7173758261412237312"
}ACTIVITY_LAYOUT_MODE_UPDATE
Section titled “ACTIVITY_LAYOUT_MODE_UPDATE”Received when a user changes the layout mode in the Discord client.
Required Scopes
Section titled “Required Scopes”No scopes required
Sample Event Payload
Section titled “Sample Event Payload”{
"layout_mode": 1
}ORIENTATION_UPDATE
Section titled “ORIENTATION_UPDATE”Received when screen orientation changes.
Required Scopes
Section titled “Required Scopes”No scopes required
Sample Event Payload
Section titled “Sample Event Payload”{
"screen_orientation": 1
}CURRENT_USER_UPDATE
Section titled “CURRENT_USER_UPDATE”Received when the current user object changes.
Required Scopes
Section titled “Required Scopes”- identify
Sample Event Payload
Section titled “Sample Event Payload”{
"id": "7173771622812225536",
"username": "beef_supreme",
"discriminator": "0",
"global_name": "Dis Cord",
"avatar": "abcdefg",
"avatar_decoration_data": {
"asset": "abcdefg",
"sku_id": "123456789"
},
"bot": false,
"flags": 1,
"premium_type": 2
}CURRENT_GUILD_MEMBER_UPDATE
Section titled “CURRENT_GUILD_MEMBER_UPDATE”Received when the current guild member object changes.
Required Scopes
Section titled “Required Scopes”- identify
- guilds.members.read
Sample Event Payload
Section titled “Sample Event Payload”{
"user_id": "7173771622812225536",
"nick": "beef_supreme",
"guild_id": "613425648685547541"
"avatar": "abcdefg",
"avatar_decoration_data": {
"asset": "abcdefg",
"sku_id": "123456789"
},
"color_string": "#ffff00"
}THERMAL_STATE_UPDATE
Section titled “THERMAL_STATE_UPDATE”Received when Android or iOS thermal states are surfaced to the Discord mobile app.
Required Scopes
Section titled “Required Scopes”No scopes required
Sample Event Payload
Section titled “Sample Event Payload”{
thermal_state: 0
}ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE
Section titled “ACTIVITY_INSTANCE_PARTICIPANTS_UPDATE”Received when the number of instance participants changes.
Required Scopes
Section titled “Required Scopes”No scopes required
Sample Event Payload
Section titled “Sample Event Payload”{
"participants": [
{
"id": "7173771622812225536",
"username": "beef_supreme",
"discriminator": "0",
"global_name": "Dis Cord",
"avatar": "abcdefg",
"avatar_decoration_data": {
"asset": "abcdefg",
"sku_id": "123456789"
},
"bot": false,
"flags": 1,
"premium_type": 2
}
]
}RELATIONSHIP_UPDATE
Section titled “RELATIONSHIP_UPDATE”Received when a relationship of the current user is updated.
Required Scopes
Section titled “Required Scopes”- relationships.read
Sample Event Payload
Section titled “Sample Event Payload”{
"type": 1,
"user": {
"id": "7173771622812225536",
"username": "beef_supreme",
"discriminator": "0",
"global_name": "Dis Cord",
"avatar": "abcdefg",
"avatar_decoration_data": {
"asset": "abcdefg",
"sku_id": "123456789"
},
"bot": false,
"flags": 1,
"premium_type": 2
}
}ENTITLEMENT_CREATE
Section titled “ENTITLEMENT_CREATE”SDK Interfaces
Section titled “SDK Interfaces”Activity
Section titled “Activity”| Property | Type |
|---|---|
| name | string |
| type | number |
| url? | string | null |
| created_at? | number | null |
| timestamps? | Timestamp | null |
| application_id? | string | null |
| details? | string | null |
| details_url? | string | null |
| state? | string | null |
| state_url? | string | null |
| emoji? | Emoji | null |
| party? | Party | null |
| assets? | Assets | null |
| secrets? | Secrets | null |
| instance? | boolean | null |
| flags? | number | null |
Assets
Section titled “Assets”| Property | Type |
|---|---|
| large_image? | string | null |
| large_text? | string | null |
| large_url? | string | null |
| small_image? | string | null |
| small_text? | string | null |
| small_url? | string | null |
Application
Section titled “Application”| Property | Type |
|---|---|
| description | string |
| icon? | string | null |
| id | string |
| rpc_origins? | string[] |
| name | string |
Attachment
Section titled “Attachment”| Property | Type |
|---|---|
| id | string |
| filename | string |
| size | number |
| url | string |
| proxy_url | string |
| height? | number | null |
| width? | number | null |
AuthenticateRequest
Section titled “AuthenticateRequest”| Property | Type |
|---|---|
| access_token? | string | null |
AuthenticateResponse
Section titled “AuthenticateResponse”| Property | Type |
|---|---|
| access_token | string |
| user | User |
| scopes | string[] |
| expires | string |
| application | Application |
AuthorizeRequest
Section titled “AuthorizeRequest”| Property | Type |
|---|---|
| client_id | string |
| scope | OAuthScopes[] |
| response_type? | 'code' |
| code_challenge? | string |
| state? | string |
| prompt? | 'none' |
| code_challenge_method? | 'S256' |
AuthorizeResponse
Section titled “AuthorizeResponse”| Property | Type |
|---|---|
| code | string |
AvatarDecorationData
Section titled “AvatarDecorationData”| Property | Type |
|---|---|
| asset | string |
| sku_id? | string | null |
CaptureLogRequest
Section titled “CaptureLogRequest”| Property | Type |
|---|---|
| level | ConsoleLevel |
| message | string |
ChannelMention
Section titled “ChannelMention”| Property | Type |
|---|---|
| id | string |
| guild_id | string |
| type | number |
| name | string |
| Property | Type |
|---|---|
| title? | string | null |
| type? | string | null |
| description? | string | null |
| url? | string | null |
| timestamp? | string | null |
| color? | number | null |
| footer? | EmbedFooter | null |
| image? | Image | null |
| thumbnail? | Image | null |
| video? | Video | null |
| provider? | EmbedProvider | null |
| author? | EmbedAuthor | null |
| fields? | EmbedField[] | null |
EmbedAuthor
Section titled “EmbedAuthor”| Property | Type |
|---|---|
| name? | string | null |
| url? | string | null |
| icon_url? | string | null |
| proxy_icon_url? | string | null |
EmbedField
Section titled “EmbedField”| Property | Type |
|---|---|
| name | string |
| value | string |
| inline | boolean |
EmbedFooter
Section titled “EmbedFooter”| Property | Type |
|---|---|
| text | string |
| icon_url? | string | null |
| proxy_icon_url? | string | null |
EmbedProvider
Section titled “EmbedProvider”| Property | Type |
|---|---|
| name? | string | null |
| url? | string | null |
| Property | Type |
|---|---|
| id | string |
| name? | string | null |
| roles? | string[] | null |
| user? | User | null |
| require_colons? | boolean | null |
| managed? | boolean | null |
| animated? | boolean | null |
| available? | boolean | null |
EncourageHardwareAccelerationResponse
Section titled “EncourageHardwareAccelerationResponse”| Property | Type |
|---|---|
| enabled | boolean |
Entitlement
Section titled “Entitlement”| Property | Type |
|---|---|
| id | string |
| sku_id | string |
| application_id | string |
| user_id | string |
| gift_code_flags | number |
| type | string | number |
| gifter_user_id? | string | null |
| branches? | string[] | null |
| starts_at? | string | null |
| ends_at? | string | null |
| parent_id? | string | null |
| consumed? | boolean | null |
| deleted? | boolean | null |
| gift_code_batch_id? | string | null |
GetChannelPermissionsResponse
Section titled “GetChannelPermissionsResponse”| Property | Type |
|---|---|
| permissions | bigint | string |
GetChannelRequest
Section titled “GetChannelRequest”| Property | Type |
|---|---|
| channel_id | string |
GetChannelResponse
Section titled “GetChannelResponse”| Property | Type |
|---|---|
| id | string |
| type | ChannelTypesObject |
| guild_id? | string | null |
| name? | string | null |
| topic? | string | null |
| bitrate? | number | null |
| user_limit? | number | null |
| position? | number | null |
| voice_states | UserVoiceState[] |
| messages | Message[] |
GetEntitlementsResponse
Section titled “GetEntitlementsResponse”| Property | Type |
|---|---|
| entitlements | Entitlement[] |
GetInstanceConnectedParticipantsResponse
Section titled “GetInstanceConnectedParticipantsResponse”| Property | Type |
|---|---|
| participants | User[] |
GetPlatformBehaviorsResponse
Section titled “GetPlatformBehaviorsResponse”| Property | Type |
|---|---|
| iosKeyboardResizesView? | boolean |
GetRelationshipsResponse
Section titled “GetRelationshipsResponse”| Property | Type |
|---|---|
| relationships | Relationship[] |
GetSkusResponse
Section titled “GetSkusResponse”| Property | Type |
|---|---|
| skus | Sku[] |
GuildMember
Section titled “GuildMember”| Property | Type |
|---|---|
| user | User |
| nick? | string | null |
| roles | string[] |
| joined_at | string |
| deaf | boolean |
| mute | boolean |
GuildMemberRPC
Section titled “GuildMemberRPC”| Property | Type |
|---|---|
| user_id | string |
| nick? | string | null |
| guild_id | string |
| avatar? | string | null |
| avatar_decoration_data? | AvatarDecorationData | null |
| color_string? | string | null |
| Property | Type |
|---|---|
| url? | string | null |
| proxy_url? | string | null |
| height? | number | null |
| width? | number | null |
InitiateImageUploadResponse
Section titled “InitiateImageUploadResponse”| Property | Type |
|---|---|
| image_url | string |
Message
Section titled “Message”| Property | Type | |
|---|---|---|
| id | string | |
| channel_id | string | |
| guild_id? | string | null | |
| author? | User | null | |
| member? | GuildMember | null | |
| content | string | |
| timestamp | string | |
| edited_timestamp? | string | null | |
| tts | boolean | |
| mention_everyone | boolean | |
| mentions | User[] | |
| mention_roles | string[] | |
| mention_channels | ChannelMention[] | |
| attachments | Attachment[] | |
| embeds | Embed[] | |
| reactions? | Reaction[] | null | |
| nonce? | string | number | null |
| pinned | boolean | |
| webhook_id? | string | null | |
| type | number | |
| activity? | MessageActivity | null | |
| application? | MessageApplication | null | |
| message_reference? | MessageReference | null | |
| flags? | number | |
| stickers? | Sticker[] | null | |
| referenced_message? | Message | null |
MessageActivity
Section titled “MessageActivity”| Property | Type |
|---|---|
| type | number |
| party_id? | string | null |
MessageApplication
Section titled “MessageApplication”| Property | Type |
|---|---|
| id | string |
| cover_image? | string | null |
| description | string |
| icon? | string | null |
| name | string |
MessageReference
Section titled “MessageReference”| Property | Type |
|---|---|
| message_id? | string | null |
| channel_id? | string | null |
| guild_id? | string | null |
OpenExternalLinkRequest
Section titled “OpenExternalLinkRequest”| Property | Type |
|---|---|
| url | string |
OpenExternalLinkResponse
Section titled “OpenExternalLinkResponse”| Property | Type |
|---|---|
| opened | boolean | null |
OpenShareMomentDialogRequest
Section titled “OpenShareMomentDialogRequest”| Property | Type |
|---|---|
| mediaUrl | string |
| Property | Type |
|---|---|
| id? | string | null |
| size? | number[] | null |
Reaction
Section titled “Reaction”| Property | Type |
|---|---|
| count | number |
| me | boolean |
| emoji | Emoji |
Relationship
Section titled “Relationship”Secrets
Section titled “Secrets”| Property | Type |
|---|---|
| join? | string |
| match? | string |
SetActivityRequest
Section titled “SetActivityRequest”| Property | Type |
|---|---|
| activity | Activity |
SetConfigRequest
Section titled “SetConfigRequest”| Property | Type |
|---|---|
| use_interactive_pip | boolean |
SetConfigResponse
Section titled “SetConfigResponse”| Property | Type |
|---|---|
| use_interactive_pip | boolean |
SetOrientationLockStateRequest
Section titled “SetOrientationLockStateRequest”| Property | Type |
|---|---|
| lock_state | OrientationLockState |
| picture_in_picture_lock_state | OrientationLockState |
| grid_lock_state | OrientationLockState |
ShareLinkRequest
Section titled “ShareLinkRequest”| Property | Type |
|---|---|
| custom_id? | string |
| message | string |
ShareLinkResponse
Section titled “ShareLinkResponse”| Property | Type |
|---|---|
| success | boolean |
| Property | Type |
|---|---|
| id | string |
| name | string |
| type | SkuTypeObject |
| price | SkuPrice |
| application_id | string |
| flags | number |
| release_date | string | null |
SkuPrice
Section titled “SkuPrice”| Property | Type |
|---|---|
| amount | number |
| currency | string |
StartPurchaseRequest
Section titled “StartPurchaseRequest”| Property | Type |
|---|---|
| sku_id | string |
StartPurchaseResponse
Section titled “StartPurchaseResponse”| Value |
|---|
| Entitlement[] | null |
Timestamp
Section titled “Timestamp”| Property | Type |
|---|---|
| start? | number |
| end? | number |
| Property | Type |
|---|---|
| id | string |
| username | string |
| discriminator | string |
| global_name? | string | null |
| avatar? | string | null |
| avatar_decoration_data | AvatarDecorationData | null |
| bot | boolean |
| flags? | number | null |
| premium_type? | number | null |
UserSettingsGetLocaleResponse
Section titled “UserSettingsGetLocaleResponse”| Property | Type |
|---|---|
| locale | string |
UserVoiceState
Section titled “UserVoiceState”| Property | Type |
|---|---|
| mute | boolean |
| nick | string |
| user | User |
| voice_state | VoiceState |
| volume | number |
| Property | Type |
|---|---|
| url? | string | null |
| height? | number | null |
| width? | number | null |
VoiceState
Section titled “VoiceState”| Property | Type |
|---|---|
| mute | boolean |
| deaf | boolean |
| self_mute | boolean |
| self_deaf | boolean |
| suppress | boolean |
SDK Enums
Section titled “SDK Enums”ChannelTypesObject
Section titled “ChannelTypesObject”| Name | Value |
|---|---|
| UNHANDLED | -1 |
| DM | 1 |
| GROUP_DM | 3 |
| GUILD_TEXT | 0 |
| GUILD_VOICE | 2 |
| GUILD_CATEGORY | 4 |
| GUILD_ANNOUNCEMENT | 5 |
| GUILD_STORE | 6 |
| ANNOUNCEMENT_THREAD | 10 |
| PUBLIC_THREAD | 11 |
| PRIVATE_THREAD | 12 |
| GUILD_STAGE_VOICE | 13 |
| GUILD_DIRECTORY | 14 |
| GUILD_FORUM | 15 |
ConsoleLevel
Section titled “ConsoleLevel”| Value |
|---|
| 'error' |
| 'log' |
| 'warn' |
| 'debug' |
| 'info' |
OrientationLockStateTypeObject
Section titled “OrientationLockStateTypeObject”| Name | Value |
|---|---|
| UNHANDLED | -1 |
| UNLOCKED | 1 |
| PORTRAIT | 2 |
| LANDSCAPE | 3 |
ThermalStateTypeObject
Section titled “ThermalStateTypeObject”| Name | Value |
|---|---|
| UNHANDLED | -1 |
| NOMINAL | 0 |
| FAIR | 1 |
| SERIOUS | 2 |
| CRITICAL | 3 |
OrientationTypeObject
Section titled “OrientationTypeObject”| Name | Value |
|---|---|
| UNHANDLED | -1 |
| PORTRAIT | 0 |
| LANDSCAPE | 1 |
LayoutModeTypeObject
Section titled “LayoutModeTypeObject”| Name | Value |
|---|---|
| UNHANDLED | -1 |
| FOCUSED | 0 |
| PIP | 1 |
| GRID | 2 |
OAuthScopes
Section titled “OAuthScopes”| Value |
|---|
| 'bot' |
| 'rpc' |
| 'identify' |
| 'connections' |
| 'email' |
| 'guilds' |
| 'guilds.join' |
| 'guilds.members.read' |
| 'gdm.join' |
| 'messages.read' |
| 'rpc.notifications.read' |
| 'rpc.voice.write' |
| 'rpc.voice.read' |
| 'rpc.activities.write' |
| 'webhook.incoming' |
| 'applications.commands' |
| 'applications.builds.upload' |
| 'applications.builds.read' |
| 'applications.store.update' |
| 'applications.entitlements' |
| 'relationships.read' |
| 'activities.read' |
| 'activities.write' |
| 'dm_channels.read' |
RPCCloseCodes
Section titled “RPCCloseCodes”| Name | Code |
|---|---|
| CLOSE_NORMAL | 1000 |
| CLOSE_UNSUPPORTED | 1003 |
| CLOSE_ABNORMAL | 1006 |
| INVALID_CLIENTID | 4000 |
| INVALID_ORIGIN | 4001 |
| RATELIMITED | 4002 |
| TOKEN_REVOKED | 4003 |
| INVALID_VERSION | 4004 |
| INVALID_ENCODING | 4005 |
SkuTypeObject
Section titled “SkuTypeObject”| Name | Value |
|---|---|
| UNHANDLED | -1 |
| APPLICATION | 1 |
| DLC | 2 |
| CONSUMABLE | 3 |
| BUNDLE | 4 |
| SUBSCRIPTION | 5 |
Relationship Types
Section titled “Relationship Types”| Value | Name | Description |
|---|---|---|
| 0 | None | The user has no relationship with the other user. |
| 1 | Friend | The user is friends with the other user. |
| 2 | Blocked | The current user has blocked the target user. |
| 3 | Pending Incoming | The current user has received a friend request from the target user, but it is not yet accepted. |
| 4 | Pending Outgoing | The current user has sent a friend request to the target user, but it is not yet accepted. |
| 5 | Implicit | The Implicit type is documented for visibility, but should be unused in the SDK. |
| 6 | Suggestion | The Suggestion type is documented for visibility, but should be unused in the SDK. |