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,1267 +0,0 @@
|
|
|
1
|
-
# Channels Resource
|
|
2
|
-
|
|
3
|
-
### Channel Object
|
|
4
|
-
|
|
5
|
-
Represents a guild or DM channel within Discord.
|
|
6
|
-
|
|
7
|
-
###### Channel Structure
|
|
8
|
-
|
|
9
|
-
| Field | Type | Description |
|
|
10
|
-
|--------------------------------|----------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
11
|
-
| id | snowflake | the id of this channel |
|
|
12
|
-
| type | integer | the [type of channel](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) |
|
|
13
|
-
| guild_id? | snowflake | the id of the guild (may be missing for some channel objects received over gateway guild dispatches) |
|
|
14
|
-
| position? | integer | sorting position of the channel |
|
|
15
|
-
| permission_overwrites? | array of [overwrite](#DOCS_RESOURCES_CHANNEL/overwrite-object) objects | explicit permission overwrites for members and roles |
|
|
16
|
-
| name? | string | the name of the channel (1-100 characters) |
|
|
17
|
-
| topic? | ?string | the channel topic (0-1024 characters) |
|
|
18
|
-
| nsfw? | boolean | whether the channel is nsfw |
|
|
19
|
-
| last_message_id? | ?snowflake | the id of the last message sent in this channel (may not point to an existing or valid message) |
|
|
20
|
-
| bitrate? | integer | the bitrate (in bits) of the voice channel |
|
|
21
|
-
| user_limit? | integer | the user limit of the voice channel |
|
|
22
|
-
| rate_limit_per_user?\* | integer | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission `manage_messages` or `manage_channel`, are unaffected |
|
|
23
|
-
| recipients? | array of [user](#DOCS_RESOURCES_USER/user-object) objects | the recipients of the DM |
|
|
24
|
-
| icon? | ?string | icon hash of the group DM |
|
|
25
|
-
| owner_id? | snowflake | id of the creator of the group DM or thread |
|
|
26
|
-
| application_id? | snowflake | application id of the group DM creator if it is bot-created |
|
|
27
|
-
| parent_id? | ?snowflake | for guild channels: id of the parent category for a channel (each parent category can contain up to 50 channels), for threads: id of the text channel this thread was created |
|
|
28
|
-
| last_pin_timestamp? | ?ISO8601 timestamp | when the last pinned message was pinned. This may be `null` in events such as `GUILD_CREATE` when a message is not pinned. |
|
|
29
|
-
| rtc_region? | ?string | [voice region](#DOCS_RESOURCES_VOICE/voice-region-object) id for the voice channel, automatic when set to null |
|
|
30
|
-
| video_quality_mode? | integer | the camera [video quality mode](#DOCS_RESOURCES_CHANNEL/channel-object-video-quality-modes) of the voice channel, 1 when not present |
|
|
31
|
-
| message_count? | integer | an approximate count of messages in a thread, stops counting at 50 |
|
|
32
|
-
| member_count? | integer | an approximate count of users in a thread, stops counting at 50 |
|
|
33
|
-
| thread_metadata? | a [thread metadata](#DOCS_RESOURCES_CHANNEL/thread-metadata-object) object | thread-specific fields not needed by other channels |
|
|
34
|
-
| member? | a [thread member](#DOCS_RESOURCES_CHANNEL/thread-member-object) object | thread member object for the current user, if they have joined the thread, only included on certain API endpoints |
|
|
35
|
-
| default_auto_archive_duration? | integer | default duration that the clients (not the API) will use for newly created threads, in minutes, to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 |
|
|
36
|
-
| permissions? | string | computed permissions for the invoking user in the channel, including overwrites, only included when part of the `resolved` data received on a slash command interaction |
|
|
37
|
-
|
|
38
|
-
\* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
|
39
|
-
|
|
40
|
-
###### Channel Types
|
|
41
|
-
|
|
42
|
-
> warn
|
|
43
|
-
> Type 10, 11 and 12 are only available in API v9.
|
|
44
|
-
|
|
45
|
-
| Type | ID | Description |
|
|
46
|
-
| ----------------------- | --- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
47
|
-
| GUILD_TEXT | 0 | a text channel within a server |
|
|
48
|
-
| DM | 1 | a direct message between users |
|
|
49
|
-
| GUILD_VOICE | 2 | a voice channel within a server |
|
|
50
|
-
| GROUP_DM | 3 | a direct message between multiple users |
|
|
51
|
-
| GUILD_CATEGORY | 4 | an [organizational category](https://support.discord.com/hc/en-us/articles/115001580171-Channel-Categories-101) that contains up to 50 channels |
|
|
52
|
-
| GUILD_NEWS | 5 | a channel that [users can follow and crosspost into their own server](https://support.discord.com/hc/en-us/articles/360032008192) |
|
|
53
|
-
| GUILD_STORE | 6 | a channel in which game developers can [sell their game on Discord](https://discord.com/developers/docs/game-and-server-management/special-channels) |
|
|
54
|
-
| GUILD_NEWS_THREAD | 10 | a temporary sub-channel within a GUILD_NEWS channel |
|
|
55
|
-
| GUILD_PUBLIC_THREAD | 11 | a temporary sub-channel within a GUILD_TEXT channel |
|
|
56
|
-
| GUILD_PRIVATE_THREAD | 12 | a temporary sub-channel within a GUILD_TEXT channel that is only viewable by those invited and those with the MANAGE_THREADS permission |
|
|
57
|
-
| GUILD_STAGE_VOICE | 13 | a voice channel for [hosting events with an audience](https://support.discord.com/hc/en-us/articles/1500005513722) |
|
|
58
|
-
|
|
59
|
-
###### Video Quality Modes
|
|
60
|
-
|
|
61
|
-
| Mode | Value | Description |
|
|
62
|
-
| ---- | ----- | --------------------------------------------------- |
|
|
63
|
-
| AUTO | 1 | Discord chooses the quality for optimal performance |
|
|
64
|
-
| FULL | 2 | 720p |
|
|
65
|
-
|
|
66
|
-
###### Example Guild Text Channel
|
|
67
|
-
|
|
68
|
-
```json
|
|
69
|
-
{
|
|
70
|
-
"id": "41771983423143937",
|
|
71
|
-
"guild_id": "41771983423143937",
|
|
72
|
-
"name": "general",
|
|
73
|
-
"type": 0,
|
|
74
|
-
"position": 6,
|
|
75
|
-
"permission_overwrites": [],
|
|
76
|
-
"rate_limit_per_user": 2,
|
|
77
|
-
"nsfw": true,
|
|
78
|
-
"topic": "24/7 chat about how to gank Mike #2",
|
|
79
|
-
"last_message_id": "155117677105512449",
|
|
80
|
-
"parent_id": "399942396007890945",
|
|
81
|
-
"default_auto_archive_duration": 60
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
###### Example Guild News Channel
|
|
86
|
-
|
|
87
|
-
Bots can post or publish messages in this type of channel if they have the proper permissions. These are called "Announcement Channels" in the client.
|
|
88
|
-
|
|
89
|
-
```json
|
|
90
|
-
{
|
|
91
|
-
"id": "41771983423143937",
|
|
92
|
-
"guild_id": "41771983423143937",
|
|
93
|
-
"name": "important-news",
|
|
94
|
-
"type": 5,
|
|
95
|
-
"position": 6,
|
|
96
|
-
"permission_overwrites": [],
|
|
97
|
-
"nsfw": true,
|
|
98
|
-
"topic": "Rumors about Half Life 3",
|
|
99
|
-
"last_message_id": "155117677105512449",
|
|
100
|
-
"parent_id": "399942396007890945",
|
|
101
|
-
"default_auto_archive_duration": 60
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
###### Example Guild Voice Channel
|
|
106
|
-
|
|
107
|
-
```json
|
|
108
|
-
{
|
|
109
|
-
"id": "155101607195836416",
|
|
110
|
-
"guild_id": "41771983423143937",
|
|
111
|
-
"name": "ROCKET CHEESE",
|
|
112
|
-
"type": 2,
|
|
113
|
-
"nsfw": false,
|
|
114
|
-
"position": 5,
|
|
115
|
-
"permission_overwrites": [],
|
|
116
|
-
"bitrate": 64000,
|
|
117
|
-
"user_limit": 0,
|
|
118
|
-
"parent_id": null,
|
|
119
|
-
"rtc_region": null
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
###### Example DM Channel
|
|
124
|
-
|
|
125
|
-
```json
|
|
126
|
-
{
|
|
127
|
-
"last_message_id": "3343820033257021450",
|
|
128
|
-
"type": 1,
|
|
129
|
-
"id": "319674150115610528",
|
|
130
|
-
"recipients": [
|
|
131
|
-
{
|
|
132
|
-
"username": "test",
|
|
133
|
-
"discriminator": "9999",
|
|
134
|
-
"id": "82198898841029460",
|
|
135
|
-
"avatar": "33ecab261d4681afa4d85a04691c4a01"
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
###### Example Group DM Channel
|
|
142
|
-
|
|
143
|
-
```json
|
|
144
|
-
{
|
|
145
|
-
"name": "Some test channel",
|
|
146
|
-
"icon": null,
|
|
147
|
-
"recipients": [
|
|
148
|
-
{
|
|
149
|
-
"username": "test",
|
|
150
|
-
"discriminator": "9999",
|
|
151
|
-
"id": "82198898841029460",
|
|
152
|
-
"avatar": "33ecab261d4681afa4d85a04691c4a01"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
"username": "test2",
|
|
156
|
-
"discriminator": "9999",
|
|
157
|
-
"id": "82198810841029460",
|
|
158
|
-
"avatar": "33ecab261d4681afa4d85a10691c4a01"
|
|
159
|
-
}
|
|
160
|
-
],
|
|
161
|
-
"last_message_id": "3343820033257021450",
|
|
162
|
-
"type": 3,
|
|
163
|
-
"id": "319674150115710528",
|
|
164
|
-
"owner_id": "82198810841029460"
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
###### Example Channel Category
|
|
169
|
-
|
|
170
|
-
```json
|
|
171
|
-
{
|
|
172
|
-
"permission_overwrites": [],
|
|
173
|
-
"name": "Test",
|
|
174
|
-
"parent_id": null,
|
|
175
|
-
"nsfw": false,
|
|
176
|
-
"position": 0,
|
|
177
|
-
"guild_id": "290926798629997250",
|
|
178
|
-
"type": 4,
|
|
179
|
-
"id": "399942396007890945"
|
|
180
|
-
}
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
###### Example Store Channel
|
|
184
|
-
|
|
185
|
-
Bots can neither send nor read messages in this channel type (as it is a store page).
|
|
186
|
-
|
|
187
|
-
```json
|
|
188
|
-
{
|
|
189
|
-
"id": "41771983423143937",
|
|
190
|
-
"guild_id": "41771983423143937",
|
|
191
|
-
"name": "buy dota-2",
|
|
192
|
-
"type": 6,
|
|
193
|
-
"position": 0,
|
|
194
|
-
"permission_overwrites": [],
|
|
195
|
-
"nsfw": false,
|
|
196
|
-
"parent_id": null
|
|
197
|
-
}
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
###### Example Thread Channel
|
|
201
|
-
|
|
202
|
-
[Threads](#DOCS_TOPICS_THREADS) can be either `archived` or `active`. Archived threads are generally immutable. To send a message or add a reaction, a thread must first be unarchived. The API will helpfully automatically unarchive a thread when sending a message in that thread.
|
|
203
|
-
|
|
204
|
-
Unlike with channels, the API will only sync updates to users about threads the current user can view. When receiving a [guild create](#DOCS_TOPICS_GATEWAY/guild-create) payload, the API will only include active threads the current user can view. Threads inside of private channels are completely private to the members of that private channel. As such, when _gaining_ access to a channel the API sends a [thread list sync](#DOCS_TOPICS_GATEWAY/thread-list-sync), which includes all active threads in that channel.
|
|
205
|
-
|
|
206
|
-
Threads also track membership. Users must be added to a thread before sending messages in them. The API will helpfully automatically add users to a thread when sending a message in that thread.
|
|
207
|
-
|
|
208
|
-
Guilds have limits on the number of active threads and members per thread. Once these are reached additional threads cannot be created or unarchived, and users cannot be added. Threads do not count against the per-guild channel limit.
|
|
209
|
-
|
|
210
|
-
The [threads](#DOCS_TOPICS_THREADS) topic has some more information.
|
|
211
|
-
|
|
212
|
-
```json
|
|
213
|
-
{
|
|
214
|
-
"id": "41771983423143937",
|
|
215
|
-
"guild_id": "41771983423143937",
|
|
216
|
-
"parent_id": "41771983423143937",
|
|
217
|
-
"owner_id": "41771983423143937",
|
|
218
|
-
"name": "don't buy dota-2",
|
|
219
|
-
"type": 11,
|
|
220
|
-
"last_message_id": "155117677105512449",
|
|
221
|
-
"message_count": 1,
|
|
222
|
-
"member_count": 5,
|
|
223
|
-
"rate_limit_per_user": 2,
|
|
224
|
-
"thread_metadata": {
|
|
225
|
-
"archived": false,
|
|
226
|
-
"auto_archive_duration": 1440,
|
|
227
|
-
"archive_timestamp": "2021-04-12T23:40:39.855793+00:00",
|
|
228
|
-
"locked": false
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Message Object
|
|
234
|
-
|
|
235
|
-
Represents a message sent in a channel within Discord.
|
|
236
|
-
|
|
237
|
-
###### Message Structure
|
|
238
|
-
|
|
239
|
-
> warn
|
|
240
|
-
> `content`, `embeds`, `attachments`, and `components` will require a privileged intent in 2022. [Learn more here](https://support-dev.discord.com/hc/en-us/articles/4404772028055).
|
|
241
|
-
|
|
242
|
-
| Field | Type | Description |
|
|
243
|
-
|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
244
|
-
| id | snowflake | id of the message |
|
|
245
|
-
| channel_id | snowflake | id of the channel the message was sent in |
|
|
246
|
-
| guild_id? | snowflake | id of the guild the message was sent in |
|
|
247
|
-
| author\* | [user](#DOCS_RESOURCES_USER/user-object) object | the author of this message (not guaranteed to be a valid user, see below) |
|
|
248
|
-
| member?\*\* | partial [guild member](#DOCS_RESOURCES_GUILD/guild-member-object) object | member properties for this message's author |
|
|
249
|
-
| content | string | contents of the message |
|
|
250
|
-
| timestamp | ISO8601 timestamp | when this message was sent |
|
|
251
|
-
| edited_timestamp | ?ISO8601 timestamp | when this message was edited (or null if never) |
|
|
252
|
-
| tts | boolean | whether this was a TTS message |
|
|
253
|
-
| mention_everyone | boolean | whether this message mentions everyone |
|
|
254
|
-
| mentions\*\*\* | array of [user](#DOCS_RESOURCES_USER/user-object) objects, with an additional partial [member](#DOCS_RESOURCES_GUILD/guild-member-object) field | users specifically mentioned in the message |
|
|
255
|
-
| mention_roles | array of [role](#DOCS_TOPICS_PERMISSIONS/role-object) object ids | roles specifically mentioned in this message |
|
|
256
|
-
| mention_channels?\*\*\*\* | array of [channel mention](#DOCS_RESOURCES_CHANNEL/channel-mention-object) objects | channels specifically mentioned in this message |
|
|
257
|
-
| attachments | array of [attachment](#DOCS_RESOURCES_CHANNEL/attachment-object) objects | any attached files |
|
|
258
|
-
| embeds | array of [embed](#DOCS_RESOURCES_CHANNEL/embed-object) objects | any embedded content |
|
|
259
|
-
| reactions? | array of [reaction](#DOCS_RESOURCES_CHANNEL/reaction-object) objects | reactions to the message |
|
|
260
|
-
| nonce? | integer or string | used for validating a message was sent |
|
|
261
|
-
| pinned | boolean | whether this message is pinned |
|
|
262
|
-
| webhook_id? | snowflake | if the message is generated by a webhook, this is the webhook's id |
|
|
263
|
-
| type | integer | [type of message](#DOCS_RESOURCES_CHANNEL/message-object-message-types) |
|
|
264
|
-
| activity? | [message activity](#DOCS_RESOURCES_CHANNEL/message-object-message-activity-structure) object | sent with Rich Presence-related chat embeds |
|
|
265
|
-
| application? | partial [application](#DOCS_RESOURCES_APPLICATION/application-object) object | sent with Rich Presence-related chat embeds |
|
|
266
|
-
| application_id? | snowflake | if the message is an [Interaction](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/) or application-owned webhook, this is the id of the application |
|
|
267
|
-
| message_reference? | [message reference](#DOCS_RESOURCES_CHANNEL/message-reference-object-message-reference-structure) object | data showing the source of a crosspost, channel follow add, pin, or reply message |
|
|
268
|
-
| flags? | integer | [message flags](#DOCS_RESOURCES_CHANNEL/message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) |
|
|
269
|
-
| referenced_message?\*\*\*\*\* | ?[message object](#DOCS_RESOURCES_CHANNEL/message-object) | the message associated with the message_reference |
|
|
270
|
-
| interaction? | [message interaction object](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/message-interaction-object-message-interaction-structure) | sent if the message is a response to an [Interaction](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/) |
|
|
271
|
-
| thread? | [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object | the thread that was started from this message, includes [thread member](#DOCS_RESOURCES_CHANNEL/thread-member-object) object |
|
|
272
|
-
| components? | Array of [message components](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object) | sent if the message contains components like buttons, action rows, or other interactive components |
|
|
273
|
-
| sticker_items? | array of [message sticker item objects](#DOCS_RESOURCES_STICKER/sticker-item-object) | sent if the message contains stickers |
|
|
274
|
-
| stickers? | array of [sticker](#DOCS_RESOURCES_STICKER/sticker-object) objects | **Deprecated** the stickers sent with the message |
|
|
275
|
-
|
|
276
|
-
\* The author object follows the structure of the user object, but is only a valid user in the case where the message is generated by a user or bot user. If the message is generated by a webhook, the author object corresponds to the webhook's id, username, and avatar. You can tell if a message is generated by a webhook by checking for the `webhook_id` on the message object.
|
|
277
|
-
|
|
278
|
-
\*\* The member object exists in [MESSAGE_CREATE](#DOCS_TOPICS_GATEWAY/message-create) and [MESSAGE_UPDATE](#DOCS_TOPICS_GATEWAY/message-update) events from text-based guild channels, provided that the author of the message is not a webhook. This allows bots to obtain real-time member data without requiring bots to store member state in memory.
|
|
279
|
-
|
|
280
|
-
\*\*\* The user objects in the mentions array will only have the partial `member` field present in [MESSAGE_CREATE](#DOCS_TOPICS_GATEWAY/message-create) and [MESSAGE_UPDATE](#DOCS_TOPICS_GATEWAY/message-update) events from text-based guild channels.
|
|
281
|
-
|
|
282
|
-
\*\*\*\* Not all channel mentions in a message will appear in `mention_channels`. Only textual channels that are visible to everyone in a lurkable guild will ever be included. Only crossposted messages (via Channel Following) currently include `mention_channels` at all. If no mentions in the message meet these requirements, this field will not be sent.
|
|
283
|
-
|
|
284
|
-
\*\*\*\*\* This field is only returned for messages with a `type` of `19` (REPLY) or `21` (THREAD_STARTER_MESSAGE). If the message is a reply but the `referenced_message` field is not present, the backend did not attempt to fetch the message that was being replied to, so its state is unknown. If the field exists but is null, the referenced message was deleted.
|
|
285
|
-
|
|
286
|
-
###### Message Types
|
|
287
|
-
|
|
288
|
-
> warn
|
|
289
|
-
> Type `19` and `20` are only in API v8. In v6, they are still type `0`. Type `21` is only in API v9.
|
|
290
|
-
|
|
291
|
-
| Type | Value |
|
|
292
|
-
|----------------------------------------------|-------|
|
|
293
|
-
| DEFAULT | 0 |
|
|
294
|
-
| RECIPIENT_ADD | 1 |
|
|
295
|
-
| RECIPIENT_REMOVE | 2 |
|
|
296
|
-
| CALL | 3 |
|
|
297
|
-
| CHANNEL_NAME_CHANGE | 4 |
|
|
298
|
-
| CHANNEL_ICON_CHANGE | 5 |
|
|
299
|
-
| CHANNEL_PINNED_MESSAGE | 6 |
|
|
300
|
-
| GUILD_MEMBER_JOIN | 7 |
|
|
301
|
-
| USER_PREMIUM_GUILD_SUBSCRIPTION | 8 |
|
|
302
|
-
| USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1 | 9 |
|
|
303
|
-
| USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2 | 10 |
|
|
304
|
-
| USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3 | 11 |
|
|
305
|
-
| CHANNEL_FOLLOW_ADD | 12 |
|
|
306
|
-
| GUILD_DISCOVERY_DISQUALIFIED | 14 |
|
|
307
|
-
| GUILD_DISCOVERY_REQUALIFIED | 15 |
|
|
308
|
-
| GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING | 16 |
|
|
309
|
-
| GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING | 17 |
|
|
310
|
-
| THREAD_CREATED | 18 |
|
|
311
|
-
| REPLY | 19 |
|
|
312
|
-
| CHAT_INPUT_COMMAND | 20 |
|
|
313
|
-
| THREAD_STARTER_MESSAGE | 21 |
|
|
314
|
-
| GUILD_INVITE_REMINDER | 22 |
|
|
315
|
-
| CONTEXT_MENU_COMMAND | 23 |
|
|
316
|
-
|
|
317
|
-
###### Message Activity Structure
|
|
318
|
-
|
|
319
|
-
| Field | Type | Description |
|
|
320
|
-
|-----------|---------|--------------------------------------------------------------------------------------------------------------------|
|
|
321
|
-
| type | integer | [type of message activity](#DOCS_RESOURCES_CHANNEL/message-object-message-activity-types) |
|
|
322
|
-
| party_id? | string | party_id from a [Rich Presence event](#DOCS_RICH_PRESENCE_HOW_TO/updating-presence-update-presence-payload-fields) |
|
|
323
|
-
|
|
324
|
-
###### Message Activity Types
|
|
325
|
-
|
|
326
|
-
| Type | Value |
|
|
327
|
-
|--------------|-------|
|
|
328
|
-
| JOIN | 1 |
|
|
329
|
-
| SPECTATE | 2 |
|
|
330
|
-
| LISTEN | 3 |
|
|
331
|
-
| JOIN_REQUEST | 5 |
|
|
332
|
-
|
|
333
|
-
###### Message Flags
|
|
334
|
-
|
|
335
|
-
| Flag | Value | Description |
|
|
336
|
-
|----------------------------------------|--------|-----------------------------------------------------------------------------------|
|
|
337
|
-
| CROSSPOSTED | 1 << 0 | this message has been published to subscribed channels (via Channel Following) |
|
|
338
|
-
| IS_CROSSPOST | 1 << 1 | this message originated from a message in another channel (via Channel Following) |
|
|
339
|
-
| SUPPRESS_EMBEDS | 1 << 2 | do not include any embeds when serializing this message |
|
|
340
|
-
| SOURCE_MESSAGE_DELETED | 1 << 3 | the source message for this crosspost has been deleted (via Channel Following) |
|
|
341
|
-
| URGENT | 1 << 4 | this message came from the urgent message system |
|
|
342
|
-
| HAS_THREAD | 1 << 5 | this message has an associated thread, with the same id as the message |
|
|
343
|
-
| EPHEMERAL | 1 << 6 | this message is only visible to the user who invoked the Interaction |
|
|
344
|
-
| LOADING | 1 << 7 | this message is an Interaction Response and the bot is "thinking" |
|
|
345
|
-
| FAILED_TO_MENTION_SOME_ROLES_IN_THREAD | 1 << 8 | this message failed to mention some roles and add their members to the thread |
|
|
346
|
-
|
|
347
|
-
###### Example Message
|
|
348
|
-
|
|
349
|
-
```json
|
|
350
|
-
{
|
|
351
|
-
"reactions": [
|
|
352
|
-
{
|
|
353
|
-
"count": 1,
|
|
354
|
-
"me": false,
|
|
355
|
-
"emoji": {
|
|
356
|
-
"id": null,
|
|
357
|
-
"name": "🔥"
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
],
|
|
361
|
-
"attachments": [],
|
|
362
|
-
"tts": false,
|
|
363
|
-
"embeds": [],
|
|
364
|
-
"timestamp": "2017-07-11T17:27:07.299000+00:00",
|
|
365
|
-
"mention_everyone": false,
|
|
366
|
-
"id": "334385199974967042",
|
|
367
|
-
"pinned": false,
|
|
368
|
-
"edited_timestamp": null,
|
|
369
|
-
"author": {
|
|
370
|
-
"username": "Mason",
|
|
371
|
-
"discriminator": "9999",
|
|
372
|
-
"id": "53908099506183680",
|
|
373
|
-
"avatar": "a_bab14f271d565501444b2ca3be944b25"
|
|
374
|
-
},
|
|
375
|
-
"mention_roles": [],
|
|
376
|
-
"content": "Supa Hot",
|
|
377
|
-
"channel_id": "290926798999357250",
|
|
378
|
-
"mentions": [],
|
|
379
|
-
"type": 0
|
|
380
|
-
}
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
###### Example Crossposted Message
|
|
384
|
-
|
|
385
|
-
```json
|
|
386
|
-
{
|
|
387
|
-
"reactions": [
|
|
388
|
-
{
|
|
389
|
-
"count": 1,
|
|
390
|
-
"me": false,
|
|
391
|
-
"emoji": {
|
|
392
|
-
"id": null,
|
|
393
|
-
"name": "🔥"
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
],
|
|
397
|
-
"attachments": [],
|
|
398
|
-
"tts": false,
|
|
399
|
-
"embeds": [],
|
|
400
|
-
"timestamp": "2017-07-11T17:27:07.299000+00:00",
|
|
401
|
-
"mention_everyone": false,
|
|
402
|
-
"id": "334385199974967042",
|
|
403
|
-
"pinned": false,
|
|
404
|
-
"edited_timestamp": null,
|
|
405
|
-
"author": {
|
|
406
|
-
"username": "Mason",
|
|
407
|
-
"discriminator": "9999",
|
|
408
|
-
"id": "53908099506183680",
|
|
409
|
-
"avatar": "a_bab14f271d565501444b2ca3be944b25"
|
|
410
|
-
},
|
|
411
|
-
"mention_roles": [],
|
|
412
|
-
"mention_channels": [
|
|
413
|
-
{
|
|
414
|
-
"id": "278325129692446722",
|
|
415
|
-
"guild_id": "278325129692446720",
|
|
416
|
-
"name": "big-news",
|
|
417
|
-
"type": 5
|
|
418
|
-
}
|
|
419
|
-
],
|
|
420
|
-
"content": "Big news! In this <#278325129692446722> channel!",
|
|
421
|
-
"channel_id": "290926798999357250",
|
|
422
|
-
"mentions": [],
|
|
423
|
-
"type": 0,
|
|
424
|
-
"flags": 2,
|
|
425
|
-
"message_reference": {
|
|
426
|
-
"channel_id": "278325129692446722",
|
|
427
|
-
"guild_id": "278325129692446720",
|
|
428
|
-
"message_id": "306588351130107906"
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
### Message Reference Object
|
|
434
|
-
|
|
435
|
-
###### Message Reference Structure
|
|
436
|
-
|
|
437
|
-
| Field | Type | Description |
|
|
438
|
-
|---------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------|
|
|
439
|
-
| message_id? | snowflake | id of the originating message |
|
|
440
|
-
| channel_id? \* | snowflake | id of the originating message's channel |
|
|
441
|
-
| guild_id? | snowflake | id of the originating message's guild |
|
|
442
|
-
| fail_if_not_exists? | boolean | when sending, whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message, default true |
|
|
443
|
-
|
|
444
|
-
\* `channel_id` is optional when creating a reply, but will always be present when receiving an event/response that includes this data model.
|
|
445
|
-
|
|
446
|
-
#### Message Types
|
|
447
|
-
|
|
448
|
-
There are multiple message types that have a message_reference object. Since message references are generic attribution to a previous message, there will be more types of messages which have this information in the future.
|
|
449
|
-
|
|
450
|
-
###### Crosspost messages
|
|
451
|
-
|
|
452
|
-
- These are messages that originated from another channel (IS_CROSSPOST flag).
|
|
453
|
-
- These messages have all three fields, with data of the original message that was crossposted.
|
|
454
|
-
|
|
455
|
-
###### Channel Follow Add messages
|
|
456
|
-
|
|
457
|
-
- These are automatic messages sent when a channel is followed into the current channel (type 12).
|
|
458
|
-
- These messages have the `channel_id` and `guild_id` fields, with data of the followed announcement channel.
|
|
459
|
-
|
|
460
|
-
###### Pin messages
|
|
461
|
-
|
|
462
|
-
- These are automatic messages sent when a message is pinned (type 6).
|
|
463
|
-
- These messages have `message_id` and `channel_id`, and `guild_id` if it is in a guild, with data of the message that was pinned.
|
|
464
|
-
|
|
465
|
-
###### Replies
|
|
466
|
-
|
|
467
|
-
- These are messages replying to a previous message (type 19).
|
|
468
|
-
- These messages have `message_id` and `channel_id`, and `guild_id` if it is in a guild, with data of the message that was replied to. The channel_id and guild_id will be the same as the reply.
|
|
469
|
-
- Replies are created by including a message_reference when sending a message. When sending, only `message_id` is required.
|
|
470
|
-
|
|
471
|
-
###### Thread starter message
|
|
472
|
-
|
|
473
|
-
- These are the first message in a public thread. They point back to the message in the parent channel from which the thread was started (type 21)
|
|
474
|
-
- These messages have `message_id`, `channel_id`, and `guild_id`.
|
|
475
|
-
- These messages will never have content, embeds, or attachments, mainly just the `message_reference` and `referenced_message` fields.
|
|
476
|
-
|
|
477
|
-
### Followed Channel Object
|
|
478
|
-
|
|
479
|
-
###### Followed Channel Structure
|
|
480
|
-
|
|
481
|
-
| Field | Type | Description |
|
|
482
|
-
|------------|-----------|---------------------------|
|
|
483
|
-
| channel_id | snowflake | source channel id |
|
|
484
|
-
| webhook_id | snowflake | created target webhook id |
|
|
485
|
-
|
|
486
|
-
### Reaction Object
|
|
487
|
-
|
|
488
|
-
###### Reaction Structure
|
|
489
|
-
|
|
490
|
-
| Field | Type | Description |
|
|
491
|
-
|-------|------------------------------------------------------------|---------------------------------------------------|
|
|
492
|
-
| count | integer | times this emoji has been used to react |
|
|
493
|
-
| me | boolean | whether the current user reacted using this emoji |
|
|
494
|
-
| emoji | partial [emoji](#DOCS_RESOURCES_EMOJI/emoji-object) object | emoji information |
|
|
495
|
-
|
|
496
|
-
### Overwrite Object
|
|
497
|
-
|
|
498
|
-
See [permissions](#DOCS_TOPICS_PERMISSIONS/permissions) for more information about the `allow` and `deny` fields.
|
|
499
|
-
|
|
500
|
-
###### Overwrite Structure
|
|
501
|
-
|
|
502
|
-
| Field | Type | Description |
|
|
503
|
-
|-------|-----------|-------------------------------|
|
|
504
|
-
| id | snowflake | role or user id |
|
|
505
|
-
| type | int | either 0 (role) or 1 (member) |
|
|
506
|
-
| allow | string | permission bit set |
|
|
507
|
-
| deny | string | permission bit set |
|
|
508
|
-
|
|
509
|
-
### Thread Metadata Object
|
|
510
|
-
|
|
511
|
-
The thread metadata object contains a number of thread-specific channel fields that are not needed by other channel types.
|
|
512
|
-
|
|
513
|
-
###### Thread Metadata Structure
|
|
514
|
-
|
|
515
|
-
| Field | Type | Description |
|
|
516
|
-
|-----------------------|--------------------|---------------------------------------------------------------------------------------------------------------------|
|
|
517
|
-
| archived | boolean | whether the thread is archived |
|
|
518
|
-
| auto_archive_duration | integer | duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 |
|
|
519
|
-
| archive_timestamp | ISO8601 timestamp | timestamp when the thread's archive status was last changed, used for calculating recent activity |
|
|
520
|
-
| locked | boolean | whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it |
|
|
521
|
-
| invitable? | boolean | whether non-moderators can add other non-moderators to a thread; only available on private threads |
|
|
522
|
-
| create_timestamp? | ?ISO8601 timestamp | timestamp when the thread was created; only populated for threads created after 2022-01-09 |
|
|
523
|
-
|
|
524
|
-
### Thread Member Object
|
|
525
|
-
|
|
526
|
-
A thread member is used to indicate whether a user has joined a thread or not.
|
|
527
|
-
|
|
528
|
-
###### Thread Member Structure
|
|
529
|
-
|
|
530
|
-
| Field | Type | Description |
|
|
531
|
-
|----------------|-------------------|-----------------------------------------------------------------|
|
|
532
|
-
| id? \* | snowflake | the id of the thread |
|
|
533
|
-
| user_id? \* | snowflake | the id of the user |
|
|
534
|
-
| join_timestamp | ISO8601 timestamp | the time the current user last joined the thread |
|
|
535
|
-
| flags | integer | any user-thread settings, currently only used for notifications |
|
|
536
|
-
|
|
537
|
-
** \* These fields are omitted on the member sent within each thread in the [GUILD_CREATE](#DOCS_TOPICS_GATEWAY/guild-create) event **
|
|
538
|
-
|
|
539
|
-
### Embed Object
|
|
540
|
-
|
|
541
|
-
###### Embed Structure
|
|
542
|
-
|
|
543
|
-
| Field | Type | Description |
|
|
544
|
-
|--------------|--------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------|
|
|
545
|
-
| title? | string | title of embed |
|
|
546
|
-
| type? | string | [type of embed](#DOCS_RESOURCES_CHANNEL/embed-object-embed-types) (always "rich" for webhook embeds) |
|
|
547
|
-
| description? | string | description of embed |
|
|
548
|
-
| url? | string | url of embed |
|
|
549
|
-
| timestamp? | ISO8601 timestamp | timestamp of embed content |
|
|
550
|
-
| color? | integer | color code of the embed |
|
|
551
|
-
| footer? | [embed footer](#DOCS_RESOURCES_CHANNEL/embed-object-embed-footer-structure) object | footer information |
|
|
552
|
-
| image? | [embed image](#DOCS_RESOURCES_CHANNEL/embed-object-embed-image-structure) object | image information |
|
|
553
|
-
| thumbnail? | [embed thumbnail](#DOCS_RESOURCES_CHANNEL/embed-object-embed-thumbnail-structure) object | thumbnail information |
|
|
554
|
-
| video? | [embed video](#DOCS_RESOURCES_CHANNEL/embed-object-embed-video-structure) object | video information |
|
|
555
|
-
| provider? | [embed provider](#DOCS_RESOURCES_CHANNEL/embed-object-embed-provider-structure) object | provider information |
|
|
556
|
-
| author? | [embed author](#DOCS_RESOURCES_CHANNEL/embed-object-embed-author-structure) object | author information |
|
|
557
|
-
| fields? | array of [embed field](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) objects | fields information |
|
|
558
|
-
|
|
559
|
-
###### Embed Types
|
|
560
|
-
|
|
561
|
-
Embed types are "loosely defined" and, for the most part, are not used by our clients for rendering. Embed attributes power what is rendered. Embed types should be considered deprecated and might be removed in a future API version.
|
|
562
|
-
|
|
563
|
-
| Type | Description |
|
|
564
|
-
|---------|----------------------------------------------------|
|
|
565
|
-
| rich | generic embed rendered from embed attributes |
|
|
566
|
-
| image | image embed |
|
|
567
|
-
| video | video embed |
|
|
568
|
-
| gifv | animated gif image embed rendered as a video embed |
|
|
569
|
-
| article | article embed |
|
|
570
|
-
| link | link embed |
|
|
571
|
-
|
|
572
|
-
###### Embed Thumbnail Structure
|
|
573
|
-
|
|
574
|
-
| Field | Type | Description |
|
|
575
|
-
|------------|---------|-----------------------------------------------------------------|
|
|
576
|
-
| url | string | source url of thumbnail (only supports http(s) and attachments) |
|
|
577
|
-
| proxy_url? | string | a proxied url of the thumbnail |
|
|
578
|
-
| height? | integer | height of thumbnail |
|
|
579
|
-
| width? | integer | width of thumbnail |
|
|
580
|
-
|
|
581
|
-
###### Embed Video Structure
|
|
582
|
-
|
|
583
|
-
| Field | Type | Description |
|
|
584
|
-
|------------|---------|----------------------------|
|
|
585
|
-
| url? | string | source url of video |
|
|
586
|
-
| proxy_url? | string | a proxied url of the video |
|
|
587
|
-
| height? | integer | height of video |
|
|
588
|
-
| width? | integer | width of video |
|
|
589
|
-
|
|
590
|
-
###### Embed Image Structure
|
|
591
|
-
|
|
592
|
-
| Field | Type | Description |
|
|
593
|
-
|------------|---------|-------------------------------------------------------------|
|
|
594
|
-
| url | string | source url of image (only supports http(s) and attachments) |
|
|
595
|
-
| proxy_url? | string | a proxied url of the image |
|
|
596
|
-
| height? | integer | height of image |
|
|
597
|
-
| width? | integer | width of image |
|
|
598
|
-
|
|
599
|
-
###### Embed Provider Structure
|
|
600
|
-
|
|
601
|
-
| Field | Type | Description |
|
|
602
|
-
|-------|--------|------------------|
|
|
603
|
-
| name? | string | name of provider |
|
|
604
|
-
| url? | string | url of provider |
|
|
605
|
-
|
|
606
|
-
###### Embed Author Structure
|
|
607
|
-
|
|
608
|
-
| Field | Type | Description |
|
|
609
|
-
|-----------------|--------|------------------------------------------------------------|
|
|
610
|
-
| name | string | name of author |
|
|
611
|
-
| url? | string | url of author |
|
|
612
|
-
| icon_url? | string | url of author icon (only supports http(s) and attachments) |
|
|
613
|
-
| proxy_icon_url? | string | a proxied url of author icon |
|
|
614
|
-
|
|
615
|
-
###### Embed Footer Structure
|
|
616
|
-
|
|
617
|
-
| Field | Type | Description |
|
|
618
|
-
|-----------------|--------|------------------------------------------------------------|
|
|
619
|
-
| text | string | footer text |
|
|
620
|
-
| icon_url? | string | url of footer icon (only supports http(s) and attachments) |
|
|
621
|
-
| proxy_icon_url? | string | a proxied url of footer icon |
|
|
622
|
-
|
|
623
|
-
###### Embed Field Structure
|
|
624
|
-
|
|
625
|
-
| Field | Type | Description |
|
|
626
|
-
|---------|---------|-------------------------------------------------|
|
|
627
|
-
| name | string | name of the field |
|
|
628
|
-
| value | string | value of the field |
|
|
629
|
-
| inline? | boolean | whether or not this field should display inline |
|
|
630
|
-
|
|
631
|
-
###### Embed Limits
|
|
632
|
-
|
|
633
|
-
To facilitate showing rich content, rich embeds do not follow the traditional limits of message content. However, some limits are still in place to prevent excessively large embeds. The following table describes the limits:
|
|
634
|
-
|
|
635
|
-
All of the following limits are measured inclusively. Leading and trailing whitespace characters are not included (they are trimmed automatically).
|
|
636
|
-
|
|
637
|
-
| Field | Limit |
|
|
638
|
-
|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
|
|
639
|
-
| title | 256 characters |
|
|
640
|
-
| description | 4096 characters |
|
|
641
|
-
| fields | Up to 25 [field](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) objects |
|
|
642
|
-
| [field.name](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) | 256 characters |
|
|
643
|
-
| [field.value](#DOCS_RESOURCES_CHANNEL/embed-object-embed-field-structure) | 1024 characters |
|
|
644
|
-
| [footer.text](#DOCS_RESOURCES_CHANNEL/embed-object-embed-footer-structure) | 2048 characters |
|
|
645
|
-
| [author.name](#DOCS_RESOURCES_CHANNEL/embed-object-embed-author-structure) | 256 characters |
|
|
646
|
-
|
|
647
|
-
Additionally, the combined sum of characters in all `title`, `description`, `field.name`, `field.value`, `footer.text`, and `author.name` fields across all embeds attached to a message must not exceed 6000 characters. Violating any of these constraints will result in a `Bad Request` response.
|
|
648
|
-
|
|
649
|
-
### Attachment Object
|
|
650
|
-
|
|
651
|
-
###### Attachment Structure
|
|
652
|
-
|
|
653
|
-
> info
|
|
654
|
-
> For the `attachments` array in Message Create/Edit requests, only the `id` is required.
|
|
655
|
-
|
|
656
|
-
| Field | Type | Description |
|
|
657
|
-
|---------------|-----------|-------------------------------------------------------------------------------------|
|
|
658
|
-
| id | snowflake | attachment id |
|
|
659
|
-
| filename | string | name of file attached |
|
|
660
|
-
| description? | string | description for the file |
|
|
661
|
-
| content_type? | string | the attachment's [media type](https://en.wikipedia.org/wiki/Media_type) |
|
|
662
|
-
| size | integer | size of file in bytes |
|
|
663
|
-
| url | string | source url of file |
|
|
664
|
-
| proxy_url | string | a proxied url of file |
|
|
665
|
-
| height? | ?integer | height of file (if image) |
|
|
666
|
-
| width? | ?integer | width of file (if image) |
|
|
667
|
-
| ephemeral? \* | boolean | whether this attachment is ephemeral |
|
|
668
|
-
|
|
669
|
-
\* Ephemeral attachments will automatically be removed after a set period of time. Ephemeral attachments on messages are guaranteed to be available as long as the message itself exists.
|
|
670
|
-
|
|
671
|
-
### Channel Mention Object
|
|
672
|
-
|
|
673
|
-
###### Channel Mention Structure
|
|
674
|
-
|
|
675
|
-
| Field | Type | Description |
|
|
676
|
-
|----------|-----------|-----------------------------------------------------------------------------|
|
|
677
|
-
| id | snowflake | id of the channel |
|
|
678
|
-
| guild_id | snowflake | id of the guild containing the channel |
|
|
679
|
-
| type | integer | the [type of channel](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) |
|
|
680
|
-
| name | string | the name of the channel |
|
|
681
|
-
|
|
682
|
-
### Allowed Mentions Object
|
|
683
|
-
|
|
684
|
-
The allowed mention field allows for more granular control over mentions without various hacks to the message content. This will always validate against message content to avoid phantom pings (e.g. to ping everyone, you must still have `@everyone` in the message content), and check against user/bot permissions.
|
|
685
|
-
|
|
686
|
-
###### Allowed Mention Types
|
|
687
|
-
|
|
688
|
-
| Type | Value | Description |
|
|
689
|
-
|-------------------|------------|---------------------------------------|
|
|
690
|
-
| Role Mentions | "roles" | Controls role mentions |
|
|
691
|
-
| User Mentions | "users" | Controls user mentions |
|
|
692
|
-
| Everyone Mentions | "everyone" | Controls @everyone and @here mentions |
|
|
693
|
-
|
|
694
|
-
###### Allowed Mentions Structure
|
|
695
|
-
|
|
696
|
-
| Field | Type | Description |
|
|
697
|
-
|--------------|--------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
|
|
698
|
-
| parse | array of allowed mention types | An array of [allowed mention types](#DOCS_RESOURCES_CHANNEL/allowed-mentions-object-allowed-mention-types) to parse from the content. |
|
|
699
|
-
| roles | list of snowflakes | Array of role_ids to mention (Max size of 100) |
|
|
700
|
-
| users | list of snowflakes | Array of user_ids to mention (Max size of 100) |
|
|
701
|
-
| replied_user | boolean | For replies, whether to mention the author of the message being replied to (default false) |
|
|
702
|
-
|
|
703
|
-
###### Allowed Mentions Reference
|
|
704
|
-
|
|
705
|
-
Due to the complexity of possibilities, we have included a set of examples and behavior for the allowed mentions field.
|
|
706
|
-
|
|
707
|
-
If `allowed_mentions` is _not_ passed in (i.e. the key does not exist), the mentions will be parsed via the content. This corresponds with existing behavior.
|
|
708
|
-
|
|
709
|
-
In the example below we would ping @here (and also @role124 and @user123)
|
|
710
|
-
|
|
711
|
-
```json
|
|
712
|
-
{
|
|
713
|
-
"content": "@here Hi there from <@123>, cc <@&124>"
|
|
714
|
-
}
|
|
715
|
-
```
|
|
716
|
-
|
|
717
|
-
To suppress all mentions in a message use:
|
|
718
|
-
|
|
719
|
-
```json
|
|
720
|
-
{
|
|
721
|
-
"content": "@everyone hi there, <@&123>",
|
|
722
|
-
"allowed_mentions": {
|
|
723
|
-
"parse": []
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
```
|
|
727
|
-
|
|
728
|
-
This will suppress _all_ mentions in the message (no @everyone or user mention).
|
|
729
|
-
|
|
730
|
-
The `parse` field is mutually exclusive with the other fields. In the example below, we would ping users `123` and role `124`, but _not_ @everyone. Note that passing a `Falsy` value ([], null) into the "users" field does not trigger a validation error.
|
|
731
|
-
|
|
732
|
-
```json
|
|
733
|
-
{
|
|
734
|
-
"content": "@everyone <@123> <@&124>",
|
|
735
|
-
"allowed_mentions": {
|
|
736
|
-
"parse": ["users", "roles"],
|
|
737
|
-
"users": []
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
```
|
|
741
|
-
|
|
742
|
-
In the next example, we would ping @everyone, (and also users `123` and `124` if they suppressed
|
|
743
|
-
@everyone mentions), but we would not ping any roles.
|
|
744
|
-
|
|
745
|
-
```json
|
|
746
|
-
{
|
|
747
|
-
"content": "@everyone <@123> <@124> <@125> <@&200>",
|
|
748
|
-
"allowed_mentions": {
|
|
749
|
-
"parse": ["everyone"],
|
|
750
|
-
"users": ["123", "124"]
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
```
|
|
754
|
-
|
|
755
|
-
Due to possible ambiguities, not all configurations are valid. An _invalid_ configuration is as follows
|
|
756
|
-
|
|
757
|
-
```json
|
|
758
|
-
{
|
|
759
|
-
"content": "@everyone <@123> <@124> <@125> <@&200>",
|
|
760
|
-
"allowed_mentions": {
|
|
761
|
-
"parse": ["users"],
|
|
762
|
-
"users": ["123", "124"]
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
```
|
|
766
|
-
|
|
767
|
-
Because `parse: ["users"]` and `users: [123, 124]` are both present, we would throw a validation error.
|
|
768
|
-
This is because the conditions cannot be fulfilled simultaneously (they are mutually exclusive).
|
|
769
|
-
|
|
770
|
-
Any entities with an ID included in the list of IDs can be mentioned. Note that the IDs of entities not present in the message's content will simply be ignored.
|
|
771
|
-
e.g. The following example is valid, and would mention user 123, but _not_ user 125 since there is no mention of
|
|
772
|
-
user 125 in the content.
|
|
773
|
-
|
|
774
|
-
```json
|
|
775
|
-
{
|
|
776
|
-
"content": "<@123> Time for some memes.",
|
|
777
|
-
"allowed_mentions": {
|
|
778
|
-
"users": ["123", "125"]
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
```
|
|
782
|
-
|
|
783
|
-
## Get Channel % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}
|
|
784
|
-
|
|
785
|
-
Get a channel by ID. Returns a [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object. If the channel is a thread, a [thread member](#DOCS_RESOURCES_CHANNEL/thread-member-object) object is included in the returned result.
|
|
786
|
-
|
|
787
|
-
## Modify Channel % PATCH /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}
|
|
788
|
-
|
|
789
|
-
Update a channel's settings. Returns a [channel](#DOCS_RESOURCES_CHANNEL/channel-object) on success, and a 400 BAD REQUEST on invalid parameters. All JSON parameters are optional.
|
|
790
|
-
|
|
791
|
-
> info
|
|
792
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
793
|
-
|
|
794
|
-
###### JSON Params (Group DM)
|
|
795
|
-
|
|
796
|
-
Fires a [Channel Update](#DOCS_TOPICS_GATEWAY/channel-update) Gateway event.
|
|
797
|
-
|
|
798
|
-
| Field | Type | Description |
|
|
799
|
-
|-----------------------|-------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
800
|
-
| name | string | 1-100 character channel name |
|
|
801
|
-
| icon | binary | base64 encoded icon |
|
|
802
|
-
|
|
803
|
-
###### JSON Params (Guild channel)
|
|
804
|
-
|
|
805
|
-
Requires the `MANAGE_CHANNELS` permission for the guild. Fires a [Channel Update](#DOCS_TOPICS_GATEWAY/channel-update) Gateway event. If modifying a category, individual [Channel Update](#DOCS_TOPICS_GATEWAY/channel-update) events will fire for each child channel that also changes. If modifying permission overwrites, the `MANAGE_ROLES` permission is required. Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a `MANAGE_ROLES` overwrite in the channel).
|
|
806
|
-
|
|
807
|
-
| Field | Type | Description | Channel Type |
|
|
808
|
-
|-------------------------------|---------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------|
|
|
809
|
-
| name | string | 1-100 character channel name | All |
|
|
810
|
-
| type | integer | the [type of channel](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types); only conversion between text and news is supported and only in guilds with the "NEWS" feature | Text, News |
|
|
811
|
-
| position | ?integer | the position of the channel in the left-hand listing | All |
|
|
812
|
-
| topic | ?string | 0-1024 character channel topic | Text, News |
|
|
813
|
-
| nsfw | ?boolean | whether the channel is nsfw | Text, News, Store |
|
|
814
|
-
| rate_limit_per_user | ?integer | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission `manage_messages` or `manage_channel`, are unaffected | Text |
|
|
815
|
-
| bitrate | ?integer | the bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers) | Voice |
|
|
816
|
-
| user_limit | ?integer | the user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit | Voice |
|
|
817
|
-
| permission_overwrites\* | ?array of partial [overwrite](#DOCS_RESOURCES_CHANNEL/overwrite-object) objects | channel or category-specific permissions | All |
|
|
818
|
-
| parent_id | ?snowflake | id of the new parent category for a channel | Text, News, Store, Voice |
|
|
819
|
-
| rtc_region | ?string | channel [voice region](#DOCS_RESOURCES_VOICE/voice-region-object) id, automatic when set to null | Voice |
|
|
820
|
-
| video_quality_mode | ?integer | the camera [video quality mode](#DOCS_RESOURCES_CHANNEL/channel-object-video-quality-modes) of the voice channel | Voice |
|
|
821
|
-
| default_auto_archive_duration | ?integer | the default duration that the clients use (not the API) for newly created threads in the channel, in minutes, to automatically archive the thread after recent activity | Text, News |
|
|
822
|
-
|
|
823
|
-
\* In each overwrite object, the `allow` and `deny` keys can be omitted or set to `null`, which both default to `"0"`.
|
|
824
|
-
|
|
825
|
-
###### JSON Params (Thread)
|
|
826
|
-
|
|
827
|
-
When setting `archived` to `false`, when `locked` is also `false`, only the `SEND_MESSAGES` permission is required.
|
|
828
|
-
|
|
829
|
-
Otherwise, requires the `MANAGE_THREADS` permission. Fires a [Thread Update](#DOCS_TOPICS_GATEWAY/thread-update) Gateway event. Requires the thread to have `archived` set to `false` or be set to `false` in the request.
|
|
830
|
-
|
|
831
|
-
| Field | Type | Description |
|
|
832
|
-
|-------------------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
833
|
-
| name | string | 1-100 character channel name |
|
|
834
|
-
| archived | boolean | whether the thread is archived |
|
|
835
|
-
| auto_archive_duration\* | integer | duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 |
|
|
836
|
-
| locked | boolean | whether the thread is locked; when a thread is locked, only users with MANAGE_THREADS can unarchive it |
|
|
837
|
-
| invitable | boolean | whether non-moderators can add other non-moderators to a thread; only available on private threads |
|
|
838
|
-
| rate_limit_per_user | ?integer | amount of seconds a user has to wait before sending another message (0-21600); bots, as well as users with the permission `manage_messages`, `manage_thread`, or `manage_channel`, are unaffected |
|
|
839
|
-
|
|
840
|
-
\* The 3 day and 7 day archive durations require the server to be boosted. The [guild features](#DOCS_RESOURCES_GUILD/guild-object-guild-features) will indicate if a server is able to use those settings.
|
|
841
|
-
|
|
842
|
-
## Delete/Close Channel % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}
|
|
843
|
-
|
|
844
|
-
Delete a channel, or close a private message. Requires the `MANAGE_CHANNELS` permission for the guild, or `MANAGE_THREADS` if the channel is a thread. Deleting a category does not delete its child channels; they will have their `parent_id` removed and a [Channel Update](#DOCS_TOPICS_GATEWAY/channel-update) Gateway event will fire for each of them. Returns a [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object on success. Fires a [Channel Delete](#DOCS_TOPICS_GATEWAY/channel-delete) Gateway event (or [Thread Delete](#DOCS_TOPICS_GATEWAY/thread-delete) if the channel was a thread).
|
|
845
|
-
|
|
846
|
-
> warn
|
|
847
|
-
> Deleting a guild channel cannot be undone. Use this with caution, as it is impossible to undo this action when performed on a guild channel. In contrast, when used with a private message, it is possible to undo the action by opening a private message with the recipient again.
|
|
848
|
-
|
|
849
|
-
> info
|
|
850
|
-
> For Community guilds, the Rules or Guidelines channel and the Community Updates channel cannot be deleted.
|
|
851
|
-
|
|
852
|
-
> info
|
|
853
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
854
|
-
|
|
855
|
-
## Get Channel Messages % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages
|
|
856
|
-
|
|
857
|
-
Returns the messages for a channel. If operating on a guild channel, this endpoint requires the `VIEW_CHANNEL` permission to be present on the current user. If the current user is missing the 'READ_MESSAGE_HISTORY' permission in the channel then this will return no messages (since they cannot read the message history). Returns an array of [message](#DOCS_RESOURCES_CHANNEL/message-object) objects on success.
|
|
858
|
-
|
|
859
|
-
> info
|
|
860
|
-
> The before, after, and around keys are mutually exclusive, only one may be passed at a time.
|
|
861
|
-
|
|
862
|
-
###### Query String Params
|
|
863
|
-
|
|
864
|
-
| Field | Type | Description | Required | Default |
|
|
865
|
-
|--------|-----------|------------------------------------------|----------|---------|
|
|
866
|
-
| around | snowflake | get messages around this message ID | false | absent |
|
|
867
|
-
| before | snowflake | get messages before this message ID | false | absent |
|
|
868
|
-
| after | snowflake | get messages after this message ID | false | absent |
|
|
869
|
-
| limit | integer | max number of messages to return (1-100) | false | 50 |
|
|
870
|
-
|
|
871
|
-
## Get Channel Message % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}
|
|
872
|
-
|
|
873
|
-
Returns a specific message in the channel. If operating on a guild channel, this endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. Returns a [message](#DOCS_RESOURCES_CHANNEL/message-object) object on success.
|
|
874
|
-
|
|
875
|
-
## Create Message % POST /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages
|
|
876
|
-
|
|
877
|
-
> warn
|
|
878
|
-
> Discord may strip certain characters from message content, like invalid unicode characters or characters which cause unexpected message formatting. If you are passing user-generated strings into message content, consider sanitizing the data to prevent unexpected behavior and utilizing `allowed_mentions` to prevent unexpected mentions.
|
|
879
|
-
|
|
880
|
-
Post a message to a guild text or DM channel. Returns a [message](#DOCS_RESOURCES_CHANNEL/message-object) object. Fires a [Message Create](#DOCS_TOPICS_GATEWAY/message-create) Gateway event. See [message formatting](#DOCS_REFERENCE/message-formatting) for more information on how to properly format messages.
|
|
881
|
-
|
|
882
|
-
You may create a message as a reply to another message. To do so, include a [`message_reference`](#DOCS_RESOURCES_CHANNEL/message-reference-object-message-reference-structure) with a `message_id`. The `channel_id` and `guild_id` in the `message_reference` are optional, but will be validated if provided.
|
|
883
|
-
|
|
884
|
-
Files must be attached using a `multipart/form-data` body as described in [Uploading Files](#DOCS_REFERENCE/uploading-files).
|
|
885
|
-
|
|
886
|
-
###### Limitations
|
|
887
|
-
|
|
888
|
-
- When operating on a guild channel, the current user must have the `SEND_MESSAGES` permission.
|
|
889
|
-
- When sending a message with `tts` (text-to-speech) set to `true`, the current user must have the `SEND_TTS_MESSAGES` permission.
|
|
890
|
-
- When creating a message as a reply to another message, the current user must have the `READ_MESSAGE_HISTORY` permission.
|
|
891
|
-
- The referenced message must exist and cannot be a system message.
|
|
892
|
-
- The maximum request size when sending a message is **8MiB**
|
|
893
|
-
- For the embed object, 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.
|
|
894
|
-
|
|
895
|
-
> info
|
|
896
|
-
> Note that when sending a message, you must provide a value for at **least one of** `content`, `embeds`, or `files[n]`.
|
|
897
|
-
|
|
898
|
-
###### JSON/Form Params
|
|
899
|
-
|
|
900
|
-
| Field | Type | Description | Required |
|
|
901
|
-
| -------------------- | ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
|
|
902
|
-
| content | string | the message contents (up to 2000 characters) | one of content, file, embed(s), sticker_ids |
|
|
903
|
-
| tts | boolean | true if this is a TTS message | false |
|
|
904
|
-
| embeds | array of [embed](#DOCS_RESOURCES_CHANNEL/embed-object) objects | embedded `rich` content (up to 6000 characters) | one of content, file, embed(s), sticker_ids |
|
|
905
|
-
| embed *(deprecated)* | [embed](#DOCS_RESOURCES_CHANNEL/embed-object) object | embedded `rich` content, deprecated in favor of `embeds` | one of content, file, embed(s), sticker_ids |
|
|
906
|
-
| allowed_mentions | [allowed mention object](#DOCS_RESOURCES_CHANNEL/allowed-mentions-object) | allowed mentions for the message | false |
|
|
907
|
-
| message_reference | [message reference](#DOCS_RESOURCES_CHANNEL/message-reference-object-message-reference-structure) | include to make your message a reply | false |
|
|
908
|
-
| components | array of [message component](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object) objects | the components to include with the message | false |
|
|
909
|
-
| sticker_ids | array of snowflakes | IDs of up to 3 [stickers](#DOCS_RESOURCES_STICKER/sticker-object) in the server to send in the message | one of content, file, embed(s), sticker_ids |
|
|
910
|
-
| files[n] \* | file contents | the contents of the file being sent | one of content, file, embed(s), sticker_ids |
|
|
911
|
-
| payload_json \* | string | JSON encoded body of non-file params | `multipart/form-data` only |
|
|
912
|
-
| attachments \* | array of partial [attachment](#DOCS_RESOURCES_CHANNEL/attachment-object) objects | attachment objects with filename and description | false |
|
|
913
|
-
| 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 |
|
|
914
|
-
|
|
915
|
-
\* See [Uploading Files](#DOCS_REFERENCE/uploading-files) for details.
|
|
916
|
-
|
|
917
|
-
###### Example Request Body (application/json)
|
|
918
|
-
|
|
919
|
-
```json
|
|
920
|
-
{
|
|
921
|
-
"content": "Hello, World!",
|
|
922
|
-
"tts": false,
|
|
923
|
-
"embeds": [{
|
|
924
|
-
"title": "Hello, Embed!",
|
|
925
|
-
"description": "This is an embedded message."
|
|
926
|
-
}]
|
|
927
|
-
}
|
|
928
|
-
```
|
|
929
|
-
|
|
930
|
-
Examples for file uploads are available in [Uploading Files](#DOCS_REFERENCE/uploading-files).
|
|
931
|
-
|
|
932
|
-
## Crosspost Message % POST /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}/crosspost
|
|
933
|
-
|
|
934
|
-
Crosspost a message in a News Channel to following channels. This endpoint requires the 'SEND_MESSAGES' permission, if the current user sent the message, or additionally the 'MANAGE_MESSAGES' permission, for all other messages, to be present for the current user.
|
|
935
|
-
|
|
936
|
-
Returns a [message](#DOCS_RESOURCES_CHANNEL/message-object) object.
|
|
937
|
-
|
|
938
|
-
## Create Reaction % PUT /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}/reactions/{emoji#DOCS_RESOURCES_EMOJI/emoji-object}/@me
|
|
939
|
-
|
|
940
|
-
Create a reaction for the message. This endpoint requires the 'READ_MESSAGE_HISTORY' permission to be present on the current user. Additionally, if nobody else has reacted to the message using this emoji, this endpoint requires the 'ADD_REACTIONS' permission to be present on the current user. Returns a 204 empty response on success.
|
|
941
|
-
The `emoji` must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding) or the request will fail with `10014: Unknown Emoji`. To use custom emoji, you must encode it in the format `name:id` with the emoji name and emoji id.
|
|
942
|
-
|
|
943
|
-
## Delete Own Reaction % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}/reactions/{emoji#DOCS_RESOURCES_EMOJI/emoji-object}/@me
|
|
944
|
-
|
|
945
|
-
Delete a reaction the current user has made for the message. Returns a 204 empty response on success.
|
|
946
|
-
The `emoji` must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding) or the request will fail with `10014: Unknown Emoji`. To use custom emoji, you must encode it in the format `name:id` with the emoji name and emoji id.
|
|
947
|
-
|
|
948
|
-
## Delete User Reaction % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}/reactions/{emoji#DOCS_RESOURCES_EMOJI/emoji-object}/{user.id#DOCS_RESOURCES_USER/user-object}
|
|
949
|
-
|
|
950
|
-
Deletes another user's reaction. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the current user. Returns a 204 empty response on success.
|
|
951
|
-
The `emoji` must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding) or the request will fail with `10014: Unknown Emoji`. To use custom emoji, you must encode it in the format `name:id` with the emoji name and emoji id.
|
|
952
|
-
|
|
953
|
-
## Get Reactions % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}/reactions/{emoji#DOCS_RESOURCES_EMOJI/emoji-object}
|
|
954
|
-
|
|
955
|
-
Get a list of users that reacted with this emoji. Returns an array of [user](#DOCS_RESOURCES_USER/user-object) objects on success.
|
|
956
|
-
The `emoji` must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding) or the request will fail with `10014: Unknown Emoji`. To use custom emoji, you must encode it in the format `name:id` with the emoji name and emoji id.
|
|
957
|
-
|
|
958
|
-
###### Query String Params
|
|
959
|
-
|
|
960
|
-
| Field | Type | Description | Required | Default |
|
|
961
|
-
|--------|-----------|---------------------------------------|----------|---------|
|
|
962
|
-
| after | snowflake | get users after this user ID | false | absent |
|
|
963
|
-
| limit | integer | max number of users to return (1-100) | false | 25 |
|
|
964
|
-
|
|
965
|
-
## Delete All Reactions % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}/reactions
|
|
966
|
-
|
|
967
|
-
Deletes all reactions on a message. This endpoint requires the 'MANAGE_MESSAGES' permission to be present on the current user. Fires a [Message Reaction Remove All](#DOCS_TOPICS_GATEWAY/message-reaction-remove-all) Gateway event.
|
|
968
|
-
|
|
969
|
-
## Delete All Reactions for Emoji % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}/reactions/{emoji#DOCS_RESOURCES_EMOJI/emoji-object}
|
|
970
|
-
|
|
971
|
-
Deletes all the reactions for a given emoji on a message. This endpoint requires the `MANAGE_MESSAGES` permission to be present on the current user. Fires a [Message Reaction Remove Emoji](#DOCS_TOPICS_GATEWAY/message-reaction-remove-emoji) Gateway event.
|
|
972
|
-
The `emoji` must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding) or the request will fail with `10014: Unknown Emoji`. To use custom emoji, you must encode it in the format `name:id` with the emoji name and emoji id.
|
|
973
|
-
|
|
974
|
-
## Edit Message % PATCH /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}
|
|
975
|
-
|
|
976
|
-
Edit a previously sent message. The fields `content`, `embeds`, and `flags` can be edited by the original message author. Other users can only edit `flags` and only if they have the `MANAGE_MESSAGES` permission in the corresponding channel. When specifying flags, ensure to include all previously set flags/bits in addition to ones that you are modifying. Only `flags` documented in the table below may be modified by users (unsupported flag changes are currently ignored without error).
|
|
977
|
-
|
|
978
|
-
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.
|
|
979
|
-
|
|
980
|
-
Returns a [message](#DOCS_RESOURCES_CHANNEL/message-object) object. Fires a [Message Update](#DOCS_TOPICS_GATEWAY/message-update) Gateway event.
|
|
981
|
-
|
|
982
|
-
Refer to [Uploading Files](#DOCS_REFERENCE/uploading-files) for details on attachments and `multipart/form-data` requests.
|
|
983
|
-
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.
|
|
984
|
-
|
|
985
|
-
> warn
|
|
986
|
-
> 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.
|
|
987
|
-
|
|
988
|
-
> info
|
|
989
|
-
> All parameters to this endpoint are optional and nullable.
|
|
990
|
-
|
|
991
|
-
###### JSON/Form Params
|
|
992
|
-
|
|
993
|
-
| Field | Type | Description |
|
|
994
|
-
| -------------------- | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
|
|
995
|
-
| content | string | the message contents (up to 2000 characters) |
|
|
996
|
-
| embeds | array of [embed](#DOCS_RESOURCES_CHANNEL/embed-object) objects | embedded `rich` content (up to 6000 characters) |
|
|
997
|
-
| embed *(deprecated)* | [embed](#DOCS_RESOURCES_CHANNEL/embed-object) object | embedded `rich` content, deprecated in favor of `embeds` |
|
|
998
|
-
| flags | integer | edit the [flags](#DOCS_RESOURCES_CHANNEL/message-object-message-flags) of a message (only `SUPPRESS_EMBEDS` can currently be set/unset) |
|
|
999
|
-
| allowed_mentions | [allowed mention object](#DOCS_RESOURCES_CHANNEL/allowed-mentions-object) | allowed mentions for the message |
|
|
1000
|
-
| components | array of [message component](#DOCS_INTERACTIONS_MESSAGE_COMPONENTS/component-object) | the components to include with the message |
|
|
1001
|
-
| files[n] \* | file contents | the contents of the file being sent/edited |
|
|
1002
|
-
| payload_json \* | string | JSON encoded body of non-file params (multipart/form-data only) |
|
|
1003
|
-
| attachments \* | array of [attachment](#DOCS_RESOURCES_CHANNEL/attachment-object) objects | attached files to keep and possible descriptions for new files |
|
|
1004
|
-
|
|
1005
|
-
\* See [Uploading Files](#DOCS_REFERENCE/uploading-files) for details.
|
|
1006
|
-
|
|
1007
|
-
## Delete Message % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}
|
|
1008
|
-
|
|
1009
|
-
Delete a message. If operating on a guild channel and trying to delete a message that was not sent by the current user, this endpoint requires the `MANAGE_MESSAGES` permission. Returns a 204 empty response on success. Fires a [Message Delete](#DOCS_TOPICS_GATEWAY/message-delete) Gateway event.
|
|
1010
|
-
|
|
1011
|
-
> info
|
|
1012
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
1013
|
-
|
|
1014
|
-
## Bulk Delete Messages % POST /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/bulk-delete
|
|
1015
|
-
|
|
1016
|
-
Delete multiple messages in a single request. This endpoint can only be used on guild channels and requires the `MANAGE_MESSAGES` permission. Returns a 204 empty response on success. Fires a [Message Delete Bulk](#DOCS_TOPICS_GATEWAY/message-delete-bulk) Gateway event.
|
|
1017
|
-
|
|
1018
|
-
Any message IDs given that do not exist or are invalid will count towards the minimum and maximum message count (currently 2 and 100 respectively).
|
|
1019
|
-
|
|
1020
|
-
> warn
|
|
1021
|
-
> This endpoint will not delete messages older than 2 weeks, and will fail with a 400 BAD REQUEST if any message provided is older than that or if any duplicate message IDs are provided.
|
|
1022
|
-
|
|
1023
|
-
> info
|
|
1024
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
1025
|
-
|
|
1026
|
-
###### JSON Params
|
|
1027
|
-
|
|
1028
|
-
| Field | Type | Description |
|
|
1029
|
-
|----------|---------------------|-------------------------------------------|
|
|
1030
|
-
| messages | array of snowflakes | an array of message ids to delete (2-100) |
|
|
1031
|
-
|
|
1032
|
-
## Edit Channel Permissions % PUT /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/permissions/{overwrite.id#DOCS_RESOURCES_CHANNEL/overwrite-object}
|
|
1033
|
-
|
|
1034
|
-
Edit the channel permission overwrites for a user or role in a channel. Only usable for guild channels. Requires the `MANAGE_ROLES` permission. Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a `MANAGE_ROLES` overwrite in the channel). Returns a 204 empty response on success. For more information about permissions, see [permissions](#DOCS_TOPICS_PERMISSIONS/permissions).
|
|
1035
|
-
|
|
1036
|
-
> info
|
|
1037
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
1038
|
-
|
|
1039
|
-
###### JSON Params
|
|
1040
|
-
|
|
1041
|
-
| Field | Type | Description |
|
|
1042
|
-
|--------|---------|-----------------------------------------------------------------|
|
|
1043
|
-
| allow? | string? | the bitwise value of all allowed permissions (default `"0"`) |
|
|
1044
|
-
| deny? | string? | the bitwise value of all disallowed permissions (default `"0"`) |
|
|
1045
|
-
| type | integer | 0 for a role or 1 for a member |
|
|
1046
|
-
|
|
1047
|
-
## Get Channel Invites % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/invites
|
|
1048
|
-
|
|
1049
|
-
Returns a list of [invite](#DOCS_RESOURCES_INVITE/invite-object) objects (with [invite metadata](#DOCS_RESOURCES_INVITE/invite-metadata-object)) for the channel. Only usable for guild channels. Requires the `MANAGE_CHANNELS` permission.
|
|
1050
|
-
|
|
1051
|
-
## Create Channel Invite % POST /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/invites
|
|
1052
|
-
|
|
1053
|
-
Create a new [invite](#DOCS_RESOURCES_INVITE/invite-object) object for the channel. Only usable for guild channels. Requires the `CREATE_INSTANT_INVITE` permission. All JSON parameters for this route are optional, however the request body is not. If you are not sending any fields, you still have to send an empty JSON object (`{}`). Returns an [invite](#DOCS_RESOURCES_INVITE/invite-object) object. Fires an [Invite Create](#DOCS_TOPICS_GATEWAY/invite-create) Gateway event.
|
|
1054
|
-
|
|
1055
|
-
> info
|
|
1056
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
1057
|
-
|
|
1058
|
-
###### JSON Params
|
|
1059
|
-
|
|
1060
|
-
| Field | Type | Description | Default |
|
|
1061
|
-
|-----------------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------|------------------|
|
|
1062
|
-
| max_age | integer | duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days) | 86400 (24 hours) |
|
|
1063
|
-
| max_uses | integer | max number of uses or 0 for unlimited. between 0 and 100 | 0 |
|
|
1064
|
-
| temporary | boolean | whether this invite only grants temporary membership | false |
|
|
1065
|
-
| unique | boolean | if true, don't try to reuse a similar invite (useful for creating many unique one time use invites) | false |
|
|
1066
|
-
| target_type | integer | the [type of target](#DOCS_RESOURCES_INVITE/invite-object-invite-target-types) for this voice channel invite | |
|
|
1067
|
-
| target_user_id | snowflake | the id of the user whose stream to display for this invite, required if `target_type` is 1, the user must be streaming in the channel | |
|
|
1068
|
-
| target_application_id | snowflake | the id of the embedded application to open for this invite, required if `target_type` is 2, the application must have the `EMBEDDED` flag | |
|
|
1069
|
-
|
|
1070
|
-
## Delete Channel Permission % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/permissions/{overwrite.id#DOCS_RESOURCES_CHANNEL/overwrite-object}
|
|
1071
|
-
|
|
1072
|
-
Delete a channel permission overwrite for a user or role in a channel. Only usable for guild channels. Requires the `MANAGE_ROLES` permission. Returns a 204 empty response on success. For more information about permissions, see [permissions](#DOCS_TOPICS_PERMISSIONS/permissions)
|
|
1073
|
-
|
|
1074
|
-
> info
|
|
1075
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
1076
|
-
|
|
1077
|
-
## Follow News Channel % POST /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/followers
|
|
1078
|
-
|
|
1079
|
-
Follow a News Channel to send messages to a target channel. Requires the `MANAGE_WEBHOOKS` permission in the target channel. Returns a [followed channel](#DOCS_RESOURCES_CHANNEL/followed-channel-object) object.
|
|
1080
|
-
|
|
1081
|
-
###### JSON Params
|
|
1082
|
-
|
|
1083
|
-
| Field | Type | Description |
|
|
1084
|
-
|--------------------|-----------|----------------------|
|
|
1085
|
-
| webhook_channel_id | snowflake | id of target channel |
|
|
1086
|
-
|
|
1087
|
-
## Trigger Typing Indicator % POST /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/typing
|
|
1088
|
-
|
|
1089
|
-
Post a typing indicator for the specified channel. Generally bots should **not** implement this route. However, if a bot is responding to a command and expects the computation to take a few seconds, this endpoint may be called to let the user know that the bot is processing their message. Returns a 204 empty response on success. Fires a [Typing Start](#DOCS_TOPICS_GATEWAY/typing-start) Gateway event.
|
|
1090
|
-
|
|
1091
|
-
## Get Pinned Messages % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/pins
|
|
1092
|
-
|
|
1093
|
-
Returns all pinned messages in the channel as an array of [message](#DOCS_RESOURCES_CHANNEL/message-object) objects.
|
|
1094
|
-
|
|
1095
|
-
## Pin Message % PUT /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/pins/{message.id#DOCS_RESOURCES_CHANNEL/message-object}
|
|
1096
|
-
|
|
1097
|
-
Pin a message in a channel. Requires the `MANAGE_MESSAGES` permission. Returns a 204 empty response on success.
|
|
1098
|
-
|
|
1099
|
-
> warn
|
|
1100
|
-
> The max pinned messages is 50.
|
|
1101
|
-
|
|
1102
|
-
> info
|
|
1103
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
1104
|
-
|
|
1105
|
-
## Unpin Message % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/pins/{message.id#DOCS_RESOURCES_CHANNEL/message-object}
|
|
1106
|
-
|
|
1107
|
-
Unpin a message in a channel. Requires the `MANAGE_MESSAGES` permission. Returns a 204 empty response on success.
|
|
1108
|
-
|
|
1109
|
-
> info
|
|
1110
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
1111
|
-
|
|
1112
|
-
## Group DM Add Recipient % PUT /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/recipients/{user.id#DOCS_RESOURCES_USER/user-object}
|
|
1113
|
-
|
|
1114
|
-
Adds a recipient to a Group DM using their access token.
|
|
1115
|
-
|
|
1116
|
-
###### JSON Params
|
|
1117
|
-
|
|
1118
|
-
| Field | Type | Description |
|
|
1119
|
-
|--------------|--------|-----------------------------------------------------------------------|
|
|
1120
|
-
| access_token | string | access token of a user that has granted your app the `gdm.join` scope |
|
|
1121
|
-
| nick | string | nickname of the user being added |
|
|
1122
|
-
|
|
1123
|
-
## Group DM Remove Recipient % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/recipients/{user.id#DOCS_RESOURCES_USER/user-object}
|
|
1124
|
-
|
|
1125
|
-
Removes a recipient from a Group DM.
|
|
1126
|
-
|
|
1127
|
-
## Start Thread with Message % POST /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/messages/{message.id#DOCS_RESOURCES_CHANNEL/message-object}/threads
|
|
1128
|
-
|
|
1129
|
-
Creates a new thread from an existing message. Returns a [channel](#DOCS_RESOURCES_CHANNEL/channel-object) on success, and a 400 BAD REQUEST on invalid parameters. Fires a [Thread Create](#DOCS_TOPICS_GATEWAY/thread-create) Gateway event.
|
|
1130
|
-
|
|
1131
|
-
When called on a `GUILD_TEXT` channel, creates a `GUILD_PUBLIC_THREAD`. When called on a `GUILD_NEWS` channel, creates a `GUILD_NEWS_THREAD`. The id of the created thread will be the same as the id of the message, and as such a message can only have a single thread created from it.
|
|
1132
|
-
|
|
1133
|
-
> info
|
|
1134
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
1135
|
-
|
|
1136
|
-
###### JSON Params
|
|
1137
|
-
|
|
1138
|
-
| Field | Type | Description |
|
|
1139
|
-
|--------------------------|----------|---------------------------------------------------------------------------------------------------------------------|
|
|
1140
|
-
| name | string | 1-100 character channel name |
|
|
1141
|
-
| auto_archive_duration?\* | integer | duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 |
|
|
1142
|
-
| rate_limit_per_user? | ?integer | amount of seconds a user has to wait before sending another message (0-21600) |
|
|
1143
|
-
|
|
1144
|
-
\* The 3 day and 7 day archive durations require the server to be boosted. The [guild features](#DOCS_RESOURCES_GUILD/guild-object-guild-features) will indicate if a server is able to use those settings.
|
|
1145
|
-
|
|
1146
|
-
## Start Thread without Message % POST /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/threads
|
|
1147
|
-
|
|
1148
|
-
Creates a new thread that is not connected to an existing message. The created thread defaults to a `GUILD_PRIVATE_THREAD`\*. Returns a [channel](#DOCS_RESOURCES_CHANNEL/channel-object) on success, and a 400 BAD REQUEST on invalid parameters. Fires a [Thread Create](#DOCS_TOPICS_GATEWAY/thread-create) Gateway event.
|
|
1149
|
-
|
|
1150
|
-
> info
|
|
1151
|
-
> This endpoint supports the `X-Audit-Log-Reason` header.
|
|
1152
|
-
|
|
1153
|
-
###### JSON Params
|
|
1154
|
-
|
|
1155
|
-
| Field | Type | Description |
|
|
1156
|
-
|----------------------------|----------|---------------------------------------------------------------------------------------------------------------------|
|
|
1157
|
-
| name | string | 1-100 character channel name |
|
|
1158
|
-
| auto_archive_duration?\*\* | integer | duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080 |
|
|
1159
|
-
| type?\*\*\* | integer | the [type of thread](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) to create |
|
|
1160
|
-
| invitable? | boolean | whether non-moderators can add other non-moderators to a thread; only available when creating a private thread |
|
|
1161
|
-
| rate_limit_per_user? | ?integer | amount of seconds a user has to wait before sending another message (0-21600) |
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
\* Creating a private thread requires the server to be boosted. The [guild features](#DOCS_RESOURCES_GUILD/guild-object-guild-features) will indicate if that is possible for the guild.
|
|
1165
|
-
|
|
1166
|
-
\*\* The 3 day and 7 day archive durations require the server to be boosted. The [guild features](#DOCS_RESOURCES_GUILD/guild-object-guild-features) will indicate if that is possible for the guild.
|
|
1167
|
-
|
|
1168
|
-
\*\*\* In API v9, `type` defaults to `PRIVATE_THREAD` in order to match the behavior when thread documentation was first published. In API v10 this will be changed to be a required field, with no default.
|
|
1169
|
-
|
|
1170
|
-
## Join Thread % PUT /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/thread-members/@me
|
|
1171
|
-
|
|
1172
|
-
Adds the current user to a thread. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a [Thread Members Update](#DOCS_TOPICS_GATEWAY/thread-members-update) Gateway event.
|
|
1173
|
-
|
|
1174
|
-
## Add Thread Member % PUT /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/thread-members/{user.id#DOCS_RESOURCES_USER/user-object}
|
|
1175
|
-
|
|
1176
|
-
Adds another member to a thread. Requires the ability to send messages in the thread. Also requires the thread is not archived. Returns a 204 empty response if the member is successfully added or was already a member of the thread. Fires a [Thread Members Update](#DOCS_TOPICS_GATEWAY/thread-members-update) Gateway event.
|
|
1177
|
-
|
|
1178
|
-
## Leave Thread % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/thread-members/@me
|
|
1179
|
-
|
|
1180
|
-
Removes the current user from a thread. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a [Thread Members Update](#DOCS_TOPICS_GATEWAY/thread-members-update) Gateway event.
|
|
1181
|
-
|
|
1182
|
-
## Remove Thread Member % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/thread-members/{user.id#DOCS_RESOURCES_USER/user-object}
|
|
1183
|
-
|
|
1184
|
-
Removes another member from a thread. Requires the `MANAGE_THREADS` permission, or the creator of the thread if it is a `GUILD_PRIVATE_THREAD`. Also requires the thread is not archived. Returns a 204 empty response on success. Fires a [Thread Members Update](#DOCS_TOPICS_GATEWAY/thread-members-update) Gateway event.
|
|
1185
|
-
|
|
1186
|
-
## Get Thread Member % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/thread-members/{user.id#DOCS_RESOURCES_USER/user-object}
|
|
1187
|
-
|
|
1188
|
-
Returns a [thread member](#DOCS_RESOURCES_CHANNEL/thread-member-object) object for the specified user if they are a member of the thread, returns a 404 response otherwise.
|
|
1189
|
-
|
|
1190
|
-
## List Thread Members % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/thread-members
|
|
1191
|
-
|
|
1192
|
-
Returns array of [thread members](#DOCS_RESOURCES_CHANNEL/thread-member-object) objects that are members of the thread.
|
|
1193
|
-
|
|
1194
|
-
> warn
|
|
1195
|
-
> This endpoint is restricted according to whether the `GUILD_MEMBERS` [Privileged Intent](#DOCS_TOPICS_GATEWAY/privileged-intents) is enabled for your application.
|
|
1196
|
-
|
|
1197
|
-
## List Active Threads % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/threads/active
|
|
1198
|
-
|
|
1199
|
-
Returns all active threads in the channel, including public and private threads. Threads are ordered by their `id`, in descending order.
|
|
1200
|
-
|
|
1201
|
-
> warn
|
|
1202
|
-
> This route is deprecated and will be removed in v10. It is replaced by [List Active Guild Threads](#DOCS_RESOURCES_GUILD/list-active-threads).
|
|
1203
|
-
|
|
1204
|
-
###### Response Body
|
|
1205
|
-
|
|
1206
|
-
| Field | Type | Description |
|
|
1207
|
-
|----------|---------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
|
|
1208
|
-
| threads | array of [channel](#DOCS_RESOURCES_CHANNEL/channel-object) objects | the active threads |
|
|
1209
|
-
| members | array of [thread members](#DOCS_RESOURCES_CHANNEL/thread-member-object) objects | a thread member object for each returned thread the current user has joined |
|
|
1210
|
-
| has_more | boolean | whether there are potentially additional threads that could be returned on a subsequent call |
|
|
1211
|
-
|
|
1212
|
-
## List Public Archived Threads % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/threads/archived/public
|
|
1213
|
-
|
|
1214
|
-
Returns archived threads in the channel that are public. When called on a `GUILD_TEXT` channel, returns threads of [type](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) `GUILD_PUBLIC_THREAD`. When called on a `GUILD_NEWS` channel returns threads of [type](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) `GUILD_NEWS_THREAD`. Threads are ordered by `archive_timestamp`, in descending order. Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1215
|
-
|
|
1216
|
-
###### Query String Params
|
|
1217
|
-
|
|
1218
|
-
| Field | Type | Description |
|
|
1219
|
-
|---------|-------------------|----------------------------------------------|
|
|
1220
|
-
| before? | ISO8601 timestamp | returns threads before this timestamp |
|
|
1221
|
-
| limit? | integer | optional maximum number of threads to return |
|
|
1222
|
-
|
|
1223
|
-
###### Response Body
|
|
1224
|
-
|
|
1225
|
-
| Field | Type | Description |
|
|
1226
|
-
|----------|---------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
|
|
1227
|
-
| threads | array of [channel](#DOCS_RESOURCES_CHANNEL/channel-object) objects | the public, archived threads |
|
|
1228
|
-
| members | array of [thread members](#DOCS_RESOURCES_CHANNEL/thread-member-object) objects | a thread member object for each returned thread the current user has joined |
|
|
1229
|
-
| has_more | boolean | whether there are potentially additional threads that could be returned on a subsequent call |
|
|
1230
|
-
|
|
1231
|
-
## List Private Archived Threads % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/threads/archived/private
|
|
1232
|
-
|
|
1233
|
-
Returns archived threads in the channel that are of [type](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) `GUILD_PRIVATE_THREAD`. Threads are ordered by `archive_timestamp`, in descending order. Requires both the `READ_MESSAGE_HISTORY` and `MANAGE_THREADS` permissions.
|
|
1234
|
-
|
|
1235
|
-
###### Query String Params
|
|
1236
|
-
|
|
1237
|
-
| Field | Type | Description |
|
|
1238
|
-
|---------|-------------------|----------------------------------------------|
|
|
1239
|
-
| before? | ISO8601 timestamp | returns threads before this timestamp |
|
|
1240
|
-
| limit? | integer | optional maximum number of threads to return |
|
|
1241
|
-
|
|
1242
|
-
###### Response Body
|
|
1243
|
-
|
|
1244
|
-
| Field | Type | Description |
|
|
1245
|
-
|----------|---------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
|
|
1246
|
-
| threads | array of [channel](#DOCS_RESOURCES_CHANNEL/channel-object) objects | the private, archived threads |
|
|
1247
|
-
| members | array of [thread members](#DOCS_RESOURCES_CHANNEL/thread-member-object) objects | a thread member object for each returned thread the current user has joined |
|
|
1248
|
-
| has_more | boolean | whether there are potentially additional threads that could be returned on a subsequent call |
|
|
1249
|
-
|
|
1250
|
-
## List Joined Private Archived Threads % GET /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/users/@me/threads/archived/private
|
|
1251
|
-
|
|
1252
|
-
Returns archived threads in the channel that are of [type](#DOCS_RESOURCES_CHANNEL/channel-object-channel-types) `GUILD_PRIVATE_THREAD`, and the user has joined. Threads are ordered by their `id`, in descending order. Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1253
|
-
|
|
1254
|
-
###### Query String Params
|
|
1255
|
-
|
|
1256
|
-
| Field | Type | Description |
|
|
1257
|
-
|---------|-----------|----------------------------------------------|
|
|
1258
|
-
| before? | snowflake | returns threads before this id |
|
|
1259
|
-
| limit? | integer | optional maximum number of threads to return |
|
|
1260
|
-
|
|
1261
|
-
###### Response Body
|
|
1262
|
-
|
|
1263
|
-
| Field | Type | Description |
|
|
1264
|
-
|----------|---------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------|
|
|
1265
|
-
| threads | array of [channel](#DOCS_RESOURCES_CHANNEL/channel-object) objects | the private, archived threads the current user has joined |
|
|
1266
|
-
| members | array of [thread members](#DOCS_RESOURCES_CHANNEL/thread-member-object) objects | a thread member object for each returned thread the current user has joined |
|
|
1267
|
-
| has_more | boolean | whether there are potentially additional threads that could be returned on a subsequent call |
|