diff --git a/docs/components/reference.mdx b/docs/components/reference.mdx index 10a76b7169..13631b39f4 100644 --- a/docs/components/reference.mdx +++ b/docs/components/reference.mdx @@ -122,28 +122,28 @@ Action Rows can contain one of the following: ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 1, // ComponentType.ACTION_ROW "components": [ { "type": 2, // ComponentType.BUTTON - "custom_id": "click_yes" + "custom_id": "click_yes", "label": "Accept", - "style": 1, + "style": 1 // ButtonStyle.PRIMARY }, { "type": 2, // ComponentType.BUTTON "label": "Learn More", - "style": 5, + "style": 5, // ButtonStyle.LINK "url": "http://watchanimeattheoffice.com/" }, { "type": 2, // ComponentType.BUTTON - "custom_id": "click_no" + "custom_id": "click_no", "label": "Decline", - "style": 4, + "style": 4 // ButtonStyle.DANGER } ] } @@ -199,7 +199,7 @@ Buttons come in various styles to convey different types of actions. These style ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 1, // ComponentType.ACTION_ROW @@ -208,7 +208,7 @@ Buttons come in various styles to convey different types of actions. These style "type": 2, // ComponentType.BUTTON, "custom_id": "click_me", "label": "Click me!", - "style": 1 + "style": 1 // ButtonStyle.PRIMARY } ] } @@ -327,7 +327,7 @@ String Selects are available in messages and modals. They must be placed inside ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 1, // ComponentType.ACTION_ROW, @@ -531,7 +531,7 @@ The `label` field on a Text Input is deprecated in favor of `label` and `descrip "component": { "type": 4, // ComponentType.TEXT_INPUT "custom_id": "game_feedback", - "style": 2, + "style": 2, // TextInputStyle.PARAGRAPH "min_length": 100, "max_length": 4000, "placeholder": "Write your feedback here...", @@ -630,7 +630,7 @@ User Selects are available in messages and modals. They must be placed inside an ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 1, // ComponentType.ACTION_ROW @@ -717,7 +717,7 @@ User Selects are available in messages and modals. They must be placed inside an ```json { - "type": 9, + "type": 9, // InteractionCallbackType.MODAL "data": { "custom_id": "user_modal", "title": "User Chooser", @@ -755,13 +755,13 @@ User Selects are available in messages and modals. They must be placed inside an "component": { "custom_id": "user_selected", "id": 2, - "type": 5, + "type": 5, // ComponentType.USER_SELECT "values": [ "11111111111111111" ] }, "id": 1, - "type": 18 + "type": 18 // ComponentType.LABEL } ], "resolved": { @@ -868,7 +868,7 @@ Role Selects are available in messages and modals. They must be placed inside an ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 1, // ComponentType.ACTION_ROW @@ -940,16 +940,16 @@ Role Selects are available in messages and modals. They must be placed inside an ```json { - "type": 9, + "type": 9, // InteractionCallbackType.MODAL "data": { "custom_id": "role_modal", "title": "Role Select", "components": [ { - "type": 18, + "type": 18, // ComponentType.LABEL "label": "Select which roles to assign", "component": { - "type": 6, + "type": 6, // ComponentType.ROLE_SELECT "custom_id": "roles_selected", "max_values": 10, "required": true @@ -978,14 +978,14 @@ Role Selects are available in messages and modals. They must be placed inside an "component": { "custom_id": "roles_selected", "id": 2, - "type": 6, + "type": 6, // ComponentType.ROLE_SELECT "values": [ "1362213912946147499", "1357409927680889032" ] }, "id": 1, - "type": 18 + "type": 18 // ComponentType.LABEL } ], "resolved": { @@ -1085,7 +1085,7 @@ Mentionable Selects are available in messages and modals. They must be placed in ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 1, // ComponentType.ACTION_ROW @@ -1194,16 +1194,16 @@ Mentionable Selects are available in messages and modals. They must be placed in ```json { - "type": 9, + "type": 9, // InteractionCallbackType.MODAL "data": { "custom_id": "mentionable_modal", "title": "Unmentionables", "components": [ { - "type": 18, + "type": 18, // ComponentType.LABEL "label": "Who gets mentioned?", "component": { - "type": 7, + "type": 7, // ComponentType.MENTIONABLE_SELECT "custom_id": "mentionables_selected", "required": true } @@ -1231,13 +1231,13 @@ Mentionable Selects are available in messages and modals. They must be placed in "component": { "custom_id": "mentionables_selected", "id": 2, - "type": 7, + "type": 7, // ComponentType.MENTIONABLE_SELECT "values": [ "1361539726405926952" ] }, "id": 1, - "type": 18 + "type": 18 // ComponentType.LABEL } ], "resolved": { @@ -1319,7 +1319,7 @@ Channel Selects are available in messages and modals. They must be placed inside ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 1, // ComponentType.ACTION_ROW @@ -1385,16 +1385,16 @@ Channel Selects are available in messages and modals. They must be placed inside ```json { - "type": 9, + "type": 9, // InteractionCallbackType.MODAL "data": { "custom_id": "channel_modal", "title": "Lockdown", "components": [ { - "type": 18, + "type": 18, // ComponentType.LABEL "label": "Which channel should be locked?", "component": { - "type": 8, + "type": 8, // ComponentType.CHANNEL_SELECT "custom_id": "channel_selected", "required": true } @@ -1422,13 +1422,13 @@ Channel Selects are available in messages and modals. They must be placed inside "component": { "custom_id": "channel_selected", "id": 2, - "type": 8, + "type": 8, // ComponentType.CHANNEL_SELECT "values": [ "1357483683627663450" ] }, "id": 1, - "type": 18 + "type": 18 // ComponentType.LABEL } ], "resolved": { @@ -1445,7 +1445,7 @@ Channel Selects are available in messages and modals. They must be placed inside "position": 1, "rate_limit_per_user": 0, "topic": null, - "type": 0 + "type": 0 // ChannelType.TEXT } } } @@ -1503,7 +1503,7 @@ Don't hardcode `components` to contain only text components. We may add other co ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 9, // ComponentType.SECTION @@ -1571,7 +1571,7 @@ To use this component in messages you must send the [message flag](/docs/resourc ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 10, // ComponentType.TEXT_DISPLAY @@ -1590,29 +1590,29 @@ To use this component in messages you must send the [message flag](/docs/resourc ```json { - "type": 9, + "type": 9, // InteractionCallbackType.MODAL "data": { "custom_id": "jail_modal", "title": "Jail", "components": [ { - "type": 10, + "type": 10, // ComponentType.TEXT_DISPLAY "content": "This action will move the selected user to the selected voice channel and take away all their permissions **for 1 hour**." }, { - "type": 18, + "type": 18, // ComponentType.LABEL "label": "Choose a user", "component": { - "type": 5, + "type": 5, // ComponentType.USER_SELECT "custom_id": "user_selected", "required": true } }, { - "type": 18, + "type": 18, // ComponentType.LABEL "label": "Where should they be sent?", "component": { - "type": 8, + "type": 8, // ComponentType.CHANNEL_SELECT "custom_id": "channel_selected", "channel_types": [ 2 @@ -1661,7 +1661,7 @@ To use this component, you need to send the [message flag](/docs/resources/messa ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 9, // ComponentType.SECTION @@ -1729,7 +1729,7 @@ To use this component in messages you must send the [message flag](/docs/resourc ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 10, // ComponentType.TEXT_DISPLAY @@ -1799,7 +1799,7 @@ To use this component in messages you must send the [message flag](/docs/resourc ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 10, // ComponentType.TEXT_DISPLAY @@ -1855,7 +1855,7 @@ To use this component in messages you must send the [message flag](/docs/resourc ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 10, // ComponentType.TEXT_DISPLAY @@ -1918,7 +1918,7 @@ To use this component in messages you must send the [message flag](/docs/resourc ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { "type": 17, // ComponentType.CONTAINER @@ -1947,19 +1947,19 @@ To use this component in messages you must send the [message flag](/docs/resourc "type": 2, // ComponentType.BUTTON "custom_id": "pet_coyote", "label": "Pet it!", - "style": 1 + "style": 1 // ButtonStyle.PRIMARY }, { "type": 2, // ComponentType.BUTTON "custom_id": "feed_coyote", "label": "Attempt to feed it", - "style": 2 + "style": 2 // ButtonStyle.SECONDARY }, { "type": 2, // ComponentType.BUTTON "custom_id": "run_away", "label": "Run away!", - "style": 4 + "style": 4 // ButtonStyle.DANGER } ] } @@ -2043,7 +2043,7 @@ The `description` may display above or below the `component` depending on the pl "component": { "type": 4, // ComponentType.TEXT_INPUT "custom_id": "game_feedback", - "style": 2, + "style": 2, // TextInputStyle.PARAGRAPH "min_length": 100, "max_length": 4000, "placeholder": "Write your feedback here...", @@ -2093,7 +2093,7 @@ File Uploads are available on modals. They must be placed inside a [Label](/docs ```json { - "type": 9, + "type": 9, // InteractionCallbackType.MODAL "data": { "custom_id": "bug_submit_modal", "title": "Bug Submission", @@ -2132,13 +2132,13 @@ File Uploads are available on modals. They must be placed inside a [Label](/docs "component": { "custom_id": "file_upload", "id": 2, - "type": 19, + "type": 19, // ComponentType.FILE_UPLOAD "values": [ "111111111111111111111" ] }, "id": 1, - "type": 18 + "type": 18 // ComponentType.LABEL } ], "custom_id": "bug_submit_modal", @@ -2213,11 +2213,11 @@ Legacy Message Component Example "content": "This is a message with legacy components", "components": [ { - "type": 1, + "type": 1, // ComponentType.ACTION_ROW "components": [ { - "type": 2, - "style": 1, + "type": 2, // ComponentType.BUTTON + "style": 1, // ButtonStyle.PRIMARY "label": "Click Me", "custom_id": "click_me_1" } diff --git a/docs/components/using-message-components.mdx b/docs/components/using-message-components.mdx index a409559135..31d1766683 100644 --- a/docs/components/using-message-components.mdx +++ b/docs/components/using-message-components.mdx @@ -34,10 +34,10 @@ All content must be sent as components instead of using the standard message for ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { - "type": 10, + "type": 10, // ComponentType.TEXT_DISPLAY "content": "This is a message using the Text Display component" } ] @@ -50,14 +50,14 @@ To send a message with multiple components, you can include multiple component o ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { - "type": 10, + "type": 10, // ComponentType.TEXT_DISPLAY "content": "This is a Text Display component." }, { - "type": 10, + "type": 10, // ComponentType.TEXT_DISPLAY "content": "This is another Text Display component!" } ] @@ -72,24 +72,24 @@ For example, you can create a message with an Action Row component that contains ```json { - "flags": 32768, + "flags": 32768, // MessageFlags.IS_COMPONENTS_V2 "components": [ { - "type": 10, + "type": 10, // ComponentType.TEXT_DISPLAY "content": "This is a message with v2 components" }, { - "type": 1, + "type": 1, // ComponentType.ACTION_ROW "components": [ { - "type": 2, - "style": 1, + "type": 2, // ComponentType.BUTTON + "style": 1, // ButtonStyle.PRIMARY "label": "Click Me", "custom_id": "click_me_1" }, { - "type": 2, - "style": 2, + "type": 2, // ComponentType.BUTTON + "style": 2, // ButtonStyle.SECONDARY "label": "Click Me Too", "custom_id": "click_me_2" } diff --git a/docs/components/using-modal-components.mdx b/docs/components/using-modal-components.mdx index 2f6aae3a7f..e853c3d08e 100644 --- a/docs/components/using-modal-components.mdx +++ b/docs/components/using-modal-components.mdx @@ -23,16 +23,16 @@ An example of a modal with a [String Select](/docs/components/reference#string-s ```json { - "type": 9, + "type": 9, // InteractionCallbackType.MODAL "data": { "custom_id": "bug_modal", "title": "Bug Report", "components": [ { - "type": 18, + "type": 18, // ComponentType.LABEL "label": "What's your favorite bug?", "component": { - "type": 3, + "type": 3, // ComponentType.STRING_SELECT "custom_id": "bug_string_select", "placeholder": "Choose...", "options": [ @@ -62,13 +62,13 @@ An example of a modal with a [String Select](/docs/components/reference#string-s } }, { - "type": 18, + "type": 18, // ComponentType.LABEL "label": "Why is it your favorite?", "description": "Please provide as much detail as possible!", "component": { - "type": 4, + "type": 4, // ComponentType.TEXT_INPUT "custom_id": "bug_explanation", - "style": 2, + "style": 2, // TextInputStyle.PARAGRAPH "min_length": 1000, "max_length": 4000, "placeholder": "Write your explanation here...", diff --git a/docs/developer-tools/embedded-app-sdk.mdx b/docs/developer-tools/embedded-app-sdk.mdx index 2798ef9cd8..08d8419cd5 100644 --- a/docs/developer-tools/embedded-app-sdk.mdx +++ b/docs/developer-tools/embedded-app-sdk.mdx @@ -1006,7 +1006,7 @@ Received when the current user object changes. }, "bot": false, "flags": 1, - "premium_type": 2 + "premium_type": 2 // PremiumType.Nitro } ``` @@ -1081,7 +1081,7 @@ No scopes required }, "bot": false, "flags": 1, - "premium_type": 2 + "premium_type": 2 // PremiumType.Nitro } ] } @@ -1117,7 +1117,7 @@ Requires Discord approval }, "bot": false, "flags": 1, - "premium_type": 2 + "premium_type": 2 // PremiumType.Nitro } } ``` diff --git a/docs/events/gateway-events.mdx b/docs/events/gateway-events.mdx index 406873837e..6c95d47551 100644 --- a/docs/events/gateway-events.mdx +++ b/docs/events/gateway-events.mdx @@ -113,7 +113,7 @@ These fields originally were $ prefixed (i.e: `$browser`) but [this syntax is de "presence": { "activities": [{ "name": "Cards Against Humanity", - "type": 0 + "type": 0 // ActivityType.GAME }], "status": "dnd", "since": 91879201, @@ -292,7 +292,7 @@ Sent by the client to indicate a presence or status update. "since": 91879201, "activities": [{ "name": "Save the Oxford Comma", - "type": 0 + "type": 0 // ActivityType.GAME }], "status": "online", "afk": false @@ -1278,7 +1278,7 @@ When received over the gateway, the `buttons` field is an array of strings, whic "details": "24H RL Stream for Charity", "state": "Rocket League", "name": "Twitch", - "type": 1, + "type": 1, // ActivityType.STREAMING "url": "https://www.twitch.tv/discord" } ``` @@ -1288,7 +1288,7 @@ When received over the gateway, the `buttons` field is an array of strings, whic ```json { "name": "Rocket League", - "type": 0, + "type": 0, // ActivityType.GAME "application_id": "379286085710381999", "state": "In a Match", "details": "Ranked Duos: 2-1", diff --git a/docs/events/webhook-events.mdx b/docs/events/webhook-events.mdx index 0c046210be..e405992dca 100644 --- a/docs/events/webhook-events.mdx +++ b/docs/events/webhook-events.mdx @@ -167,12 +167,12 @@ The "Value" column corresponds to the event's `type` field value in the [event b { "version": 1, "application_id": "1234560123453231555", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "APPLICATION_AUTHORIZED", "timestamp": "2024-10-18T14:42:53.064834", "data": { - "integration_type": 1, + "integration_type": 1, // InstallationContext.USER "scopes": [ "applications.commands" ], @@ -200,7 +200,7 @@ The "Value" column corresponds to the event's `type` field value in the [event b { "version": 1, "application_id": "1234560123453231555", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "APPLICATION_DEAUTHORIZED", "timestamp": "2024-10-18T14:42:53.064834", @@ -227,7 +227,7 @@ The inner payload is an [entitlement](/docs/resources/entitlement#entitlement-ob { "version": 1, "application_id": "1234560123453231555", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "ENTITLEMENT_CREATE", "timestamp": "2024-10-18T18:41:21.109604", @@ -239,7 +239,7 @@ The inner payload is an [entitlement](/docs/resources/entitlement#entitlement-ob "id": "1234505980407808808", "promotion_id": null, "sku_id": "123489045643835123", - "type": 4, + "type": 4, // EntitlementType.GIFT "user_id": "111178765189277770" } } @@ -260,7 +260,7 @@ The inner payload is an [entitlement](/docs/resources/entitlement#entitlement-ob { "version": 1, "application_id": "1234560123453231555", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "ENTITLEMENT_UPDATE", "timestamp": "2024-10-18T18:41:21.109604", @@ -272,7 +272,7 @@ The inner payload is an [entitlement](/docs/resources/entitlement#entitlement-ob "id": "1234505980407808808", "promotion_id": null, "sku_id": "123489045643835123", - "type": 4, + "type": 4, // EntitlementType.GIFT "user_id": "111178765189277770" } } @@ -293,7 +293,7 @@ The inner payload is an [entitlement](/docs/resources/entitlement#entitlement-ob { "version": 1, "application_id": "1234560123453231555", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "ENTITLEMENT_DELETE", "timestamp": "2024-10-18T18:41:21.109604", @@ -305,7 +305,7 @@ The inner payload is an [entitlement](/docs/resources/entitlement#entitlement-ob "id": "1234505980407808808", "promotion_id": null, "sku_id": "123489045643835123", - "type": 4, + "type": 4, // EntitlementType.GIFT "user_id": "111178765189277770" } } @@ -334,13 +334,13 @@ The inner payload is a [lobby message object](/docs/events/webhook-events#lobby- { "version": 1, "application_id": "1234567765431056709", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "LOBBY_MESSAGE_CREATE", "timestamp": "2024-10-18T18:41:21.109604", "data": { "id": "1397729799727878254", - "type": 0, + "type": 0, // MessageType.DEFAULT "content": "welcome to the party!", "lobby_id": "1397729744753266719", "channel_id": "1397729744753266719", @@ -368,13 +368,13 @@ The inner payload is a [lobby message object](/docs/events/webhook-events#lobby- { "version": 1, "application_id": "1234567765431056709", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "LOBBY_MESSAGE_UPDATE", "timestamp": "2025-08-05T20:39:19.587872", "data": { "id": "1402390388030832792", - "type": 0, + "type": 0, // MessageType.DEFAULT "content": "noice", "lobby_id": "1402385687281537066", "channel_id": "1402389638311841883", @@ -406,7 +406,7 @@ The inner payload is a [lobby message object](/docs/events/webhook-events#lobby- { "version": 1, "application_id": "1234567765431056709", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "LOBBY_MESSAGE_DELETE", "timestamp": "2025-08-05T21:44:09.412957", @@ -432,13 +432,13 @@ The inner payload is a [message object](/docs/events/webhook-events#message-obje { "version": 1, "application_id": "1234567765431056709", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "GAME_DIRECT_MESSAGE_CREATE", "timestamp": "2025-08-14T18:09:38.063234", "data": { "id": "1405614357781545021", - "type": 0, + "type": 0, // MessageType.DEFAULT "content": "get in friend, we're going raiding", "channel_id": "1405604229820715098", "author": { @@ -466,7 +466,7 @@ The inner payload is a [message object](/docs/events/webhook-events#message-obje { "version": 1, "application_id": "1234567765431056709", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "GAME_DIRECT_MESSAGE_UPDATE", "timestamp": "2025-08-14T16:44:31.847073", @@ -497,13 +497,13 @@ The inner payload is a [message object](/docs/events/webhook-events#message-obje { "version": 1, "application_id": "1234567765431056709", - "type": 1, + "type": 1, // WebhookType.EVENT "event": { "type": "GAME_DIRECT_MESSAGE_DELETE", "timestamp": "2025-08-20T17:01:50.099204", "data": { "id": "1407771600643686503", - "type": 0, + "type": 0, // MessageType.DEFAULT "content": "cant make it in time", "channel_id": "1405604229820715098", "author": { diff --git a/docs/interactions/application-commands.mdx b/docs/interactions/application-commands.mdx index e5cd526878..ff481d4117 100644 --- a/docs/interactions/application-commands.mdx +++ b/docs/interactions/application-commands.mdx @@ -178,13 +178,13 @@ url = "https://discord.com/api/v10/applications//commands" # This is an example CHAT_INPUT or Slash Command, with a type of 1 json = { "name": "blep", - "type": 1, + "type": 1, # InteractionType.CHAT_INPUT "description": "Send a random adorable animal photo", "options": [ { "name": "animal", "description": "The type of animal", - "type": 3, + "type": 3, # InteractionOptionType.STRING "required": True, "choices": [ { @@ -204,7 +204,7 @@ json = { { "name": "only_smol", "description": "Whether to show only baby animals", - "type": 5, + "type": 5, # InteractionOptionType.BOOLEAN "required": False } ] @@ -238,7 +238,7 @@ url = "https://discord.com/api/v10/applications//guilds/ diff --git a/docs/interactions/receiving-and-responding.mdx b/docs/interactions/receiving-and-responding.mdx index 9a8d29dae7..cdea86228a 100644 --- a/docs/interactions/receiving-and-responding.mdx +++ b/docs/interactions/receiving-and-responding.mdx @@ -316,7 +316,7 @@ import requests url = "https://discord.com/api/v10/interactions///callback" json = { - "type": 4, + "type": 4, # InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE "data": { "content": "Congrats on sending your command!" } @@ -336,12 +336,12 @@ Interaction `tokens` are valid for **15 minutes** and can be used to send follow def my_command(): if request.json["type"] == 1: return jsonify({ - "type": 1 + "type": 1 # InteractionResponseType.PONG }) else: return jsonify({ - "type": 4, + "type": 4, # InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE "data": { "tts": False, "content": "Congrats on sending your command!", diff --git a/docs/monetization/managing-skus.mdx b/docs/monetization/managing-skus.mdx index d42d9bceea..3ff17aa891 100644 --- a/docs/monetization/managing-skus.mdx +++ b/docs/monetization/managing-skus.mdx @@ -221,10 +221,10 @@ return new JsonResponse({ data: { content: "This command requires Nelly Premium! Upgrade now to get access to these features!", components: [{ - type: MessageComponentTypes.ACTION_ROW, + type: 1, // MessageComponentTypes.ACTION_ROW components: [ { - type: MessageComponentTypes.BUTTON, + type: 2, // MessageComponentTypes.BUTTON style: 6, // ButtonStyleTypes.PREMIUM sku_id: '1234965026943668316', }, diff --git a/docs/resources/auto-moderation.mdx b/docs/resources/auto-moderation.mdx index 40141afdb2..4d5b6905a5 100644 --- a/docs/resources/auto-moderation.mdx +++ b/docs/resources/auto-moderation.mdx @@ -30,19 +30,19 @@ Rules can be configured to automatically execute actions whenever they trigger. "guild_id": "613425648685547541", "name": "Keyword Filter 1", "creator_id": "423457898095789043", - "trigger_type": 1, - "event_type": 1, + "trigger_type": 1, // TriggerType.KEYWORD + "event_type": 1, // EventType.MESSAGE_SEND "actions": [ { - "type": 1, + "type": 1, // ActionType.BLOCK_MESSAGE "metadata": { "custom_message": "Please keep financial discussions limited to the #finance channel" } }, { - "type": 2, + "type": 2, // ActionType.SEND_ALERT_MESSAGE "metadata": { "channel_id": "123456789123456789" } }, { - "type": 3, + "type": 3, // ActionType.TIMEOUT "metadata": { "duration_seconds": 60 } } ], diff --git a/docs/resources/channel.mdx b/docs/resources/channel.mdx index 8f5d9149b7..7a449d719e 100644 --- a/docs/resources/channel.mdx +++ b/docs/resources/channel.mdx @@ -113,7 +113,7 @@ Type 10, 11 and 12 are only available in API v9 and above. "id": "41771983423143937", "guild_id": "41771983423143937", "name": "general", - "type": 0, + "type": 0, // ChannelType.GUILD_TEXT "position": 6, "permission_overwrites": [], "rate_limit_per_user": 2, @@ -134,7 +134,7 @@ Bots can post or publish messages in this type of channel if they have the prope "id": "41771983423143937", "guild_id": "41771983423143937", "name": "important-news", - "type": 5, + "type": 5, // ChannelType.GUILD_ANNOUNCEMENT "position": 6, "permission_overwrites": [], "nsfw": true, @@ -151,7 +151,7 @@ Bots can post or publish messages in this type of channel if they have the prope { "id": "155101607195836416", "last_message_id": "174629835082649376", - "type": 2, + "type": 2, // ChannelType.GUILD_VOICE "name": "ROCKET CHEESE", "position": 5, "parent_id": null, @@ -170,7 +170,7 @@ Bots can post or publish messages in this type of channel if they have the prope ```json { "last_message_id": "3343820033257021450", - "type": 1, + "type": 1, // ChannelType.DM "id": "319674150115610528", "recipients": [ { @@ -204,7 +204,7 @@ Bots can post or publish messages in this type of channel if they have the prope } ], "last_message_id": "3343820033257021450", - "type": 3, + "type": 3, // ChannelType.GROUP_DM "id": "319674150115710528", "owner_id": "82198810841029460" } @@ -220,7 +220,7 @@ Bots can post or publish messages in this type of channel if they have the prope "nsfw": false, "position": 0, "guild_id": "290926798629997250", - "type": 4, + "type": 4, // ChannelType.GUILD_CATEGORY "id": "399942396007890945" } ``` @@ -244,7 +244,7 @@ The [threads](/docs/topics/threads) topic has some more information. "parent_id": "41771983423143937", "owner_id": "41771983423143937", "name": "don't buy dota-2", - "type": 11, + "type": 11, // ChannelType.PUBLIC_THREAD "last_message_id": "155117677105512449", "message_count": 1, "member_count": 5, diff --git a/docs/resources/entitlement.mdx b/docs/resources/entitlement.mdx index fffd4e62d4..8794aab334 100644 --- a/docs/resources/entitlement.mdx +++ b/docs/resources/entitlement.mdx @@ -34,7 +34,7 @@ Refer to the [Monetization Overview](/docs/monetization/overview) for more infor "application_id": "1019370614521200640", "user_id": "771129655544643584", "promotion_id": null, - "type": 8, + "type": 8, // EntitlementType.APPLICATION_SUBSCRIPTION "deleted": false, "gift_code_flags": 0, "consumed": false, @@ -84,7 +84,7 @@ Returns all entitlements for a given app, active and expired. "application_id": "1019370614521200640", "user_id": "771129655544643584", "promotion_id": null, - "type": 8, + "type": 8, // EntitlementType.APPLICATION_SUBSCRIPTION "deleted": false, "gift_code_flags": 0, "consumed": false, @@ -108,7 +108,7 @@ Returns an entitlement. "application_id": "1019370614521200640", "user_id": "771129655544643584", "promotion_id": null, - "type": 8, + "type": 8, // EntitlementType.APPLICATION_SUBSCRIPTION "deleted": false, "gift_code_flags": 0, "consumed": false, @@ -147,7 +147,7 @@ After creating a test entitlement, you'll need to reload your Discord client. Af { "sku_id": "999184799365857331", "owner_id": "847184799365857999", - "owner_type": 1 + "owner_type": 1 // EntitlementOwnerType.GUILD } ``` diff --git a/docs/resources/guild-template.mdx b/docs/resources/guild-template.mdx index 063b218bdd..c195448d77 100644 --- a/docs/resources/guild-template.mdx +++ b/docs/resources/guild-template.mdx @@ -74,7 +74,7 @@ Represents a code that when used, creates a guild based on a snapshot of an exis "parent_id": null, "permission_overwrites": [], "id": 1, - "type": 4 + "type": 4 // ChannelType.GUILD_CATEGORY }, { "name": "general", @@ -87,7 +87,7 @@ Represents a code that when used, creates a guild based on a snapshot of an exis "parent_id": 1, "permission_overwrites": [], "id": 2, - "type": 0 + "type": 0 // ChannelType.GUILD_TEXT } ], "afk_channel_id": null, diff --git a/docs/resources/guild.mdx b/docs/resources/guild.mdx index 724de226d3..778766a2c7 100644 --- a/docs/resources/guild.mdx +++ b/docs/resources/guild.mdx @@ -657,7 +657,7 @@ Defines the criteria used to satisfy Onboarding constraints that are required fo "single_select": false, "required": false, "in_onboarding": true, - "type": 0 + "type": 0 // GuildOnboardingPromptType.MULTIPLE_CHOICE } ], "default_channel_ids": [ diff --git a/docs/resources/invite.mdx b/docs/resources/invite.mdx index 27fa74edd6..de982a0493 100644 --- a/docs/resources/invite.mdx +++ b/docs/resources/invite.mdx @@ -52,7 +52,7 @@ Represents a code that when used, adds a user to a guild or group DM channel. ```json { - "type": 0, + "type": 0, // InviteType.GUILD "code": "0vCdhLbwjZZTWZLD", "guild": { "id": "165176875973476352", @@ -70,7 +70,7 @@ Represents a code that when used, adds a user to a guild or group DM channel. "channel": { "id": "165176875973476352", "name": "illuminati", - "type": 0 + "type": 0 // ChannelType.GUILD_TEXT }, "inviter": { "id": "115590097100865541", @@ -79,7 +79,7 @@ Represents a code that when used, adds a user to a guild or group DM channel. "discriminator": "7653", "public_flags": 131328 }, - "target_type": 1, + "target_type": 1, // InviteTargetType.STREAM "target_user": { "id": "165176875973476352", "username": "bob", diff --git a/docs/resources/message.mdx b/docs/resources/message.mdx index 88887810d4..4e058e8d91 100644 --- a/docs/resources/message.mdx +++ b/docs/resources/message.mdx @@ -189,7 +189,7 @@ Type `19` and `20` are only available in API v8 and above. In v6, they are repre "content": "Supa Hot", "channel_id": "290926798999357250", "mentions": [], - "type": 0 + "type": 0 // MessageType.DEFAULT } ``` @@ -233,16 +233,16 @@ Type `19` and `20` are only available in API v8 and above. In v6, they are repre "id": "278325129692446722", "guild_id": "278325129692446720", "name": "big-news", - "type": 5 + "type": 5 // ChannelType.GUILD_ANNOUNCEMENT } ], "content": "Big news! In this <#278325129692446722> channel!", "channel_id": "290926798999357250", "mentions": [], - "type": 0, - "flags": 2, + "type": 0, // MessageType.DEFAULT + "flags": 2, // MessageFlags.IS_CROSSPOST "message_reference": { - "type": 0, + "type": 0, // MessageReferenceType.CROSSPOST "channel_id": "278325129692446722", "guild_id": "278325129692446720", "message_id": "306588351130107906" diff --git a/docs/resources/sku.mdx b/docs/resources/sku.mdx index d7f7ad96e1..f847ac1df7 100644 --- a/docs/resources/sku.mdx +++ b/docs/resources/sku.mdx @@ -24,11 +24,11 @@ SKUs (stock-keeping units) in Discord represent premium offerings that can be ma ```json { "id": "1088510058284990888", - "type": 5, + "type": 5, // SKUType.SUBSCRIPTION "dependent_sku_id": null, "application_id": "788708323867885999", "manifest_labels": null, - "access_type": 1, + "access_type": 1, // SKUAccessType.PUBLIC "name": "Test Premium", "features": [], "release_date": null, @@ -78,11 +78,11 @@ Because of how our SKU and subscription systems work, you will see two SKUs for [ { "id": "1088510053843210999", - "type": 6, + "type": 6, // SKUType.SUBSCRIPTION_GROUP "dependent_sku_id": null, "application_id": "788708323867885999", "manifest_labels": null, - "access_type": 1, + "access_type": 1, // SKUAccessType.PUBLIC "name": "Test Premium", "features": [], "release_date": null, @@ -93,17 +93,17 @@ Because of how our SKU and subscription systems work, you will see two SKUs for }, { "id": "1088510058284990888", - "type": 5, + "type": 5, // SKUType.SUBSCRIPTION "dependent_sku_id": null, "application_id": "788708323867885999", "manifest_labels": null, - "access_type": 1, + "access_type": 1, // SKUAccessType.PUBLIC "name": "Test Premium", "features": [], "release_date": null, "premium": false, "slug": "test-premium", - "flags": 128, + "flags": 128, // SKUFlag.USER_SUBSCRIPTION | SKUFlag.GUILD_SUBSCRIPTION "show_age_gate": false } ] diff --git a/docs/resources/sticker.mdx b/docs/resources/sticker.mdx index ac0fa4bfac..7fa60b5c34 100644 --- a/docs/resources/sticker.mdx +++ b/docs/resources/sticker.mdx @@ -50,8 +50,8 @@ Incidentally the client will always use a name generated from an emoji as the va "id": "749054660769218631", "name": "Wave", "tags": "wumpus, hello, sup, hi, oi, heyo, heya, yo, greetings, greet, welcome, wave, :wave, :hello, :hi, :hey, hey, \ud83d\udc4b, \ud83d\udc4b\ud83c\udffb, \ud83d\udc4b\ud83c\udffc, \ud83d\udc4b\ud83c\udffd, \ud83d\udc4b\ud83c\udffe, \ud83d\udc4b\ud83c\udfff, goodbye, bye, see ya, later, laterz, cya", - "type": 1, - "format_type": 3, + "type": 1, // StickerType.STANDARD + "format_type": 3, // StickerFormatType.LOTTIE "description": "Wumpus waves hello", "pack_id": "847199849233514549", "sort_value": 12 diff --git a/docs/resources/user.mdx b/docs/resources/user.mdx index 0036189b68..5370d13f53 100644 --- a/docs/resources/user.mdx +++ b/docs/resources/user.mdx @@ -64,7 +64,7 @@ There are other rules and restrictions not shared here for the sake of spam and "flags": 64, "banner": "06c16474723fe537c283b8efa61a30c8", "accent_color": 16711680, - "premium_type": 1, + "premium_type": 1, // PremiumType.NITRO_CLASSIC "public_flags": 64, "avatar_decoration_data": { "sku_id": "1144058844004233369", diff --git a/docs/resources/webhook.mdx b/docs/resources/webhook.mdx index dbd6cc5dde..4b0506c747 100644 --- a/docs/resources/webhook.mdx +++ b/docs/resources/webhook.mdx @@ -48,7 +48,7 @@ These types don't include [webhook events](/docs/events/webhook-events), which a ```json { "name": "test webhook", - "type": 1, + "type": 1, // WebhookType.INCOMING "channel_id": "199737254929760256", "token": "3d89bb7572e0fb30d8128367b3b1b44fecd1726de135cbe28a41f8b2f777c372ba2939e72279b94526ff5d1bd4358d65cf11", "avatar": null, @@ -69,7 +69,7 @@ These types don't include [webhook events](/docs/events/webhook-events), which a ```json { - "type": 2, + "type": 2, // WebhookType.CHANNEL_FOLLOWER "id": "752831914402115456", "name": "Guildy name", "avatar": "bb71f469c158984e265093a81b3397fb", @@ -99,7 +99,7 @@ These types don't include [webhook events](/docs/events/webhook-events), which a ```json { - "type": 3, + "type": 3, // WebhookType.APPLICATION "id": "658822586720976555", "name": "Clyde", "avatar": "689161dc90ac261d00f1608694ac6bfd", diff --git a/docs/topics/oauth2.mdx b/docs/topics/oauth2.mdx index 33713ebad3..4445c2cbc5 100644 --- a/docs/topics/oauth2.mdx +++ b/docs/topics/oauth2.mdx @@ -403,7 +403,7 @@ When the user navigates to this URL, they will be prompted to select a channel i "url": "https://discord.com/api/webhooks/347114750880120863/kKDdjXa1g9tKNs0-_yOwLyALC9gydEWP6gr9sHabuK1vuofjhQDDnlOclJeRIvYK-pj_", "channel_id": "345626669224982402", "token": "kKDdjXa1g9tKNs0-_yOwLyALC9gydEWP6gr9sHabuK1vuofjhQDDnlOclJeRIvYK-pj_", - "type": 1, + "type": 1, // WebhookType.INCOMING "avatar": null, "guild_id": "290926792226357250", "id": "347114750880120863" diff --git a/docs/topics/rpc.md b/docs/topics/rpc.md index bd9f3cb4ae..afc4a7b3c6 100644 --- a/docs/topics/rpc.md +++ b/docs/topics/rpc.md @@ -385,7 +385,7 @@ Used to get a channel the client is in. "data": { "id": "199737254929760257", "name": "General", - "type": 2, + "type": 2, // ChannelType.GUILD_VOICE "bitrate": 64000, "user_limit": 0, "guild_id": "199737254929760256", @@ -458,12 +458,12 @@ Used to get a guild's channels the client is in. { "id": "199737254929760256", "name": "general", - "type": 0 + "type": 0 // ChannelType.GUILD_TEXT }, { "id": "199737254929760257", "name": "General", - "type": 2 + "type": 2 // ChannelType.GUILD_VOICE } ] }, @@ -568,7 +568,7 @@ When trying to join the user to a voice channel, you will receive a `5003` error "data": { "id": "199737254929760257", "name": "General", - "type": 2, + "type": 2, // ChannelType.GUILD_VOICE "bitrate": 64000, "user_limit": 0, "guild_id": "199737254929760256", @@ -1219,7 +1219,7 @@ No arguments "data": { "id": "199737254929760257", "name": "General", - "type": 0 + "type": 0 // ChannelType.GUILD_TEXT }, "evt": "CHANNEL_CREATE" } @@ -1429,7 +1429,7 @@ Dispatches message objects, with the exception of deletions, which only contains "mention_everyone": false, "embeds": [], "attachments": [], - "type": 0, + "type": 0, // MessageType.DEFAULT "pinned": false, "author": { "id": "190320984123768832", @@ -1510,7 +1510,7 @@ No arguments. This event requires the `rpc.notifications.read` [OAuth2 scope](/d "mention_everyone": false, "embeds": [], "attachments": [], - "type": 0, + "type": 0, // MessageType.DEFAULT "pinned": false, "author": { "id": "190320984123768832", diff --git a/docs/tutorials/developing-a-user-installable-app.mdx b/docs/tutorials/developing-a-user-installable-app.mdx index 6b2ead5806..eadbada95e 100644 --- a/docs/tutorials/developing-a-user-installable-app.mdx +++ b/docs/tutorials/developing-a-user-installable-app.mdx @@ -253,7 +253,7 @@ The payload below is condensed to be more readable, but your interaction request "id": "1234968734674853908", "locale": "en-US", "token": "a really long interactions token that your app can use to respond to the interactions", - "type": 2, + "type": 2, // InteractionType.APPLICATION_COMMAND "user": { // Partial user object }, diff --git a/docs/tutorials/upgrading-to-application-commands.md b/docs/tutorials/upgrading-to-application-commands.md index b3744a2bd2..6a0f7c14fc 100644 --- a/docs/tutorials/upgrading-to-application-commands.md +++ b/docs/tutorials/upgrading-to-application-commands.md @@ -85,14 +85,14 @@ Below is a sample payload to create a global slash command with an optional para ```json { "name": "rock", - "type": 1, + "type": 1, // ApplicationCommandType.CHAT_INPUT "description": "Sends a picture of a rock", "options": [ { "name": "type", "description": "Type of rock", - "type": 3, - "required": True, + "type": 3, // ApplicationCommandOptionType.STRING + "required": true, "choices": [ { "name": "Igneous", @@ -180,7 +180,7 @@ Below is an example payload your app would receive when a user invoked a global ```json { - "type": 2, + "type": 2, // InteractionType.APPLICATION_COMMAND "token": "A_UNIQUE_TOKEN", "member": { "user": {