dfx 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DiscordREST/types.js +6 -0
- package/DiscordREST/types.js.map +1 -0
- package/DiscordWS/index.js +2 -0
- package/DiscordWS/index.js.map +1 -0
- package/README.md +3 -0
- package/WS/index.js +71 -0
- package/WS/index.js.map +1 -0
- package/discord-api-docs/index.js +1 -0
- package/mod.js.map +1 -0
- package/package.json +6 -1
- package/types.js +1563 -0
- package/types.js.map +1 -0
- package/websocket.js +11 -0
- package/websocket.js.map +1 -0
- package/.gitmodules +0 -3
- package/.prettierrc.json +0 -4
- package/discord-api-docs/.eslintrc.json +0 -10
- package/discord-api-docs/.gitattributes +0 -11
- package/discord-api-docs/.github/ISSUE_TEMPLATE/api-bug-report.yml +0 -49
- package/discord-api-docs/.github/ISSUE_TEMPLATE/config.yml +0 -20
- package/discord-api-docs/.github/ISSUE_TEMPLATE/developer-site-bug-report.yml +0 -49
- package/discord-api-docs/.github/ISSUE_TEMPLATE/message-components-bug-report.yml +0 -49
- package/discord-api-docs/.github/ISSUE_TEMPLATE/slash-command-bug-report.yml +0 -49
- package/discord-api-docs/.github/workflows/test.yaml +0 -45
- package/discord-api-docs/.prettierignore +0 -1
- package/discord-api-docs/.prettierrc.json +0 -15
- package/discord-api-docs/CODE_OF_CONDUCT.md +0 -75
- package/discord-api-docs/CONTRIBUTING.md +0 -16
- package/discord-api-docs/README.md +0 -35
- package/discord-api-docs/docs/Change_Log.md +0 -474
- package/discord-api-docs/docs/Intro.md +0 -48
- package/discord-api-docs/docs/Legal.md +0 -154
- package/discord-api-docs/docs/Policy.md +0 -81
- package/discord-api-docs/docs/Reference.md +0 -476
- package/discord-api-docs/docs/Store_Distribution_Agreement.md +0 -179
- package/discord-api-docs/docs/dispatch/Branches_and_Builds.md +0 -654
- package/discord-api-docs/docs/dispatch/Dispatch_and_You.md +0 -17
- package/discord-api-docs/docs/dispatch/Error_Codes.md +0 -26
- package/discord-api-docs/docs/dispatch/Field_Values.md +0 -48
- package/discord-api-docs/docs/dispatch/List_of_Commands.md +0 -315
- package/discord-api-docs/docs/game_and_server_management/Alpha_and_Beta_Testing.md +0 -52
- package/discord-api-docs/docs/game_and_server_management/How_to_Get_Your_Game_on_Discord.md +0 -110
- package/discord-api-docs/docs/game_and_server_management/Special_Channels.md +0 -38
- package/discord-api-docs/docs/game_sdk/Achievements.md +0 -405
- package/discord-api-docs/docs/game_sdk/Activities.md +0 -561
- package/discord-api-docs/docs/game_sdk/Applications.md +0 -237
- package/discord-api-docs/docs/game_sdk/Discord.md +0 -443
- package/discord-api-docs/docs/game_sdk/Discord_Voice.md +0 -289
- package/discord-api-docs/docs/game_sdk/Images.md +0 -196
- package/discord-api-docs/docs/game_sdk/Lobbies.md +0 -1639
- package/discord-api-docs/docs/game_sdk/Networking.md +0 -377
- package/discord-api-docs/docs/game_sdk/Overlay.md +0 -195
- package/discord-api-docs/docs/game_sdk/Relationships.md +0 -234
- package/discord-api-docs/docs/game_sdk/SDK_Starter_Guide.md +0 -310
- package/discord-api-docs/docs/game_sdk/Storage.md +0 -312
- package/discord-api-docs/docs/game_sdk/Store.md +0 -555
- package/discord-api-docs/docs/game_sdk/Users.md +0 -178
- package/discord-api-docs/docs/interactions/Application_Commands.md +0 -1069
- package/discord-api-docs/docs/interactions/Message_Components.md +0 -454
- package/discord-api-docs/docs/interactions/Receiving_and_Responding.md +0 -372
- package/discord-api-docs/docs/interactions/Slash_Commands.md +0 -3
- package/discord-api-docs/docs/resources/Application.md +0 -82
- package/discord-api-docs/docs/resources/Audit_Log.md +0 -223
- package/discord-api-docs/docs/resources/Channel.md +0 -1267
- package/discord-api-docs/docs/resources/Emoji.md +0 -122
- package/discord-api-docs/docs/resources/Guild.md +0 -1157
- package/discord-api-docs/docs/resources/Guild_Scheduled_Event.md +0 -273
- package/discord-api-docs/docs/resources/Guild_Template.md +0 -148
- package/discord-api-docs/docs/resources/Invite.md +0 -150
- package/discord-api-docs/docs/resources/Stage_Instance.md +0 -106
- package/discord-api-docs/docs/resources/Sticker.md +0 -164
- package/discord-api-docs/docs/resources/User.md +0 -205
- package/discord-api-docs/docs/resources/Voice.md +0 -55
- package/discord-api-docs/docs/resources/Webhook.md +0 -281
- package/discord-api-docs/docs/rich_presence/Best_Practices.md +0 -88
- package/discord-api-docs/docs/rich_presence/FAQ.md +0 -45
- package/discord-api-docs/docs/rich_presence/How_To.md +0 -302
- package/discord-api-docs/docs/rich_presence/Launch_Checklist.md +0 -46
- package/discord-api-docs/docs/topics/Certified_Devices.md +0 -200
- package/discord-api-docs/docs/topics/Community_Resources.md +0 -98
- package/discord-api-docs/docs/topics/Gateway.md +0 -1600
- package/discord-api-docs/docs/topics/OAuth2.md +0 -427
- package/discord-api-docs/docs/topics/Opcodes_and_Status_Codes.md +0 -306
- package/discord-api-docs/docs/topics/Permissions.md +0 -229
- package/discord-api-docs/docs/topics/RPC.md +0 -1597
- package/discord-api-docs/docs/topics/Rate_Limits.md +0 -126
- package/discord-api-docs/docs/topics/Teams.md +0 -80
- package/discord-api-docs/docs/topics/Threads.md +0 -163
- package/discord-api-docs/docs/topics/Voice_Connections.md +0 -282
- package/discord-api-docs/images/API_center.gif +0 -0
- package/discord-api-docs/images/ask-to-join.gif +0 -0
- package/discord-api-docs/images/available-published.png +0 -0
- package/discord-api-docs/images/button-styles.png +0 -0
- package/discord-api-docs/images/certified-device.png +0 -0
- package/discord-api-docs/images/command-with-groups-subcommands-parameters.png +0 -0
- package/discord-api-docs/images/command-with-groups-subcommands.png +0 -0
- package/discord-api-docs/images/command.png +0 -0
- package/discord-api-docs/images/cpp-files-sdk.png +0 -0
- package/discord-api-docs/images/create-store-channel.png +0 -0
- package/discord-api-docs/images/deferred-example.png +0 -0
- package/discord-api-docs/images/desktop-select.png +0 -0
- package/discord-api-docs/images/game-overlay-sdk-invite.gif +0 -0
- package/discord-api-docs/images/game-overlay-sdk-voice-settings.png +0 -0
- package/discord-api-docs/images/game-overlay-sdk-voice-widget.png +0 -0
- package/discord-api-docs/images/gift-code-creation.png +0 -0
- package/discord-api-docs/images/lib-linked-sdk.png +0 -0
- package/discord-api-docs/images/message-command.png +0 -0
- package/discord-api-docs/images/mobile-select.png +0 -0
- package/discord-api-docs/images/previous-new-server-background.png +0 -0
- package/discord-api-docs/images/rp-actionable.png +0 -0
- package/discord-api-docs/images/rp-all-fields.png +0 -0
- package/discord-api-docs/images/rp-bad-art.png +0 -0
- package/discord-api-docs/images/rp-good-art.png +0 -0
- package/discord-api-docs/images/rp-legend.png +0 -0
- package/discord-api-docs/images/rp-long-strings.png +0 -0
- package/discord-api-docs/images/rp-non-actionable.png +0 -0
- package/discord-api-docs/images/rp-not-all-fields.png +0 -0
- package/discord-api-docs/images/rp-profile-example-1.png +0 -0
- package/discord-api-docs/images/rp-profile-example-2.png +0 -0
- package/discord-api-docs/images/rp-short-strings.png +0 -0
- package/discord-api-docs/images/server-banner-example.png +0 -0
- package/discord-api-docs/images/server-banner-margin-top.png +0 -0
- package/discord-api-docs/images/sku-management.png +0 -0
- package/discord-api-docs/images/snowflake.png +0 -0
- package/discord-api-docs/images/snowflake_original_size.png +0 -0
- package/discord-api-docs/images/spectate.gif +0 -0
- package/discord-api-docs/images/team-2fa.png +0 -0
- package/discord-api-docs/images/team-make-app.png +0 -0
- package/discord-api-docs/images/team-page.png +0 -0
- package/discord-api-docs/images/transfer-app-to-team.png +0 -0
- package/discord-api-docs/images/user-command.png +0 -0
- package/discord-api-docs/package-lock.json +0 -3186
- package/discord-api-docs/package.json +0 -38
- package/discord-api-docs/tsconfig.eslint.json +0 -4
- package/discord-api-docs/tsconfig.json +0 -19
- package/tsconfig.json +0 -24
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
# Webhook Resource
|
|
2
|
-
|
|
3
|
-
Webhooks are a low-effort way to post messages to channels in Discord. They do not require a bot user or authentication to use.
|
|
4
|
-
|
|
5
|
-
### Webhook Object
|
|
6
|
-
|
|
7
|
-
Used to represent a webhook.
|
|
8
|
-
|
|
9
|
-
###### Webhook Structure
|
|
10
|
-
|
|
11
|
-
| Field | Type | Description |
|
|
12
|
-
| --------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
13
|
-
| id | snowflake | the id of the webhook |
|
|
14
|
-
| type | integer | the [type](#DOCS_RESOURCES_WEBHOOK/webhook-object-webhook-types) of the webhook |
|
|
15
|
-
| guild_id? | ?snowflake | the guild id this webhook is for, if any |
|
|
16
|
-
| channel_id | ?snowflake | the channel id this webhook is for, if any |
|
|
17
|
-
| user? | [user](#DOCS_RESOURCES_USER/user-object) object | the user this webhook was created by (not returned when getting a webhook with its token) |
|
|
18
|
-
| name | ?string | the default name of the webhook |
|
|
19
|
-
| avatar | ?string | the default user avatar [hash](#DOCS_REFERENCE/image-formatting) of the webhook |
|
|
20
|
-
| token? | string | the secure token of the webhook (returned for Incoming Webhooks) |
|
|
21
|
-
| application_id | ?snowflake | the bot/OAuth2 application that created this webhook |
|
|
22
|
-
| source_guild? | partial [guild](#DOCS_RESOURCES_GUILD/guild-object) object | the guild of the channel that this webhook is following (returned for Channel Follower Webhooks) |
|
|
23
|
-
| source_channel? | partial [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object | the channel that this webhook is following (returned for Channel Follower Webhooks) |
|
|
24
|
-
| url? | string | the url used for executing the webhook (returned by the [webhooks](#DOCS_TOPICS_OAUTH2/webhooks) OAuth2 flow) |
|
|
25
|
-
|
|
26
|
-
###### Webhook Types
|
|
27
|
-
|
|
28
|
-
| Value | Name | Description |
|
|
29
|
-
| ----- | ---------------- | -------------------------------------------------------------------------------------------------------------- |
|
|
30
|
-
| 1 | Incoming | Incoming Webhooks can post messages to channels with a generated token |
|
|
31
|
-
| 2 | Channel Follower | Channel Follower Webhooks are internal webhooks used with Channel Following to post new messages into channels |
|
|
32
|
-
| 3 | Application | Application webhooks are webhooks used with Interactions |
|
|
33
|
-
|
|
34
|
-
###### Example Incoming Webhook
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"name": "test webhook",
|
|
39
|
-
"type": 1,
|
|
40
|
-
"channel_id": "199737254929760256",
|
|
41
|
-
"token": "3d89bb7572e0fb30d8128367b3b1b44fecd1726de135cbe28a41f8b2f777c372ba2939e72279b94526ff5d1bd4358d65cf11",
|
|
42
|
-
"avatar": null,
|
|
43
|
-
"guild_id": "199737254929760256",
|
|
44
|
-
"id": "223704706495545344",
|
|
45
|
-
"application_id": null,
|
|
46
|
-
"user": {
|
|
47
|
-
"username": "test",
|
|
48
|
-
"discriminator": "7479",
|
|
49
|
-
"id": "190320984123768832",
|
|
50
|
-
"avatar": "b004ec1740a63ca06ae2e14c5cee11f3",
|
|
51
|
-
"public_flags": 131328
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
###### Example Channel Follower Webhook
|
|
57
|
-
|
|
58
|
-
```json
|
|
59
|
-
{
|
|
60
|
-
"type": 2,
|
|
61
|
-
"id": "752831914402115456",
|
|
62
|
-
"name": "Guildy name",
|
|
63
|
-
"avatar": "bb71f469c158984e265093a81b3397fb",
|
|
64
|
-
"channel_id": "561885260615255432",
|
|
65
|
-
"guild_id": "56188498421443265",
|
|
66
|
-
"application_id": null,
|
|
67
|
-
"source_guild": {
|
|
68
|
-
"id": "56188498421476534",
|
|
69
|
-
"name": "Guildy name",
|
|
70
|
-
"icon": "bb71f469c158984e265093a81b3397fb"
|
|
71
|
-
},
|
|
72
|
-
"source_channel": {
|
|
73
|
-
"id": "5618852344134324",
|
|
74
|
-
"name": "announcements"
|
|
75
|
-
},
|
|
76
|
-
"user": {
|
|
77
|
-
"username": "test",
|
|
78
|
-
"discriminator": "7479",
|
|
79
|
-
"id": "190320984123768832",
|
|
80
|
-
"avatar": "b004ec1740a63ca06ae2e14c5cee11f3",
|
|
81
|
-
"public_flags": 131328
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
###### Example Application Webhook
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"type": 3,
|
|
91
|
-
"id": "658822586720976555",
|
|
92
|
-
"name": "Clyde",
|
|
93
|
-
"avatar": "689161dc90ac261d00f1608694ac6bfd",
|
|
94
|
-
"channel_id": null,
|
|
95
|
-
"guild_id": null,
|
|
96
|
-
"application_id": "658822586720976555"
|
|
97
|
-
}
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Create Webhook % POST /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/webhooks
|
|
101
|
-
|
|
102
|
-
Creates a new webhook and returns a [webhook](#DOCS_RESOURCES_WEBHOOK/webhook-object) object on success. Requires the `MANAGE_WEBHOOKS` permission.
|
|
103
|
-
|
|
104
|
-
An error will be returned if a webhook name (`name`) is not valid. A webhook name is valid if:
|
|
105
|
-
- It does not contain the substring '**clyde**' (case-insensitive)
|
|
106
|
-
- It follows the nickname guidelines in the [Usernames and Nicknames](#DOCS_RESOURCES_USER/usernames-and-nicknames) documentation, with an exception that webhook names can be up to 80 characters
|
|
107
|
-
|
|
108
|
-
> info
|
|
109
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
110
|
-
|
|
111
|
-
###### JSON Params
|
|
112
|
-
|
|
113
|
-
| Field | Type | Description |
|
|
114
|
-
| ------- | ----------------------------------------- | ------------------------------------- |
|
|
115
|
-
| name | string | name of the webhook (1-80 characters) |
|
|
116
|
-
| avatar? | ?[image data](#DOCS_REFERENCE/image-data) | image for the default webhook avatar |
|
|
117
|
-
|
|
118
|
-
## Get Channel Webhooks % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/webhooks
|
|
119
|
-
|
|
120
|
-
Returns a list of channel [webhook](#DOCS_RESOURCES_WEBHOOK/webhook-object) objects. Requires the `MANAGE_WEBHOOKS` permission.
|
|
121
|
-
|
|
122
|
-
## Get Guild Webhooks % GET /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/webhooks
|
|
123
|
-
|
|
124
|
-
Returns a list of guild [webhook](#DOCS_RESOURCES_WEBHOOK/webhook-object) objects. Requires the `MANAGE_WEBHOOKS` permission.
|
|
125
|
-
|
|
126
|
-
## Get Webhook % GET /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}
|
|
127
|
-
|
|
128
|
-
Returns the new [webhook](#DOCS_RESOURCES_WEBHOOK/webhook-object) object for the given id.
|
|
129
|
-
|
|
130
|
-
## Get Webhook with Token % GET /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}
|
|
131
|
-
|
|
132
|
-
Same as above, except this call does not require authentication and returns no user in the webhook object.
|
|
133
|
-
|
|
134
|
-
## Modify Webhook % PATCH /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}
|
|
135
|
-
|
|
136
|
-
Modify a webhook. Requires the `MANAGE_WEBHOOKS` permission. Returns the updated [webhook](#DOCS_RESOURCES_WEBHOOK/webhook-object) object on success.
|
|
137
|
-
|
|
138
|
-
> info
|
|
139
|
-
> All parameters to this endpoint are optional
|
|
140
|
-
|
|
141
|
-
> info
|
|
142
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
143
|
-
|
|
144
|
-
###### JSON Params
|
|
145
|
-
|
|
146
|
-
| Field | Type | Description |
|
|
147
|
-
| ---------- | ----------------------------------------- | -------------------------------------------------- |
|
|
148
|
-
| name | string | the default name of the webhook |
|
|
149
|
-
| avatar | ?[image data](#DOCS_REFERENCE/image-data) | image for the default webhook avatar |
|
|
150
|
-
| channel_id | snowflake | the new channel id this webhook should be moved to |
|
|
151
|
-
|
|
152
|
-
## Modify Webhook with Token % PATCH /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}
|
|
153
|
-
|
|
154
|
-
Same as above, except this call does not require authentication, does not accept a `channel_id` parameter in the body, and does not return a user in the webhook object.
|
|
155
|
-
|
|
156
|
-
## Delete Webhook % DELETE /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}
|
|
157
|
-
|
|
158
|
-
Delete a webhook permanently. Requires the `MANAGE_WEBHOOKS` permission. Returns a `204 No Content` response on success.
|
|
159
|
-
|
|
160
|
-
> info
|
|
161
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
162
|
-
|
|
163
|
-
## Delete Webhook with Token % DELETE /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}
|
|
164
|
-
|
|
165
|
-
Same as above, except this call does not require authentication.
|
|
166
|
-
|
|
167
|
-
## Execute Webhook % POST /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}
|
|
168
|
-
|
|
169
|
-
Refer to [Uploading Files](#DOCS_REFERENCE/uploading-files) for details on attachments and `multipart/form-data` requests. Returns a message or `204 No Content` depending on the `wait` query parameter.
|
|
170
|
-
|
|
171
|
-
> info
|
|
172
|
-
> Note that when sending a message, you must provide a value for at **least one of** `content`, `embeds`, or `file`.
|
|
173
|
-
|
|
174
|
-
###### Query String Params
|
|
175
|
-
|
|
176
|
-
| Field | Type | Description | Required |
|
|
177
|
-
| ----- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
|
|
178
|
-
| wait | boolean | waits for server confirmation of message send before response, and returns the created message body (defaults to `false`; when `false` a message that is not saved does not return an error) | false |
|
|
179
|
-
| thread_id | snowflake | Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived. | false |
|
|
180
|
-
|
|
181
|
-
###### JSON/Form Params
|
|
182
|
-
|
|
183
|
-
| Field | Type | Description | Required |
|
|
184
|
-
| ---------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
|
|
185
|
-
| content | string | the message contents (up to 2000 characters) | one of content, file, embeds |
|
|
186
|
-
| username | string | override the default username of the webhook | false |
|
|
187
|
-
| avatar_url | string | override the default avatar of the webhook | false |
|
|
188
|
-
| tts | boolean | true if this is a TTS message | false |
|
|
189
|
-
| embeds | array of up to 10 [embed](#DOCS_RESOURCES_CHANNEL/embed-object) objects | embedded `rich` content | one of content, file, embeds |
|
|
190
|
-
| allowed_mentions | [allowed mention object](#DOCS_RESOURCES_CHANNEL/allowed-mentions-object) | allowed mentions for the message | false |
|
|
191
|
-
| components \* | array of [message component](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object) | the components to include with the message | false |
|
|
192
|
-
| files[n] \*\* | file contents | the contents of the file being sent | one of content, file, embeds |
|
|
193
|
-
| payload_json \*\*| string | JSON encoded body of non-file params | `multipart/form-data` only |
|
|
194
|
-
| attachments \*\* | array of partial [attachment](#DOCS_RESOURCES_CHANNEL/attachment-object) objects | attachment objects with filename and description | false |
|
|
195
|
-
| flags | integer | [message flags](#DOCS_RESOURCES_CHANNEL/message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) (only `SUPPRESS_EMBEDS` can be set) | false |
|
|
196
|
-
|
|
197
|
-
\* Requires an application-owned webhook.
|
|
198
|
-
|
|
199
|
-
\*\* See [Uploading Files](#DOCS_REFERENCE/uploading-files) for details.
|
|
200
|
-
|
|
201
|
-
> info
|
|
202
|
-
> For the webhook embed objects, you can set every field except `type` (it will be `rich` regardless of if you try to set it), `provider`, `video`, and any `height`, `width`, or `proxy_url` values for images.
|
|
203
|
-
|
|
204
|
-
## Execute Slack-Compatible Webhook % POST /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}/slack
|
|
205
|
-
|
|
206
|
-
Refer to [Slack's documentation](https://api.slack.com/incoming-webhooks) for more information. We do not support Slack's `channel`, `icon_emoji`, `mrkdwn`, or `mrkdwn_in` properties.
|
|
207
|
-
|
|
208
|
-
###### Query String Params
|
|
209
|
-
|
|
210
|
-
| Field | Type | Description | Required |
|
|
211
|
-
| --------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
|
|
212
|
-
| thread_id | snowflake | id of the thread to send the message in | false |
|
|
213
|
-
| wait | boolean | waits for server confirmation of message send before response (defaults to `true`; when `false` a message that is not saved does not return an error) | false |
|
|
214
|
-
|
|
215
|
-
## Execute GitHub-Compatible Webhook % POST /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}/github
|
|
216
|
-
|
|
217
|
-
Add a new webhook to your GitHub repo (in the repo's settings), and use this endpoint as the "Payload URL." You can choose what events your Discord channel receives by choosing the "Let me select individual events" option and selecting individual events for the new webhook you're configuring.
|
|
218
|
-
|
|
219
|
-
###### Query String Params
|
|
220
|
-
|
|
221
|
-
| Field | Type | Description | Required |
|
|
222
|
-
| --------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
|
|
223
|
-
| thread_id | snowflake | id of the thread to send the message in | false |
|
|
224
|
-
| wait | boolean | waits for server confirmation of message send before response (defaults to `true`; when `false` a message that is not saved does not return an error) | false |
|
|
225
|
-
|
|
226
|
-
## Get Webhook Message % GET /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}
|
|
227
|
-
|
|
228
|
-
Returns a previously-sent webhook message from the same token. Returns a [message](#DOCS_RESOURCES_CHANNEL/message-object) object on success.
|
|
229
|
-
|
|
230
|
-
###### Query String Params
|
|
231
|
-
|
|
232
|
-
| Field | Type | Description | Required |
|
|
233
|
-
| --------- | --------- | ---------------------------------- | -------- |
|
|
234
|
-
| thread_id | snowflake | id of the thread the message is in | false |
|
|
235
|
-
|
|
236
|
-
## Edit Webhook Message % PATCH /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}
|
|
237
|
-
|
|
238
|
-
Edits a previously-sent webhook message from the same token. Returns a [message](#DOCS_RESOURCES_CHANNEL/message-object) object on success.
|
|
239
|
-
|
|
240
|
-
When the `content` field is edited, the `mentions` array in the message object will be reconstructed from scratch based on the new content. The `allowed_mentions` field of the edit request controls how this happens. If there is no explicit `allowed_mentions` in the edit request, the content will be parsed with _default_ allowances, that is, without regard to whether or not an `allowed_mentions` was present in the request that originally created the message.
|
|
241
|
-
|
|
242
|
-
Refer to [Uploading Files](#DOCS_REFERENCE/uploading-files) for details on attachments and `multipart/form-data` requests.
|
|
243
|
-
Any provided files will be **appended** to the message. To remove or replace files you will have to supply the `attachments` field which specifies the files to retain on the message after edit.
|
|
244
|
-
|
|
245
|
-
> warn
|
|
246
|
-
> Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
|
247
|
-
|
|
248
|
-
> info
|
|
249
|
-
> All parameters to this endpoint are optional and nullable.
|
|
250
|
-
|
|
251
|
-
###### Query String Params
|
|
252
|
-
|
|
253
|
-
| Field | Type | Description | Required |
|
|
254
|
-
| --------- | --------- | ---------------------------------- | -------- |
|
|
255
|
-
| thread_id | snowflake | id of the thread the message is in | false |
|
|
256
|
-
|
|
257
|
-
###### JSON/Form Params
|
|
258
|
-
|
|
259
|
-
| Field | Type | Description |
|
|
260
|
-
| ---------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------- |
|
|
261
|
-
| content | string | the message contents (up to 2000 characters) |
|
|
262
|
-
| embeds | array of up to 10 [embed](#DOCS_RESOURCES_CHANNEL/embed-object) objects | embedded `rich` content |
|
|
263
|
-
| allowed_mentions | [allowed mention object](#DOCS_RESOURCES_CHANNEL/allowed-mentions-object) | allowed mentions for the message |
|
|
264
|
-
| components \* | array of [message component](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object) | the components to include with the message |
|
|
265
|
-
| files[n] \*\* | file contents | the contents of the file being sent/edited |
|
|
266
|
-
| payload_json \*\*| string | JSON encoded body of non-file params (multipart/form-data only) |
|
|
267
|
-
| attachments \*\* | array of partial [attachment](#DOCS_RESOURCES_CHANNEL/attachment-object) objects | attached files to keep and possible descriptions for new files |
|
|
268
|
-
|
|
269
|
-
\* Requires an application-owned webhook.
|
|
270
|
-
|
|
271
|
-
\*\* See [Uploading Files](#DOCS_REFERENCE/uploading-files) for details.
|
|
272
|
-
|
|
273
|
-
## Delete Webhook Message % DELETE /webhooks/{webhook.id#DOCS_RESOURCES_WEBHOOK/webhook-object}/{webhook.token#DOCS_RESOURCES_WEBHOOK/webhook-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}
|
|
274
|
-
|
|
275
|
-
Deletes a message that was created by the webhook. Returns a `204 No Content` response on success.
|
|
276
|
-
|
|
277
|
-
###### Query String Params
|
|
278
|
-
|
|
279
|
-
| Field | Type | Description | Required |
|
|
280
|
-
| --------- | --------- | ---------------------------------- | -------- |
|
|
281
|
-
| thread_id | snowflake | id of the thread the message is in | false |
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# Rich Presence Best Practices
|
|
2
|
-
|
|
3
|
-
> danger
|
|
4
|
-
> The SDK that this documentation references, [Discord-RPC](https://github.com/discord/discord-rpc), has been deprecated in favor of our new [Discord GameSDK](#DOCS_GAME_SDK_SDK_STARTER_GUIDE/). Replacement functionality for the Rich Presence SDK can be found in the [Activity Manager](#DOCS_GAME_SDK_ACTIVITIES/) of that SDK. This documentation can be referenced for education but does not entirely reflect the new SDK.
|
|
5
|
-
|
|
6
|
-
Rich Presence is a new feature from Discord that allows you to surface unique, interesting, and actionable data inside a Discord user’s profile when they play your game! This guide is intended to show some best practices on how to make that data the best it can be. It will include images and code samples; for full technical documentation, see our developer documentation.
|
|
7
|
-
|
|
8
|
-
If you take away one thing from this guide, let it be this:
|
|
9
|
-
|
|
10
|
-
> warn
|
|
11
|
-
> Rich Presence data should give others a clear understanding of what someone is doing so they can decide if they want to play together or not.
|
|
12
|
-
|
|
13
|
-
## Who should use Rich Presence?
|
|
14
|
-
|
|
15
|
-
Rich Presence is a powerful way to integrate your game with Discord. To do it most effectively, you should think about its purpose and how well (or not) it matches with your game and your implementation. Rich Presence is designed for these three things:
|
|
16
|
-
|
|
17
|
-
1. Show interesting, unique, actionable data in a user’s profile
|
|
18
|
-
2. Allow friends to spectate each other’s games
|
|
19
|
-
3. Join a friend’s in-game party or server directly from Discord
|
|
20
|
-
|
|
21
|
-
We certainly don’t want to stifle creativity, especially for games that can use Rich Presence in an interesting way. However, keep in mind that this sort of gameplay is what it was designed for, and how players will normally interact with it.
|
|
22
|
-
|
|
23
|
-
If you want to do something creative, wacky, funky, or otherwise out-there with Rich Presence for your players and aren’t sure if you can, feel free to drop us a line at [gamedevs@discord.com](mailto:gamedevs@discord.com). We’re always happy to help!
|
|
24
|
-
|
|
25
|
-
## How should you think about the data you show?
|
|
26
|
-
|
|
27
|
-
The data in your players’ profiles is the first thing that others on Discord will see about your game, both those familiar with it and those who have never played. It should answer two questions: can I play with my friend right now, and if not, when can I? Show data like:
|
|
28
|
-
|
|
29
|
-
- What the player is currently doing
|
|
30
|
-
- How much time has elapsed or remains (if applicable)
|
|
31
|
-
- Their party state
|
|
32
|
-
- Your cool artwork!
|
|
33
|
-
|
|
34
|
-
For a great real world example, check out [Holodrive](https://store.steampowered.com/app/370770/Holodrive/) for free on Steam!
|
|
35
|
-
|
|
36
|
-
## Tips
|
|
37
|
-
|
|
38
|
-
### Keep it Short
|
|
39
|
-
|
|
40
|
-
- `details` and `state` should be snippets of data, not sentences.
|
|
41
|
-
- Make sure your strings stay on one line—especially on the small profile!
|
|
42
|
-
|
|
43
|
-
###### Examples
|
|
44
|
-
|
|
45
|
-
| Bad | Good |
|
|
46
|
-
| :------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------: |
|
|
47
|
-
|  |  |
|
|
48
|
-
| The data wraps onto multiple lines. It’s repetitive, slower to read, and messy. | The data all fits on one line per string. Clean! |
|
|
49
|
-
|
|
50
|
-
### Make it Actionable!
|
|
51
|
-
|
|
52
|
-
- Always keep party size data up to date.
|
|
53
|
-
- Keep accurate track of party state: In Queue, In Game, In Menus, etc.
|
|
54
|
-
- Include game modes, ranked vs. unranked, etc. so others can clearly see.
|
|
55
|
-
|
|
56
|
-
###### Examples
|
|
57
|
-
|
|
58
|
-
| Bad | Good |
|
|
59
|
-
| :---------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
60
|
-
|  |  |
|
|
61
|
-
| While Rank 9999 is impressive, it doesn’t present any actionable data for their friends. | This player is in queue for something I want to play. Let's ask to join that open spot! |
|
|
62
|
-
|
|
63
|
-
### Use ALL of the fields (where applicable)!
|
|
64
|
-
|
|
65
|
-
- Make use of all the fields that are applicable to you.
|
|
66
|
-
- Save space by putting map and character names in the tooltips.
|
|
67
|
-
- Try not to repeat information.
|
|
68
|
-
|
|
69
|
-
###### Examples
|
|
70
|
-
|
|
71
|
-
| Bad | Good |
|
|
72
|
-
| :---------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------: |
|
|
73
|
-
|  |  |
|
|
74
|
-
| The map name takes up space and makes the player's status harder to read at a glance. | Moving the name of the map to the tooltip makes the data cleaner and frees up space for the score. |
|
|
75
|
-
|
|
76
|
-
### Have interesting, expressive art!
|
|
77
|
-
|
|
78
|
-
- The large image should be consistent for all players in a party.
|
|
79
|
-
- The small image is where you can customize on a per-player basis.
|
|
80
|
-
- Use high resolution artwork so your art looks great on fancy, high DPI screens.
|
|
81
|
-
- We strongly recommend image sizes of 1024x1024 pixels.
|
|
82
|
-
|
|
83
|
-
###### Examples
|
|
84
|
-
|
|
85
|
-
| Bad | Good |
|
|
86
|
-
| :-----------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------: |
|
|
87
|
-
|  |  |
|
|
88
|
-
| The image is dark and unfocused. Highly-detailed images can be hard to see. | This image is bright and matches the details. Let's help! |
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Rich Presence FAQ
|
|
2
|
-
|
|
3
|
-
> danger
|
|
4
|
-
> The SDK that this documentation references, [Discord-RPC](https://github.com/discord/discord-rpc), has been deprecated in favor of our new [Discord GameSDK](#DOCS_GAME_SDK_SDK_STARTER_GUIDE/). Replacement functionality for the Rich Presence SDK can be found in the [Activity Manager](#DOCS_GAME_SDK_ACTIVITIES/) of that SDK. This documentation can be referenced for education but does not entirely reflect the new SDK.
|
|
5
|
-
|
|
6
|
-
Below are answers to some common questions about integrating Rich Presence with your game. If you don't see your question answered here, feel free to reach out to [gamedevs@discord.com](mailto:gamedevs@discord.com) for more help.
|
|
7
|
-
|
|
8
|
-
#### Q: I see "Playing MyGame", but no Rich Presence data.
|
|
9
|
-
|
|
10
|
-
There's a couple things that could be going on:
|
|
11
|
-
|
|
12
|
-
- If you're running two instances of the Discord client, check both!
|
|
13
|
-
- Double check that your `Discord_Initialize()` function is correct.
|
|
14
|
-
|
|
15
|
-
Throughout development, make sure you have your `errored()` and `disconnected()` callbacks hooked up for debugging. You can open up the console in Discord and look for errors pertaining to `SET_ACTIVITY` for more information as well.
|
|
16
|
-
|
|
17
|
-
#### Q: I'm not seeing Spectate buttons on my profile.
|
|
18
|
-
|
|
19
|
-
Make sure you applied for approval! If you want the Spectate button on your players' profiles, we require your integration to go through an approval process. If you have applied and have been approved and still don't see the buttons, check your Discord console for errors.
|
|
20
|
-
|
|
21
|
-
#### Q: What happens if someone has more than one game running that supports Rich Presence?
|
|
22
|
-
|
|
23
|
-
Due to recent changes in our infrastructure for support of multi-activities, the behavior of multiple connected Rich Presence apps has changed from what it was before. Previously, whichever application was focused would be the presence that was shown. With the recent changes, the application that connected _first_ is now displayed.
|
|
24
|
-
|
|
25
|
-
However, invite functionality across multiple connected applications now works no matter which app is display on a user's profile. For example, if you are hosting a Spotify listening party, playing Game A that allows you to send Join invites, and playing Game B that allows you to send Spectate invites, you'll be able to send invites to all three simultaneously!
|
|
26
|
-
|
|
27
|
-
#### Q: What if someone looking at my profile or an invite doesn't own the game?
|
|
28
|
-
|
|
29
|
-
Anyone can see your profile data, whether they own the game or not. They'll only be able to interact with chat invites or profile buttons if they own the game and have launched it at least once. Otherwise, the invite/button tooltip will show "Game Not Detected".
|
|
30
|
-
|
|
31
|
-
#### Q: Do join invitations allow players to select the number of open slots?
|
|
32
|
-
|
|
33
|
-
Currently, the SDK does not support this. Party slot information is determined by the party data you sent in your presence payload.
|
|
34
|
-
|
|
35
|
-
#### Q: Can I send images via the payload rather than uploading them to my Developer Dashboard?
|
|
36
|
-
|
|
37
|
-
Yes! In addition to uploading an asset and specifying its name, you can also specify an external image URL for us to proxy. For more information, see [Activity Asset Image](#DOCS_TOPICS_GATEWAY/activity-object-activity-asset-image).
|
|
38
|
-
|
|
39
|
-
#### Q: Can I change something in the SDK for my own purposes?
|
|
40
|
-
|
|
41
|
-
Go nuts! The SDK is open source by design. If you need or want to change something for the purposes of your specific integration—like changing our JSON parser, or changing all of the variable names to the names of your pets—go ahead and tinker to your heart's content.
|
|
42
|
-
|
|
43
|
-
#### Q: OK—I've got it working! Now, how do I make my integration look _awesome_?
|
|
44
|
-
|
|
45
|
-
I'm happy ~~we preempted your question~~ you asked! Check out our [Rich Presence Best Practices](#DOCS_RICH_PRESENCE_BEST_PRACTICES/) guide for a rundown on how to make your integration the best that it can be!
|