@discordjs/core 0.5.0-dev.1679918689-b8b852e.0 → 0.5.0

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/dist/index.d.ts CHANGED
@@ -1,1472 +1,10 @@
1
- import { REST, RawFile } from '@discordjs/rest';
2
- import * as discord_api_types_v10 from 'discord-api-types/v10';
3
- import { Snowflake, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, RESTPostAPIApplicationCommandsJSONBody, RESTPatchAPIApplicationCommandJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIGuildApplicationCommandsPermissionsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTGetAPIChannelWebhooksResult, RESTPostAPIGuildsJSONBody, RESTPatchAPIGuildJSONBody, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildChannelsResult, RESTPostAPIGuildChannelJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTGetAPIGuildBansResult, RESTPutAPIGuildBanJSONBody, RESTGetAPIGuildRolesResult, RESTPostAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleJSONBody, GuildMFALevel, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTPostAPIGuildPruneJSONBody, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildIntegrationsResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTGetAPIGuildVanityUrlResult, GuildWidgetStyle, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTGetAPIGuildEmojisResult, RESTPostAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiJSONBody, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTPostAPIGuildScheduledEventJSONBody, RESTGetAPIGuildScheduledEventQuery, RESTPatchAPIGuildScheduledEventJSONBody, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildTemplatesResult, RESTPatchAPIGuildTemplateJSONBody, RESTGetAPIGuildStickersResult, RESTPostAPIGuildStickerFormDataBody, RESTPatchAPIGuildStickerJSONBody, RESTGetAPIAuditLogQuery, RESTGetAPIAutoModerationRulesResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleJSONBody, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTPatchAPIGuildMemberJSONBody, RESTPostAPITemplateCreateGuildJSONBody, RESTGetAPIGuildWebhooksResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPostAPIChannelWebhookJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, APIInteractionResponseCallbackData, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTGetAPIInviteQuery, RESTOAuth2AuthorizationQuery, RESTPostOAuth2AccessTokenURLEncodedData, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2RefreshTokenURLEncodedData, RESTPostOAuth2ClientCredentialsURLEncodedData, RESTGetAPIOAuth2CurrentApplicationResult, RESTGetAPIOAuth2CurrentAuthorizationResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTGetNitroStickerPacksResult, RESTPostAPIChannelThreadsJSONBody, RESTPostAPIGuildForumThreadsJSONBody, APIThreadChannel, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, RESTGetAPICurrentUserConnectionsResult, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, GatewayDispatchEvents, GatewayAutoModerationActionExecutionDispatchData, GatewayAutoModerationRuleCreateDispatchData, GatewayAutoModerationRuleDeleteDispatchData, GatewayAutoModerationRuleUpdateDispatchData, GatewayChannelCreateDispatchData, GatewayChannelDeleteDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayChannelUpdateDispatchData, GatewayGuildAuditLogEntryCreateDispatchData, GatewayGuildBanAddDispatchData, GatewayGuildBanRemoveDispatchData, GatewayGuildCreateDispatchData, GatewayGuildDeleteDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberAddDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberUpdateDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleCreateDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildRoleUpdateDispatchData, GatewayGuildScheduledEventCreateDispatchData, GatewayGuildScheduledEventDeleteDispatchData, GatewayGuildScheduledEventUpdateDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildUpdateDispatchData, GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntegrationUpdateDispatchData, GatewayInteractionCreateDispatchData, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageCreateDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData, GatewayPresenceUpdateDispatchData, GatewayReadyDispatchData, GatewayStageInstanceCreateDispatchData, GatewayStageInstanceDeleteDispatchData, GatewayStageInstanceUpdateDispatchData, GatewayThreadCreateDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSyncDispatchData, GatewayThreadMemberUpdateDispatchData, GatewayThreadMembersUpdateDispatchData, GatewayThreadUpdateDispatchData, GatewayTypingStartDispatchData, GatewayUserUpdateDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GatewayRequestGuildMembersData, APIGuildMember, GatewayVoiceStateUpdateData, GatewayPresenceUpdateData } from 'discord-api-types/v10';
4
- export * from 'discord-api-types/v10';
5
- import { WebSocketManager } from '@discordjs/ws';
6
- import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
7
-
8
- declare class ApplicationCommandsAPI {
9
- private readonly rest;
10
- constructor(rest: REST);
11
- /**
12
- * Fetches all global commands for a application
13
- *
14
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
15
- * @param applicationId - The application id to fetch commands for
16
- * @param options - The options to use when fetching commands
17
- */
18
- getGlobalCommands(applicationId: Snowflake, options?: RESTGetAPIApplicationCommandsQuery): Promise<RESTGetAPIApplicationCommandsResult>;
19
- /**
20
- * Creates a new global command
21
- *
22
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
23
- * @param applicationId - The application id to create the command for
24
- * @param data - The data to use when creating the command
25
- */
26
- createGlobalCommand(applicationId: Snowflake, data: RESTPostAPIApplicationCommandsJSONBody): Promise<discord_api_types_v10.APIApplicationCommand>;
27
- /**
28
- * Fetches a global command
29
- *
30
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-command}
31
- * @param applicationId - The application id to fetch the command from
32
- * @param commandId - The command id to fetch
33
- */
34
- getGlobalCommand(applicationId: Snowflake, commandId: Snowflake): Promise<discord_api_types_v10.APIApplicationCommand>;
35
- /**
36
- * Edits a global command
37
- *
38
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
39
- * @param applicationId - The application id of the command
40
- * @param commandId - The id of the command to edit
41
- * @param data - The data to use when editing the command
42
- */
43
- editGlobalCommand(applicationId: Snowflake, commandId: Snowflake, data: RESTPatchAPIApplicationCommandJSONBody): Promise<discord_api_types_v10.APIApplicationCommand>;
44
- /**
45
- * Deletes a global command
46
- *
47
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
48
- * @param applicationId - The application id of the command
49
- * @param commandId - The id of the command to delete
50
- */
51
- deleteGlobalCommand(applicationId: Snowflake, commandId: Snowflake): Promise<void>;
52
- /**
53
- * Overwrites global commands
54
- *
55
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands}
56
- * @param applicationId - The application id to overwrite commands for
57
- * @param data - The data to use when overwriting commands
58
- */
59
- bulkOverwriteGlobalCommands(applicationId: Snowflake, data: RESTPutAPIApplicationCommandsJSONBody): Promise<RESTPutAPIApplicationCommandsResult>;
60
- /**
61
- * Fetches all commands for a guild
62
- *
63
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands}
64
- * @param applicationId - The application id to fetch commands for
65
- * @param guildId - The guild id to fetch commands for
66
- * @param data - The data to use when fetching commands
67
- */
68
- getGuildCommands(applicationId: Snowflake, guildId: Snowflake, data?: RESTGetAPIApplicationGuildCommandsQuery): Promise<RESTGetAPIApplicationCommandsResult>;
69
- /**
70
- * Creates a new command for a guild
71
- *
72
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
73
- * @param applicationId - The application id to create the command for
74
- * @param guildId - The guild id to create the command for
75
- * @param data - The data to use when creating the command
76
- */
77
- createGuildCommand(applicationId: Snowflake, guildId: Snowflake, data: RESTPostAPIApplicationCommandsJSONBody): Promise<discord_api_types_v10.APIApplicationCommand>;
78
- /**
79
- * Fetches a guild command
80
- *
81
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command}
82
- * @param applicationId - The application id to fetch the command from
83
- * @param guildId - The guild id to fetch the command from
84
- * @param commandId - The command id to fetch
85
- */
86
- getGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake): Promise<discord_api_types_v10.APIApplicationCommand>;
87
- /**
88
- * Edits a guild command
89
- *
90
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
91
- * @param applicationId - The application id of the command
92
- * @param guildId - The guild id of the command
93
- * @param commandId - The command id to edit
94
- * @param data - The data to use when editing the command
95
- */
96
- editGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, data: RESTPatchAPIApplicationCommandJSONBody): Promise<discord_api_types_v10.APIApplicationCommand>;
97
- /**
98
- * Deletes a guild command
99
- *
100
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
101
- * @param applicationId - The application id of the command
102
- * @param guildId - The guild id of the command
103
- * @param commandId - The id of the command to delete
104
- */
105
- deleteGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake): Promise<void>;
106
- /**
107
- * Bulk overwrites guild commands
108
- *
109
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands}
110
- * @param applicationId - The application id to overwrite commands for
111
- * @param guildId - The guild id to overwrite commands for
112
- * @param data - The data to use when overwriting commands
113
- */
114
- bulkOverwriteGuildCommands(applicationId: Snowflake, guildId: Snowflake, data: RESTPutAPIApplicationCommandsJSONBody): Promise<RESTPutAPIApplicationCommandsResult>;
115
- /**
116
- * Fetches the permissions for a guild command
117
- *
118
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
119
- * @param applicationId - The application id to get the permissions for
120
- * @param guildId - The guild id of the command
121
- * @param commandId - The command id to get the permissions for
122
- */
123
- getGuildCommandPermissions(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake): Promise<discord_api_types_v10.APIGuildApplicationCommandPermissions>;
124
- /**
125
- * Fetches all permissions for all commands in a guild
126
- *
127
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
128
- * @param applicationId - The application id to get the permissions for
129
- * @param guildId - The guild id to get the permissions for
130
- */
131
- getGuildCommandsPermissions(applicationId: Snowflake, guildId: Snowflake): Promise<RESTGetAPIGuildApplicationCommandsPermissionsResult>;
132
- /**
133
- * Edits the permissions for a guild command
134
- *
135
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
136
- * @param userToken - The token of the user to edit permissions on behalf of
137
- * @param applicationId - The application id to edit the permissions for
138
- * @param guildId - The guild id to edit the permissions for
139
- * @param commandId - The id of the command to edit the permissions for
140
- * @param data - The data to use when editing the permissions
141
- */
142
- editGuildCommandPermissions(userToken: string, applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, data: RESTPutAPIApplicationCommandPermissionsJSONBody): Promise<discord_api_types_v10.APIGuildApplicationCommandPermissions>;
143
- }
144
-
145
- declare class ChannelsAPI {
146
- private readonly rest;
147
- constructor(rest: REST);
148
- /**
149
- * Sends a message in a channel
150
- *
151
- * @see {@link https://discord.com/developers/docs/resources/channel#create-message}
152
- * @param channelId - The id of the channel to send the message in
153
- * @param data - The data to use when sending the message
154
- */
155
- createMessage(channelId: Snowflake, { files, ...body }: RESTPostAPIChannelMessageJSONBody & {
156
- files?: RawFile[];
157
- }): Promise<discord_api_types_v10.APIMessage>;
158
- /**
159
- * Edits a message
160
- *
161
- * @see {@link https://discord.com/developers/docs/resources/channel#edit-message}
162
- * @param channelId - The id of the channel the message is in
163
- * @param messageId - The id of the message to edit
164
- * @param data - The data to use when editing the message
165
- */
166
- editMessage(channelId: Snowflake, messageId: Snowflake, { files, ...body }: RESTPostAPIChannelMessageJSONBody & {
167
- files?: RawFile[];
168
- }): Promise<discord_api_types_v10.APIMessage>;
169
- /**
170
- * Fetches the reactions for a message
171
- *
172
- * @see {@link https://discord.com/developers/docs/resources/channel#get-reactions}
173
- * @param channelId - The id of the channel the message is in
174
- * @param messageId - The id of the message to get the reactions for
175
- * @param emoji - The emoji to get the reactions for
176
- * @param options - The options to use when fetching the reactions
177
- */
178
- getMessageReactions(channelId: Snowflake, messageId: Snowflake, emoji: string, options?: RESTGetAPIChannelMessageReactionUsersQuery): Promise<RESTGetAPIChannelMessageReactionUsersResult>;
179
- /**
180
- * Deletes a reaction for the current user
181
- *
182
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-own-reaction}
183
- * @param channelId - The id of the channel the message is in
184
- * @param messageId - The id of the message to delete the reaction for
185
- * @param emoji - The emoji to delete the reaction for
186
- */
187
- deleteOwnMessageReaction(channelId: Snowflake, messageId: Snowflake, emoji: string): Promise<void>;
188
- /**
189
- * Deletes a reaction for a user
190
- *
191
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-user-reaction}
192
- * @param channelId - The id of the channel the message is in
193
- * @param messageId - The id of the message to delete the reaction for
194
- * @param emoji - The emoji to delete the reaction for
195
- * @param userId - The id of the user to delete the reaction for
196
- */
197
- deleteUserMessageReaction(channelId: Snowflake, messageId: Snowflake, emoji: string, userId: Snowflake): Promise<void>;
198
- /**
199
- * Deletes all reactions for a message
200
- *
201
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions}
202
- * @param channelId - The id of the channel the message is in
203
- * @param messageId - The id of the message to delete the reactions for
204
- */
205
- deleteAllMessageReactions(channelId: Snowflake, messageId: Snowflake): Promise<void>;
206
- /**
207
- * Deletes all reactions of an emoji for a message
208
- *
209
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji}
210
- * @param channelId - The id of the channel the message is in
211
- * @param messageId - The id of the message to delete the reactions for
212
- * @param emoji - The emoji to delete the reactions for
213
- */
214
- deleteAllMessageReactionsForEmoji(channelId: Snowflake, messageId: Snowflake, emoji: string): Promise<void>;
215
- /**
216
- * Adds a reaction to a message
217
- *
218
- * @see {@link https://discord.com/developers/docs/resources/channel#create-reaction}
219
- * @param channelId - The id of the channel the message is in
220
- * @param messageId - The id of the message to add the reaction to
221
- * @param emoji - The emoji to add the reaction with
222
- */
223
- addMessageReaction(channelId: Snowflake, messageId: Snowflake, emoji: string): Promise<void>;
224
- /**
225
- * Fetches a channel
226
- *
227
- * @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
228
- * @param channelId - The id of the channel
229
- */
230
- get(channelId: Snowflake): Promise<discord_api_types_v10.APIChannel>;
231
- /**
232
- * Edits a channel
233
- *
234
- * @see {@link https://discord.com/developers/docs/resources/channel#modify-channel}
235
- * @param channelId - The id of the channel to edit
236
- * @param data - The new channel data
237
- */
238
- edit(channelId: Snowflake, data: RESTPatchAPIChannelJSONBody): Promise<discord_api_types_v10.APIChannel>;
239
- /**
240
- * Deletes a channel
241
- *
242
- * @see {@link https://discord.com/developers/docs/resources/channel#deleteclose-channel}
243
- * @param channelId - The id of the channel to delete
244
- */
245
- delete(channelId: Snowflake): Promise<discord_api_types_v10.APIChannel>;
246
- /**
247
- * Fetches the messages of a channel
248
- *
249
- * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-messages}
250
- * @param channelId - The id of the channel to fetch messages from
251
- * @param options - The options to use when fetching messages
252
- */
253
- getMessages(channelId: Snowflake, options?: RESTGetAPIChannelMessagesQuery): Promise<RESTGetAPIChannelMessagesResult>;
254
- /**
255
- * Shows a typing indicator in a channel
256
- *
257
- * @see {@link https://discord.com/developers/docs/resources/channel#trigger-typing-indicator}
258
- * @param channelId - The id of the channel to show the typing indicator in
259
- */
260
- showTyping(channelId: Snowflake): Promise<void>;
261
- /**
262
- * Fetches the pinned messages of a channel
263
- *
264
- * @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages}
265
- * @param channelId - The id of the channel to fetch pinned messages from
266
- */
267
- getPins(channelId: Snowflake): Promise<RESTGetAPIChannelPinsResult>;
268
- /**
269
- * Pins a message in a channel
270
- *
271
- * @see {@link https://discord.com/developers/docs/resources/channel#pin-message}
272
- * @param channelId - The id of the channel to pin the message in
273
- * @param messageId - The id of the message to pin
274
- * @param reason - The reason for pinning the message
275
- */
276
- pinMessage(channelId: Snowflake, messageId: Snowflake, reason?: string): Promise<void>;
277
- /**
278
- * Deletes a message
279
- *
280
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
281
- * @param channelId - The id of the channel the message is in
282
- * @param messageId - The id of the message to delete
283
- * @param reason - The reason for deleting the message
284
- */
285
- deleteMessage(channelId: Snowflake, messageId: Snowflake, reason?: string): Promise<void>;
286
- /**
287
- * Bulk deletes messages
288
- *
289
- * @see {@link https://discord.com/developers/docs/resources/channel#bulk-delete-messages}
290
- * @param channelId - The id of the channel the messages are in
291
- * @param messageIds - The ids of the messages to delete
292
- */
293
- bulkDeleteMessages(channelId: Snowflake, messageIds: Snowflake[], reason?: string): Promise<void>;
294
- /**
295
- * Fetches a message
296
- *
297
- * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-message}
298
- * @param channelId - The id of the channel the message is in
299
- * @param messageId - The id of the message to fetch
300
- */
301
- getMessage(channelId: Snowflake, messageId: Snowflake): Promise<discord_api_types_v10.APIMessage>;
302
- /**
303
- * Crossposts a message
304
- *
305
- * @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
306
- * @param channelId - The id of the channel the message is in
307
- * @param messageId - The id of the message to crosspost
308
- */
309
- crosspostMessage(channelId: Snowflake, messageId: Snowflake): Promise<discord_api_types_v10.APIMessage>;
310
- /**
311
- * Unpins a message in a channel
312
- *
313
- * @see {@link https://discord.com/developers/docs/resources/channel#unpin-message}
314
- * @param channelId - The id of the channel to unpin the message in
315
- * @param messageId - The id of the message to unpin
316
- * @param reason - The reason for unpinning the message
317
- */
318
- unpinMessage(channelId: Snowflake, messageId: Snowflake, reason?: string): Promise<void>;
319
- /**
320
- * Follows an announcement channel
321
- *
322
- * @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
323
- * @param channelId - The id of the announcement channel to follow
324
- * @param webhookChannelId - The id of the webhook channel to follow the announcements in
325
- */
326
- followAnnouncements(channelId: Snowflake, webhookChannelId: Snowflake): Promise<discord_api_types_v10.APIFollowedChannel>;
327
- /**
328
- * Creates a new invite for a channel
329
- *
330
- * @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
331
- * @param channelId - The id of the channel to create an invite for
332
- * @param data - The data to use when creating the invite
333
- */
334
- createInvite(channelId: Snowflake, data: RESTPostAPIChannelInviteJSONBody, reason?: string): Promise<discord_api_types_v10.APIExtendedInvite>;
335
- /**
336
- * Fetches the invites of a channel
337
- *
338
- * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-invites}
339
- * @param channelId - The id of the channel to fetch invites from
340
- */
341
- getInvites(channelId: Snowflake): Promise<RESTGetAPIChannelInvitesResult>;
342
- /**
343
- * Fetches the archived threads of a channel
344
- *
345
- * @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
346
- * @see {@link https://discord.com/developers/docs/resources/channel#list-private-archived-threads}
347
- * @param channelId - The id of the channel to fetch archived threads from
348
- * @param archivedStatus - The archived status of the threads to fetch
349
- * @param options - The options to use when fetching archived threads
350
- */
351
- getArchivedThreads(channelId: Snowflake, archivedStatus: 'private' | 'public', options?: RESTGetAPIChannelThreadsArchivedQuery): Promise<RESTGetAPIChannelUsersThreadsArchivedResult>;
352
- /**
353
- * Fetches the private joined archived threads of a channel
354
- *
355
- * @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
356
- * @param channelId - The id of the channel to fetch joined archived threads from
357
- * @param options - The options to use when fetching joined archived threads
358
- */
359
- getJoinedPrivateArchivedThreads(channelId: Snowflake, options?: RESTGetAPIChannelThreadsArchivedQuery): Promise<RESTGetAPIChannelUsersThreadsArchivedResult>;
360
- /**
361
- * Fetches the webhooks of a channel
362
- *
363
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-channel-webhooks}
364
- * @param id - The id of the channel
365
- */
366
- getWebhooks(id: Snowflake): Promise<RESTGetAPIChannelWebhooksResult>;
367
- }
368
-
369
- declare class GuildsAPI {
370
- private readonly rest;
371
- constructor(rest: REST);
372
- /**
373
- * Fetches a guild
374
- *
375
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
376
- * @param guildId - The id of the guild
377
- */
378
- get(guildId: string): Promise<discord_api_types_v10.APIGuild>;
379
- /**
380
- * Fetches a guild preview
381
- *
382
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-preview}
383
- * @param guildId - The id of the guild to fetch the preview from
384
- */
385
- getPreview(guildId: Snowflake): Promise<discord_api_types_v10.APIGuildPreview>;
386
- /**
387
- * Creates a guild
388
- *
389
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
390
- * @param data - The guild to create
391
- */
392
- create(data: RESTPostAPIGuildsJSONBody): Promise<discord_api_types_v10.APIGuild>;
393
- /**
394
- * Edits a guild
395
- *
396
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
397
- * @param guildId - The id of the guild to edit
398
- * @param data - The new guild data
399
- * @param reason - The reason for editing this guild
400
- */
401
- edit(guildId: Snowflake, data: RESTPatchAPIGuildJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuild>;
402
- /**
403
- * Deletes a guild
404
- *
405
- * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
406
- * @param guildId - The id of the guild to delete
407
- * @param reason - The reason for deleting this guild
408
- */
409
- delete(guildId: Snowflake, reason?: string): Promise<void>;
410
- /**
411
- * Fetches all the members of a guild
412
- *
413
- * @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
414
- * @param guildId - The id of the guild
415
- * @param options - The options to use when fetching the guild members
416
- */
417
- getMembers(guildId: Snowflake, options?: RESTGetAPIGuildMembersQuery): Promise<RESTGetAPIGuildMembersResult>;
418
- /**
419
- * Fetches a guild's channels
420
- *
421
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
422
- * @param guildId - The id of the guild to fetch the channels from
423
- */
424
- getChannels(guildId: Snowflake): Promise<RESTGetAPIGuildChannelsResult>;
425
- /**
426
- * Creates a guild channel
427
- *
428
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
429
- * @param guildId - The id of the guild to create the channel in
430
- * @param data - The data to create the new channel
431
- * @param reason - The reason for creating this channel
432
- */
433
- createChannel(guildId: Snowflake, data: RESTPostAPIGuildChannelJSONBody, reason?: string): Promise<discord_api_types_v10.APIChannel>;
434
- /**
435
- * Edits a guild channel's positions
436
- *
437
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions}
438
- * @param guildId - The id of the guild to edit the channel positions from
439
- * @param data - The data to edit the channel positions with
440
- * @param reason - The reason for editing the channel positions
441
- */
442
- setChannelPositions(guildId: Snowflake, data: RESTPatchAPIGuildChannelPositionsJSONBody, reason?: string): Promise<void>;
443
- /**
444
- * Fetches the active threads in a guild
445
- *
446
- * @see {@link https://discord.com/developers/docs/resources/guild#list-active-guild-threads}
447
- * @param guildId - The id of the guild to fetch the active threads from
448
- */
449
- getActiveThreads(guildId: Snowflake): Promise<discord_api_types_v10.APIThreadList>;
450
- /**
451
- * Fetches a guild member ban
452
- *
453
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
454
- * @param guildId - The id of the guild to fetch the ban from
455
- */
456
- getMemberBans(guildId: Snowflake): Promise<RESTGetAPIGuildBansResult>;
457
- /**
458
- * Bans a user from a guild
459
- *
460
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban}
461
- * @param guildId - The id of the guild to ban the member in
462
- * @param userId - The id of the user to ban
463
- * @param options - Options for banning the user
464
- * @param reason - The reason for banning the user
465
- */
466
- banUser(guildId: Snowflake, userId: Snowflake, options?: RESTPutAPIGuildBanJSONBody, reason?: string): Promise<void>;
467
- /**
468
- * Unbans a user from a guild
469
- *
470
- * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
471
- * @param guildId - The id of the guild to unban the member in
472
- * @param userId - The id of the user to unban
473
- * @param reason - The reason for unbanning the user
474
- */
475
- unbanUser(guildId: Snowflake, userId: Snowflake, reason?: string): Promise<void>;
476
- /**
477
- * Gets all the roles in a guild
478
- *
479
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-roles}
480
- * @param guildId - The id of the guild to fetch the roles from
481
- */
482
- getRoles(guildId: Snowflake): Promise<RESTGetAPIGuildRolesResult>;
483
- /**
484
- * Creates a guild role
485
- *
486
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-role}
487
- * @param guildId - The id of the guild to create the role in
488
- * @param data - The data to create the role with
489
- * @param reason - The reason for creating the role
490
- */
491
- createRole(guildId: Snowflake, data: RESTPostAPIGuildRoleJSONBody, reason?: string): Promise<discord_api_types_v10.APIRole>;
492
- /**
493
- * Sets role positions in a guild
494
- *
495
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role-positions}
496
- * @param guildId - The id of the guild to set role positions for
497
- * @param data - The data for setting a role position
498
- * @param reason - The reason for setting the role position
499
- */
500
- setRolePositions(guildId: Snowflake, data: RESTPatchAPIGuildRolePositionsJSONBody, reason?: string): Promise<RESTPatchAPIGuildRolePositionsResult>;
501
- /**
502
- * Edits a guild role
503
- *
504
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role}
505
- * @param guildId - The id of the guild to edit the role in
506
- * @param roleId - The id of the role to edit
507
- * @param data - data for editing the role
508
- * @param reason - The reason for editing the role
509
- */
510
- editRole(guildId: Snowflake, roleId: Snowflake, data: RESTPatchAPIGuildRoleJSONBody, reason?: string): Promise<discord_api_types_v10.APIRole>;
511
- /**
512
- * Deletes a guild role
513
- *
514
- * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-role}
515
- * @param guildId - The id of the guild to delete the role in
516
- * @param roleId - The id of the role to delete
517
- * @param reason - The reason for deleting the role
518
- */
519
- deleteRole(guildId: Snowflake, roleId: Snowflake, reason?: string): Promise<void>;
520
- /**
521
- * Edits the multi-factor-authentication (MFA) level of a guild
522
- *
523
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level}
524
- * @param guildId - The id of the guild to edit the MFA level for
525
- * @param level - The new MFA level
526
- * @param reason - The reason for editing the MFA level
527
- */
528
- editMFALevel(guildId: Snowflake, level: GuildMFALevel, reason?: string): Promise<discord_api_types_v10.RESTPostAPIGuildsMFAJSONBody>;
529
- /**
530
- * Fetch the number of members that can be pruned from a guild
531
- *
532
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-prune-count}
533
- * @param guildId - The id of the guild to fetch the number of pruned members from
534
- * @param options - The options for fetching the number of pruned members
535
- */
536
- getPruneCount(guildId: Snowflake, options?: RESTGetAPIGuildPruneCountQuery): Promise<RESTGetAPIGuildPruneCountResult>;
537
- /**
538
- * Prunes members in a guild
539
- *
540
- * @see {@link https://discord.com/developers/docs/resources/guild#begin-guild-prune}
541
- * @param guildId - The id of the guild to prune members in
542
- * @param options - The options for pruning members
543
- * @param reason - The reason for pruning members
544
- */
545
- beginPrune(guildId: Snowflake, options?: RESTPostAPIGuildPruneJSONBody, reason?: string): Promise<RESTGetAPIGuildPruneCountResult>;
546
- /**
547
- * Fetches voice regions for a guild
548
- *
549
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
550
- * @param guildId - The id of the guild to fetch the voice regions from
551
- */
552
- getVoiceRegions(guildId: Snowflake): Promise<RESTGetAPIGuildVoiceRegionsResult>;
553
- /**
554
- * Fetches the invites for a guild
555
- *
556
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-invites}
557
- * @param guildId - The id of the guild to fetch the invites from
558
- */
559
- getInvites(guildId: Snowflake): Promise<RESTGetAPIGuildInvitesResult>;
560
- /**
561
- * Fetches the integrations for a guild
562
- *
563
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-integrations}
564
- * @param guildId - The id of the guild to fetch the integrations from
565
- */
566
- getIntegrations(guildId: Snowflake): Promise<RESTGetAPIGuildIntegrationsResult>;
567
- /**
568
- * Deletes an integration from a guild
569
- *
570
- * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-integration}
571
- * @param guildId - The id of the guild to delete the integration from
572
- * @param integrationId - The id of the integration to delete
573
- * @param reason - The reason for deleting the integration
574
- */
575
- deleteIntegration(guildId: Snowflake, integrationId: Snowflake, reason?: string): Promise<void>;
576
- /**
577
- * Fetches the widget settings for a guild
578
- *
579
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget-settings}
580
- * @param guildId - The id of the guild to fetch the widget settings from
581
- */
582
- getWidgetSettings(guildId: Snowflake): Promise<ArrayBuffer>;
583
- /**
584
- * Edits the widget settings for a guild
585
- *
586
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-widget}
587
- * @param guildId - The id of the guild to edit the widget settings from
588
- * @param data - The new widget settings data
589
- * @param reason - The reason for editing the widget settings
590
- */
591
- editWidgetSettings(guildId: Snowflake, data: RESTPatchAPIGuildWidgetSettingsJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildWidgetSettings>;
592
- /**
593
- * Fetches the widget for a guild
594
- *
595
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget}
596
- * @param guildId - The id of the guild to fetch the widget from
597
- */
598
- getWidget(guildId: Snowflake): Promise<discord_api_types_v10.APIGuildWidget>;
599
- /**
600
- * Fetches the vanity url for a guild
601
- *
602
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
603
- * @param guildId - The id of the guild to fetch the vanity url from
604
- */
605
- getVanityURL(guildId: Snowflake): Promise<RESTGetAPIGuildVanityUrlResult>;
606
- /**
607
- * Fetches the widget image for a guild
608
- *
609
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget-image}
610
- * @param guildId - The id of the guild to fetch the widget image from
611
- * @param style - The style of the widget image
612
- */
613
- getWidgetImage(guildId: Snowflake, style?: GuildWidgetStyle): Promise<ArrayBuffer>;
614
- /**
615
- * Fetches the welcome screen for a guild
616
- *
617
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen}
618
- * @param guildId - The id of the guild to fetch the welcome screen from
619
- */
620
- getWelcomeScreen(guildId: Snowflake): Promise<discord_api_types_v10.APIGuildWelcomeScreen>;
621
- /**
622
- * Edits the welcome screen for a guild
623
- *
624
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen}
625
- * @param guildId - The id of the guild to edit the welcome screen for
626
- * @param data - The new welcome screen data
627
- * @param reason - The reason for editing the welcome screen
628
- */
629
- editWelcomeScreen(guildId: Snowflake, data?: RESTPatchAPIGuildWelcomeScreenJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildWelcomeScreen>;
630
- /**
631
- * Edits a user's voice state in a guild
632
- *
633
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-user-voice-state}
634
- * @param guildId - The id of the guild to edit the current user's voice state in
635
- * @param userId - The id of the user to edit the voice state for
636
- * @param data - The data for editing the voice state
637
- * @param reason - The reason for editing the voice state
638
- */
639
- editUserVoiceState(guildId: Snowflake, userId: Snowflake, data: RESTPatchAPIGuildVoiceStateUserJSONBody, reason?: string): Promise<void>;
640
- /**
641
- * Fetches all emojis for a guild
642
- *
643
- * @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
644
- * @param guildId - The id of the guild to fetch the emojis from
645
- */
646
- getEmojis(guildId: Snowflake): Promise<RESTGetAPIGuildEmojisResult>;
647
- /**
648
- * Fetches an emoji for a guild
649
- *
650
- * @see {@link https://discord.com/developers/docs/resources/emoji#get-guild-emoji}
651
- * @param guildId - The id of the guild to fetch the emoji from
652
- * @param emojiId - The id of the emoji to fetch
653
- */
654
- getEmoji(guildId: Snowflake, emojiId: Snowflake): Promise<discord_api_types_v10.APIEmoji>;
655
- /**
656
- * Creates a new emoji for a guild
657
- *
658
- * @see {@link https://discord.com/developers/docs/resources/emoji#create-guild-emoji}
659
- * @param guildId - The id of the guild to create the emoji from
660
- * @param data - The data for creating the emoji
661
- * @param reason - The reason for creating the emoji
662
- */
663
- createEmoji(guildId: Snowflake, data: RESTPostAPIGuildEmojiJSONBody, reason?: string): Promise<discord_api_types_v10.APIEmoji>;
664
- /**
665
- * Edits an emoji for a guild
666
- *
667
- * @see {@link https://discord.com/developers/docs/resources/emoji#modify-guild-emoji}
668
- * @param guildId - The id of the guild to edit the emoji from
669
- * @param emojiId - The id of the emoji to edit
670
- * @param data - The data for editing the emoji
671
- * @param reason - The reason for editing the emoji
672
- */
673
- editEmoji(guildId: Snowflake, emojiId: Snowflake, data: RESTPatchAPIGuildEmojiJSONBody, reason?: string): Promise<discord_api_types_v10.APIEmoji>;
674
- /**
675
- * Deletes an emoji for a guild
676
- *
677
- * @see {@link https://discord.com/developers/docs/resources/emoji#delete-guild-emoji}
678
- * @param guildId - The id of the guild to delete the emoji from
679
- * @param emojiId - The id of the emoji to delete
680
- * @param reason - The reason for deleting the emoji
681
- */
682
- deleteEmoji(guildId: Snowflake, emojiId: Snowflake, reason?: string): Promise<void>;
683
- /**
684
- * Fetches all scheduled events for a guild
685
- *
686
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild}
687
- * @param guildId - The id of the guild to fetch the scheduled events from
688
- * @param options - The options for fetching the scheduled events
689
- */
690
- getScheduledEvents(guildId: Snowflake, options?: RESTGetAPIGuildScheduledEventsQuery): Promise<RESTGetAPIGuildScheduledEventsResult>;
691
- /**
692
- * Creates a new scheduled event for a guild
693
- *
694
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event}
695
- * @param guildId - The id of the guild to create the scheduled event from
696
- * @param data - The data to create the event with
697
- * @param reason - The reason for creating the scheduled event
698
- */
699
- createScheduledEvent(guildId: Snowflake, data: RESTPostAPIGuildScheduledEventJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildScheduledEvent>;
700
- /**
701
- * Fetches a scheduled event for a guild
702
- *
703
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event}
704
- * @param guildId - The id of the guild to fetch the scheduled event from
705
- * @param eventId - The id of the scheduled event to fetch
706
- * @param options - The options for fetching the scheduled event
707
- */
708
- getScheduledEvent(guildId: Snowflake, eventId: Snowflake, options?: RESTGetAPIGuildScheduledEventQuery): Promise<discord_api_types_v10.APIGuildScheduledEvent>;
709
- /**
710
- * Edits a scheduled event for a guild
711
- *
712
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
713
- * @param guildId - The id of the guild to edit the scheduled event from
714
- * @param eventId - The id of the scheduled event to edit
715
- * @param data - The new event data
716
- * @param reason - The reason for editing the scheduled event
717
- */
718
- editScheduledEvent(guildId: Snowflake, eventId: Snowflake, data: RESTPatchAPIGuildScheduledEventJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildScheduledEvent>;
719
- /**
720
- * Deletes a scheduled event for a guild
721
- *
722
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
723
- * @param guildId - The id of the guild to delete the scheduled event from
724
- * @param eventId - The id of the scheduled event to delete
725
- * @param reason - The reason for deleting the scheduled event
726
- */
727
- deleteScheduledEvent(guildId: Snowflake, eventId: Snowflake, reason?: string): Promise<void>;
728
- /**
729
- * Gets all users that are interested in a scheduled event
730
- *
731
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users}
732
- * @param guildId - The id of the guild to fetch the scheduled event users from
733
- * @param eventId - The id of the scheduled event to fetch the users for
734
- * @param options - The options for fetching the scheduled event users
735
- */
736
- getScheduledEventUsers(guildId: Snowflake, eventId: Snowflake, options?: RESTGetAPIGuildScheduledEventUsersQuery): Promise<RESTGetAPIGuildScheduledEventUsersResult>;
737
- /**
738
- * Fetches all the templates for a guild
739
- *
740
- * @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
741
- * @param guildId - The id of the guild to fetch the templates from
742
- */
743
- getTemplates(guildId: Snowflake): Promise<RESTGetAPIGuildTemplatesResult>;
744
- /**
745
- * Syncs a template for a guild
746
- *
747
- * @see {@link https://discord.com/developers/docs/resources/guild-template#sync-guild-template}
748
- * @param guildId - The id of the guild to sync the template from
749
- * @param templateCode - The code of the template to sync
750
- */
751
- syncTemplate(guildId: Snowflake, templateCode: string): Promise<discord_api_types_v10.APITemplate>;
752
- /**
753
- * Edits a template for a guild
754
- *
755
- * @see {@link https://discord.com/developers/docs/resources/guild-template#modify-guild-template}
756
- * @param guildId - The id of the guild to edit the template from
757
- * @param templateCode - The code of the template to edit
758
- * @param data - The data for editing the template
759
- */
760
- editTemplate(guildId: Snowflake, templateCode: string, data: RESTPatchAPIGuildTemplateJSONBody): Promise<discord_api_types_v10.APITemplate>;
761
- /**
762
- * Deletes a template for a guild
763
- *
764
- * @see {@link https://discord.com/developers/docs/resources/guild-template#delete-guild-template}
765
- * @param guildId - The id of the guild to delete the template from
766
- * @param templateCode - The code of the template to delete
767
- */
768
- deleteTemplate(guildId: Snowflake, templateCode: string): Promise<void>;
769
- /**
770
- * Fetches all the stickers for a guild
771
- *
772
- * @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
773
- * @param guildId - The id of the guild to fetch the stickers from
774
- */
775
- getStickers(guildId: Snowflake): Promise<RESTGetAPIGuildStickersResult>;
776
- /**
777
- * Fetches a sticker for a guild
778
- *
779
- * @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
780
- * @param guildId - The id of the guild to fetch the sticker from
781
- * @param stickerId - The id of the sticker to fetch
782
- */
783
- getSticker(guildId: Snowflake, stickerId: Snowflake): Promise<discord_api_types_v10.APISticker>;
784
- /**
785
- * Creates a sticker for a guild
786
- *
787
- * @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
788
- * @param guildId - The id of the guild to create the sticker for
789
- * @param data - The data for creating the sticker
790
- * @param reason - The reason for creating the sticker
791
- */
792
- createSticker(guildId: Snowflake, { file, ...body }: Omit<RESTPostAPIGuildStickerFormDataBody, 'file'> & {
793
- file: RawFile;
794
- }, reason?: string): Promise<discord_api_types_v10.APISticker>;
795
- /**
796
- * Edits a sticker for a guild
797
- *
798
- * @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
799
- * @param guildId - The id of the guild to edit the sticker from
800
- * @param stickerId - The id of the sticker to edit
801
- * @param data - The data for editing the sticker
802
- * @param reason - The reason for editing the sticker
803
- */
804
- editSticker(guildId: Snowflake, stickerId: Snowflake, data: RESTPatchAPIGuildStickerJSONBody, reason?: string): Promise<discord_api_types_v10.APISticker>;
805
- /**
806
- * Deletes a sticker for a guild
807
- *
808
- * @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
809
- * @param guildId - The id of the guild to delete the sticker from
810
- * @param stickerId - The id of the sticker to delete
811
- * @param reason - The reason for deleting the sticker
812
- */
813
- deleteSticker(guildId: Snowflake, stickerId: Snowflake, reason?: string): Promise<void>;
814
- /**
815
- * Fetches the audit logs for a guild
816
- *
817
- * @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
818
- * @param guildId - The id of the guild to fetch the audit logs from
819
- * @param options - The options for fetching the audit logs
820
- */
821
- getAuditLogs(guildId: Snowflake, options?: RESTGetAPIAuditLogQuery): Promise<discord_api_types_v10.APIAuditLog>;
822
- /**
823
- * Fetches all auto moderation rules for a guild
824
- *
825
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
826
- * @param guildId - The id of the guild to fetch the auto moderation rules from
827
- */
828
- getAutoModerationRules(guildId: Snowflake): Promise<RESTGetAPIAutoModerationRulesResult>;
829
- /**
830
- * Fetches an auto moderation rule for a guild
831
- *
832
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule}
833
- * @param guildId - The id of the guild to fetch the auto moderation rule from
834
- * @param ruleId - The id of the auto moderation rule to fetch
835
- */
836
- getAutoModerationRule(guildId: Snowflake, ruleId: Snowflake): Promise<discord_api_types_v10.APIAutoModerationRule>;
837
- /**
838
- * Creates a new auto moderation rule for a guild
839
- *
840
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule}
841
- * @param guildId - The id of the guild to create the auto moderation rule from
842
- * @param data - The data for creating the auto moderation rule
843
- */
844
- createAutoModerationRule(guildId: Snowflake, data: RESTPostAPIAutoModerationRuleJSONBody, reason?: string): Promise<discord_api_types_v10.APIAutoModerationRule>;
845
- /**
846
- * Edits an auto moderation rule for a guild
847
- *
848
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule}
849
- * @param guildId - The id of the guild to edit the auto moderation rule from
850
- * @param ruleId - The id of the auto moderation rule to edit
851
- * @param data - The data for editing the auto moderation rule
852
- * @param reason - The reason for editing the auto moderation rule
853
- */
854
- editAutoModerationRule(guildId: Snowflake, ruleId: Snowflake, data: RESTPatchAPIAutoModerationRuleJSONBody, reason?: string): Promise<RESTPatchAPIAutoModerationRuleJSONBody>;
855
- /**
856
- * Deletes an auto moderation rule for a guild
857
- *
858
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule}
859
- * @param guildId - The id of the guild to delete the auto moderation rule from
860
- * @param ruleId - The id of the auto moderation rule to delete
861
- * @param reason - The reason for deleting the auto moderation rule
862
- */
863
- deleteAutoModerationRule(guildId: Snowflake, ruleId: Snowflake, reason?: string): Promise<void>;
864
- /**
865
- * Fetches a guild member
866
- *
867
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
868
- * @param guildId - The id of the guild
869
- * @param userId - The id of the user
870
- */
871
- getMember(guildId: Snowflake, userId: Snowflake): Promise<discord_api_types_v10.APIGuildMember>;
872
- /**
873
- * Searches for guild members
874
- *
875
- * @see {@link https://discord.com/developers/docs/resources/guild#search-guild-members}
876
- * @param guildId - The id of the guild to search in
877
- * @param query - The query to search for
878
- * @param limit - The maximum number of members to return
879
- */
880
- searchForMembers(guildId: Snowflake, options: RESTGetAPIGuildMembersSearchQuery): Promise<RESTGetAPIGuildMembersSearchResult>;
881
- /**
882
- * Edits a guild member
883
- *
884
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-member}
885
- * @param guildId - The id of the guild
886
- * @param userId - The id of the user
887
- * @param data - The data to use when editing the guild member
888
- * @param reason - The reason for editing this guild member
889
- */
890
- editMember(guildId: Snowflake, userId: Snowflake, data?: RESTPatchAPIGuildMemberJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildMember>;
891
- /**
892
- * Adds a role to a guild member
893
- *
894
- * @see {@link https://discord.com/developers/docs/resources/guild#add-guild-member-role}
895
- * @param guildId - The id of the guild
896
- * @param userId - The id of the user
897
- * @param roleId - The id of the role
898
- * @param reason - The reason for adding this role to the guild member
899
- */
900
- addRoleToMember(guildId: Snowflake, userId: Snowflake, roleId: Snowflake, reason?: string): Promise<void>;
901
- /**
902
- * Removes a role from a guild member
903
- *
904
- * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member-role}
905
- * @param guildId - The id of the guild
906
- * @param userId - The id of the user
907
- * @param roleId - The id of the role
908
- * @param reason - The reason for removing this role from the guild member
909
- */
910
- removeRoleFromMember(guildId: Snowflake, userId: Snowflake, roleId: Snowflake, reason?: string): Promise<void>;
911
- /**
912
- * Fetches a guild template
913
- *
914
- * @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-template}
915
- * @param templateCode - The code of the template
916
- */
917
- getTemplate(templateCode: string): Promise<discord_api_types_v10.APITemplate>;
918
- /**
919
- * Creates a new template
920
- *
921
- * @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
922
- * @param templateCode - The code of the template
923
- * @param data - The data to use when creating the template
924
- */
925
- createTemplate(templateCode: string, data: RESTPostAPITemplateCreateGuildJSONBody): Promise<discord_api_types_v10.APITemplate>;
926
- /**
927
- * Fetches webhooks for a guild
928
- *
929
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
930
- * @param id - The id of the guild
931
- */
932
- getWebhooks(id: Snowflake): Promise<RESTGetAPIGuildWebhooksResult>;
933
- /**
934
- * Sets the voice state for the current user
935
- *
936
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
937
- * @param guildId - The id of the guild
938
- * @param options - The options to use when setting the voice state
939
- */
940
- setVoiceState(guildId: Snowflake, options?: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody): Promise<never>;
941
- }
942
-
943
- declare class WebhooksAPI {
944
- private readonly rest;
945
- constructor(rest: REST);
946
- /**
947
- * Fetches a webhook
948
- *
949
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
950
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
951
- * @param id - The id of the webhook
952
- * @param token - The token of the webhook
953
- */
954
- get(id: Snowflake, token?: string): Promise<discord_api_types_v10.APIWebhook>;
955
- /**
956
- * Creates a new webhook
957
- *
958
- * @see {@link https://discord.com/developers/docs/resources/webhook#create-webhook}
959
- * @param channelId - The id of the channel to create the webhook in
960
- * @param data - The data to use when creating the webhook
961
- * @param reason - The reason for creating the webhook
962
- */
963
- create(channelId: Snowflake, data: RESTPostAPIChannelWebhookJSONBody, reason?: string): Promise<never>;
964
- /**
965
- * Edits a webhook
966
- *
967
- * @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook}
968
- * @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
969
- * @param id - The id of the webhook to edit
970
- * @param webhook - The new webhook data
971
- * @param options - The options to use when editing the webhook
972
- */
973
- edit(id: Snowflake, webhook: RESTPatchAPIWebhookJSONBody, { token, reason }?: {
974
- reason?: string;
975
- token?: string;
976
- }): Promise<discord_api_types_v10.APIWebhook>;
977
- /**
978
- * Deletes a webhook
979
- *
980
- * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
981
- * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token}
982
- * @param id - The id of the webhook to delete
983
- * @param options - The options to use when deleting the webhook
984
- */
985
- delete(id: Snowflake, { token, reason }?: {
986
- reason?: string;
987
- token?: string;
988
- }): Promise<void>;
989
- /**
990
- * Executes a webhook and returns the created message
991
- *
992
- * @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
993
- * @param id - The id of the webhook
994
- * @param token - The token of the webhook
995
- * @param data - The data to use when executing the webhook
996
- */
997
- execute(id: Snowflake, token: string, data: RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & {
998
- files?: RawFile[];
999
- wait: true;
1000
- }): Promise<RESTPostAPIWebhookWithTokenWaitResult>;
1001
- /**
1002
- * Executes a webhook
1003
- *
1004
- * @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
1005
- * @param id - The id of the webhook
1006
- * @param token - The token of the webhook
1007
- * @param data - The data to use when executing the webhook
1008
- */
1009
- execute(id: Snowflake, token: string, data: RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & {
1010
- files?: RawFile[];
1011
- wait?: false;
1012
- }): Promise<void>;
1013
- /**
1014
- * Executes a slack webhook
1015
- *
1016
- * @see {@link https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook}
1017
- * @param id - The id of the webhook
1018
- * @param token - The token of the webhook
1019
- * @param options - The options to use when executing the webhook
1020
- */
1021
- executeSlack(id: Snowflake, token: string, body: unknown, options?: RESTPostAPIWebhookWithTokenSlackQuery): Promise<void>;
1022
- /**
1023
- * Executes a github webhook
1024
- *
1025
- * @see {@link https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook}
1026
- * @param id - The id of the webhook
1027
- * @param token - The token of the webhook
1028
- * @param options - The options to use when executing the webhook
1029
- */
1030
- executeGitHub(id: Snowflake, token: string, body: unknown, options?: RESTPostAPIWebhookWithTokenGitHubQuery): Promise<void>;
1031
- /**
1032
- * Fetches an associated message from a webhook
1033
- *
1034
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-message}
1035
- * @param id - The id of the webhook
1036
- * @param token - The token of the webhook
1037
- * @param messageId - The id of the message to fetch
1038
- * @param options - The options to use when fetching the message
1039
- */
1040
- getMessage(id: Snowflake, token: string, messageId: Snowflake, options?: {
1041
- thread_id?: string;
1042
- }): Promise<discord_api_types_v10.APIMessage>;
1043
- /**
1044
- * Edits an associated message from a webhook
1045
- *
1046
- * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
1047
- * @param id - The id of the webhook
1048
- * @param token - The token of the webhook
1049
- * @param messageId - The id of the message to edit
1050
- * @param data - The data to use when editing the message
1051
- */
1052
- editMessage(id: Snowflake, token: string, messageId: Snowflake, { thread_id, ...body }: RESTPatchAPIWebhookWithTokenMessageJSONBody & {
1053
- thread_id?: string;
1054
- }): Promise<discord_api_types_v10.APIMessage>;
1055
- /**
1056
- * Deletes an associated message from a webhook
1057
- *
1058
- * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-message}
1059
- * @param id - The id of the webhook
1060
- * @param token - The token of the webhook
1061
- * @param messageId - The id of the message to delete
1062
- * @param options - The options to use when deleting the message
1063
- */
1064
- deleteMessage(id: Snowflake, token: string, messageId: Snowflake, options?: {
1065
- thread_id?: string;
1066
- }): Promise<void>;
1067
- }
1068
-
1069
- declare class InteractionsAPI {
1070
- private readonly rest;
1071
- private readonly webhooks;
1072
- constructor(rest: REST, webhooks: WebhooksAPI);
1073
- /**
1074
- * Replies to an interaction
1075
- *
1076
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1077
- * @param interactionId - The id of the interaction
1078
- * @param interactionToken - The token of the interaction
1079
- * @param data - The data to use when replying
1080
- */
1081
- reply(interactionId: Snowflake, interactionToken: string, { files, ...data }: APIInteractionResponseCallbackData & {
1082
- files?: RawFile[];
1083
- }): Promise<void>;
1084
- /**
1085
- * Defers the reply to an interaction
1086
- *
1087
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1088
- * @param interactionId - The id of the interaction
1089
- * @param interactionToken - The token of the interaction
1090
- */
1091
- defer(interactionId: Snowflake, interactionToken: string): Promise<void>;
1092
- /**
1093
- * Defers an update from a message component interaction
1094
- *
1095
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1096
- * @param interactionId - The id of the interaction
1097
- * @param interactionToken - The token of the interaction
1098
- */
1099
- deferMessageUpdate(interactionId: Snowflake, interactionToken: string): Promise<void>;
1100
- /**
1101
- * Reply to a deferred interaction
1102
- *
1103
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message}
1104
- * @param applicationId - The application id of the interaction
1105
- * @param interactionToken - The token of the interaction
1106
- * @param data - The data to use when replying
1107
- */
1108
- followUp(applicationId: Snowflake, interactionToken: string, data: APIInteractionResponseCallbackData & {
1109
- files?: RawFile[];
1110
- }): Promise<void>;
1111
- /**
1112
- * Edits the initial reply to an interaction
1113
- *
1114
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response}
1115
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message}
1116
- * @param applicationId - The application id of the interaction
1117
- * @param interactionToken - The token of the interaction
1118
- * @param data - The data to use when editing the reply
1119
- * @param messageId - The id of the message to edit. If omitted, the original reply will be edited
1120
- */
1121
- editReply(applicationId: Snowflake, interactionToken: string, data: APIInteractionResponseCallbackData & {
1122
- files?: RawFile[];
1123
- }, messageId?: Snowflake | '@original'): Promise<discord_api_types_v10.APIMessage>;
1124
- /**
1125
- * Fetches the initial reply to an interaction
1126
- *
1127
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
1128
- * @param applicationId - The application id of the interaction
1129
- * @param interactionToken - The token of the interaction
1130
- */
1131
- getOriginalReply(applicationId: Snowflake, interactionToken: string): Promise<discord_api_types_v10.APIMessage>;
1132
- /**
1133
- * Deletes the initial reply to an interaction
1134
- *
1135
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
1136
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message}
1137
- * @param applicationId - The application id of the interaction
1138
- * @param interactionToken - The token of the interaction
1139
- * @param messageId - The id of the message to delete. If omitted, the original reply will be deleted
1140
- */
1141
- deleteReply(applicationId: Snowflake, interactionToken: string, messageId?: Snowflake | '@original'): Promise<void>;
1142
- /**
1143
- * Updates the the message the component interaction was triggered on
1144
- *
1145
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1146
- * @param interactionId - The id of the interaction
1147
- * @param interactionToken - The token of the interaction
1148
- * @param data - The data to use when updating the interaction
1149
- */
1150
- updateMessage(interactionId: Snowflake, interactionToken: string, { files, ...data }: APIInteractionResponseCallbackData & {
1151
- files?: RawFile[];
1152
- }): Promise<void>;
1153
- /**
1154
- * Sends an autocomplete response to an interaction
1155
- *
1156
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1157
- * @param interactionId - The id of the interaction
1158
- * @param interactionToken - The token of the interaction
1159
- * @param data - Data for the autocomplete response
1160
- */
1161
- createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, data: APICommandAutocompleteInteractionResponseCallbackData): Promise<void>;
1162
- /**
1163
- * Sends a modal response to an interaction
1164
- *
1165
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1166
- * @param interactionId - The id of the interaction
1167
- * @param interactionToken - The token of the interaction
1168
- * @param data - The modal to send
1169
- */
1170
- createModal(interactionId: Snowflake, interactionToken: string, data: APIModalInteractionResponseCallbackData): Promise<void>;
1171
- }
1172
-
1173
- declare class InvitesAPI {
1174
- private readonly rest;
1175
- constructor(rest: REST);
1176
- /**
1177
- * Fetches an invite
1178
- *
1179
- * @see {@link https://discord.com/developers/docs/resources/invite#get-invite}
1180
- * @param code - The invite code
1181
- */
1182
- get(code: string, options?: RESTGetAPIInviteQuery): Promise<discord_api_types_v10.APIInvite>;
1183
- /**
1184
- * Deletes an invite
1185
- *
1186
- * @see {@link https://discord.com/developers/docs/resources/invite#delete-invite}
1187
- * @param code - The invite code
1188
- * @param reason - The reason for deleting the invite
1189
- */
1190
- delete(code: string, reason?: string): Promise<void>;
1191
- }
1192
-
1193
- declare class OAuth2API {
1194
- private readonly rest;
1195
- constructor(rest: REST);
1196
- /**
1197
- * Creates an OAuth2 authorization URL given the options
1198
- *
1199
- * @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-authorization-url-example}
1200
- * @param options - The options for creating the authorization URL
1201
- */
1202
- generateAuthorizationURL(options: RESTOAuth2AuthorizationQuery): string;
1203
- /**
1204
- * Performs an OAuth2 token exchange, giving you an access token
1205
- *
1206
- * @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-exchange-example}
1207
- * @param options - The options for the token exchange request
1208
- */
1209
- tokenExchange(options: RESTPostOAuth2AccessTokenURLEncodedData): Promise<RESTPostOAuth2AccessTokenResult>;
1210
- /**
1211
- * Refreshes an OAuth2 access token, giving you a new one
1212
- *
1213
- * @see {@link https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-refresh-token-exchange-example}
1214
- * @param options - The options for the refresh token request
1215
- */
1216
- refreshToken(options: RESTPostOAuth2RefreshTokenURLEncodedData): Promise<RESTPostOAuth2AccessTokenResult>;
1217
- /**
1218
- * Fetches the bearer token for the current application
1219
- *
1220
- * @remarks
1221
- * This is primarily used for testing purposes
1222
- * @see {@link https://discord.com/developers/docs/topics/oauth2#client-credentials-grant}
1223
- * @param options - The options for the client credentials grant request
1224
- */
1225
- getToken(options: RESTPostOAuth2ClientCredentialsURLEncodedData): Promise<discord_api_types_v10.RESTOAuth2ImplicitAuthorizationURLFragmentResult>;
1226
- /**
1227
- * Fetches the current bot's application information
1228
- *
1229
- * @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information}
1230
- */
1231
- getCurrentBotApplicationInformation(): Promise<RESTGetAPIOAuth2CurrentApplicationResult>;
1232
- /**
1233
- * Fetches the current authorization information
1234
- *
1235
- * @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information}
1236
- */
1237
- getCurrentAuthorizationInformation(): Promise<RESTGetAPIOAuth2CurrentAuthorizationResult>;
1238
- }
1239
-
1240
- declare class RoleConnectionsAPI {
1241
- private readonly rest;
1242
- constructor(rest: REST);
1243
- /**
1244
- * Gets the role connection metadata records for the application
1245
- *
1246
- * @see {@link https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records}
1247
- * @param applicationId - The id of the application to get role connection metadata records for
1248
- */
1249
- getMetadataRecords(applicationId: Snowflake): Promise<RESTGetAPIApplicationRoleConnectionMetadataResult>;
1250
- /**
1251
- * Updates the role connection metadata records for the application
1252
- *
1253
- * @see {@link https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records}
1254
- * @param applicationId - The id of the application to update role connection metadata records for
1255
- * @param options - The new role connection metadata records
1256
- */
1257
- updateMetadataRecords(applicationId: Snowflake, options: RESTPutAPIApplicationCommandPermissionsJSONBody): Promise<RESTPutAPIApplicationRoleConnectionMetadataResult>;
1258
- }
1259
-
1260
- declare class StickersAPI {
1261
- private readonly rest;
1262
- constructor(rest: REST);
1263
- /**
1264
- * Fetches all of the nitro sticker packs
1265
- *
1266
- * @see {@link https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs}
1267
- */
1268
- getNitroStickers(): Promise<RESTGetNitroStickerPacksResult>;
1269
- /**
1270
- * Fetches a sticker
1271
- *
1272
- * @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
1273
- * @param stickerId - The id of the sticker
1274
- */
1275
- get(stickerId: Snowflake): Promise<discord_api_types_v10.APISticker>;
1276
- }
1277
-
1278
- interface StartThreadOptions extends RESTPostAPIChannelThreadsJSONBody {
1279
- message_id?: string;
1280
- }
1281
- interface StartForumThreadOptions extends RESTPostAPIGuildForumThreadsJSONBody {
1282
- message: RESTPostAPIGuildForumThreadsJSONBody['message'] & {
1283
- files?: RawFile[];
1284
- };
1285
- }
1286
- declare class ThreadsAPI {
1287
- private readonly rest;
1288
- constructor(rest: REST);
1289
- /**
1290
- * Fetches a thread
1291
- *
1292
- * @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
1293
- * @param threadId - The id of the thread
1294
- */
1295
- get(threadId: Snowflake): Promise<APIThreadChannel>;
1296
- /**
1297
- * Creates a new thread
1298
- *
1299
- * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message}
1300
- * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
1301
- * @param channelId - The id of the channel to start the thread in
1302
- * @param data - The data to use when starting the thread
1303
- */
1304
- create(channelId: Snowflake, { message_id, ...body }: StartThreadOptions): Promise<discord_api_types_v10.APIChannel>;
1305
- /**
1306
- * Creates a new forum post
1307
- *
1308
- * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel}
1309
- * @param channelId - The id of the forum channel to start the thread in
1310
- * @param data - The data to use when starting the thread
1311
- */
1312
- createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions): Promise<APIThreadChannel>;
1313
- /**
1314
- * Adds the current user to a thread
1315
- *
1316
- * @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
1317
- * @param threadId - The id of the thread to join
1318
- */
1319
- join(threadId: Snowflake): Promise<void>;
1320
- /**
1321
- * Adds a member to a thread
1322
- *
1323
- * @see {@link https://discord.com/developers/docs/resources/channel#add-thread-member}
1324
- * @param threadId - The id of the thread to add the member to
1325
- * @param userId - The id of the user to add to the thread
1326
- */
1327
- addMember(threadId: Snowflake, userId: Snowflake): Promise<void>;
1328
- /**
1329
- * Removes the current user from a thread
1330
- *
1331
- * @see {@link https://discord.com/developers/docs/resources/channel#leave-thread}
1332
- * @param threadId - The id of the thread to leave
1333
- */
1334
- leave(threadId: Snowflake): Promise<void>;
1335
- /**
1336
- * Removes a member from a thread
1337
- *
1338
- * @see {@link https://discord.com/developers/docs/resources/channel#remove-thread-member}
1339
- * @param threadId - The id of the thread to remove the member from
1340
- * @param userId - The id of the user to remove from the thread
1341
- */
1342
- removeMember(threadId: Snowflake, userId: Snowflake): Promise<void>;
1343
- /**
1344
- * Fetches a member of a thread
1345
- *
1346
- * @see {@link https://discord.com/developers/docs/resources/channel#get-thread-member}
1347
- * @param threadId - The id of the thread to fetch the member from
1348
- * @param userId - The id of the user
1349
- */
1350
- getMember(threadId: Snowflake, userId: Snowflake): Promise<APIThreadMember>;
1351
- /**
1352
- * Fetches all members of a thread
1353
- *
1354
- * @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
1355
- * @param threadId - The id of the thread to fetch the members from
1356
- */
1357
- getAllMembers(threadId: Snowflake): Promise<RESTGetAPIChannelThreadMembersResult>;
1358
- }
1359
-
1360
- declare class UsersAPI {
1361
- private readonly rest;
1362
- constructor(rest: REST);
1363
- /**
1364
- * Fetches a user by their id
1365
- *
1366
- * @see {@link https://discord.com/developers/docs/resources/user#get-user}
1367
- * @param userId - The id of the user to fetch
1368
- */
1369
- get(userId: Snowflake): Promise<discord_api_types_v10.APIUser>;
1370
- /**
1371
- * Returns the user object of the requester's account
1372
- *
1373
- * @see {@link https://discord.com/developers/docs/resources/user#get-current-user}
1374
- */
1375
- getCurrent(): Promise<discord_api_types_v10.APIUser>;
1376
- /**
1377
- * Returns a list of partial guild objects the current user is a member of
1378
- *
1379
- * @see {@link https://discord.com/developers/docs/resources/user#get-current-user-guilds}
1380
- * @param options - The options to use when fetching the current user's guilds
1381
- */
1382
- getGuilds(options?: RESTGetAPICurrentUserGuildsQuery): Promise<RESTGetAPICurrentUserGuildsResult>;
1383
- /**
1384
- * Leaves the guild with the given id
1385
- *
1386
- * @see {@link https://discord.com/developers/docs/resources/user#leave-guild}
1387
- * @param guildId - The id of the guild
1388
- */
1389
- leaveGuild(guildId: Snowflake): Promise<void>;
1390
- /**
1391
- * Edits the current user
1392
- *
1393
- * @see {@link https://discord.com/developers/docs/resources/user#modify-current-user}
1394
- * @param user - The new data for the current user
1395
- */
1396
- edit(user: RESTPatchAPICurrentUserJSONBody): Promise<discord_api_types_v10.APIUser>;
1397
- /**
1398
- * Fetches the guild member for the current user
1399
- *
1400
- * @see {@link https://discord.com/developers/docs/resources/user#get-current-user-guild-member}
1401
- * @param guildId - The id of the guild
1402
- */
1403
- getGuildMember(guildId: Snowflake): Promise<discord_api_types_v10.APIGuildMember>;
1404
- /**
1405
- * Edits the guild member for the current user
1406
- *
1407
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-member}
1408
- * @param guildId - The id of the guild
1409
- * @param member - The new data for the guild member
1410
- * @param reason - The reason for editing this guild member
1411
- */
1412
- editGuildMember(guildId: Snowflake, member?: RESTPatchAPIGuildMemberJSONBody, reason?: string): Promise<discord_api_types_v10.APIGuildMember>;
1413
- /**
1414
- * Opens a new DM channel with a user
1415
- *
1416
- * @see {@link https://discord.com/developers/docs/resources/user#create-dm}
1417
- * @param userId - The id of the user to open a DM channel with
1418
- */
1419
- createDM(userId: Snowflake): Promise<discord_api_types_v10.APIChannel>;
1420
- /**
1421
- * Gets the current user's connections
1422
- *
1423
- * @see {@link https://discord.com/developers/docs/resources/user#get-user-connections}
1424
- */
1425
- getConnections(): Promise<RESTGetAPICurrentUserConnectionsResult>;
1426
- /**
1427
- * Gets the current user's active application role connection
1428
- *
1429
- * @see {@link https://discord.com/developers/docs/resources/user#get-user-application-role-connection}
1430
- * @param applicationId - The id of the application
1431
- */
1432
- getApplicationRoleConnection(applicationId: Snowflake): Promise<discord_api_types_v10.APIApplicationRoleConnection>;
1433
- /**
1434
- * Updates the current user's application role connection
1435
- *
1436
- * @see {@link https://discord.com/developers/docs/resources/user#update-user-application-role-connection}
1437
- * @param applicationId - The id of the application
1438
- * @param options - The options to use when updating the application role connection
1439
- */
1440
- updateApplicationRoleConnection(applicationId: Snowflake, options: RESTPutAPICurrentUserApplicationRoleConnectionJSONBody): Promise<discord_api_types_v10.APIApplicationRoleConnection>;
1441
- }
1442
-
1443
- declare class VoiceAPI {
1444
- private readonly rest;
1445
- constructor(rest: REST);
1446
- /**
1447
- * Fetches all voice regions
1448
- *
1449
- * @see {@link https://discord.com/developers/docs/resources/voice#list-voice-regions}
1450
- */
1451
- getVoiceRegions(): Promise<discord_api_types_v10.RESTGetAPIVoiceRegionsResult>;
1452
- }
1453
-
1454
- declare class API {
1455
- readonly rest: REST;
1456
- readonly applicationCommands: ApplicationCommandsAPI;
1457
- readonly channels: ChannelsAPI;
1458
- readonly guilds: GuildsAPI;
1459
- readonly interactions: InteractionsAPI;
1460
- readonly invites: InvitesAPI;
1461
- readonly oauth2: OAuth2API;
1462
- readonly roleConnections: RoleConnectionsAPI;
1463
- readonly stickers: StickersAPI;
1464
- readonly threads: ThreadsAPI;
1465
- readonly users: UsersAPI;
1466
- readonly voice: VoiceAPI;
1467
- readonly webhooks: WebhooksAPI;
1468
- constructor(rest: REST);
1469
- }
1
+ import { A as API } from './files-4cadec53.js';
2
+ export { a as ApplicationCommandsAPI, C as ChannelsAPI, D as DescriptiveRawFile, G as GuildsAPI, I as InteractionsAPI, b as InvitesAPI, O as OAuth2API, R as RoleConnectionsAPI, c as StartForumThreadOptions, S as StickersAPI, T as ThreadsAPI, U as UsersAPI, V as VoiceAPI, W as WebhooksAPI, w as withFiles } from './files-4cadec53.js';
3
+ import { REST } from '@discordjs/rest';
4
+ import { WebSocketManager } from '@discordjs/ws';
5
+ import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
6
+ import { GatewayDispatchEvents, GatewayAutoModerationActionExecutionDispatchData, GatewayAutoModerationRuleCreateDispatchData, GatewayAutoModerationRuleDeleteDispatchData, GatewayAutoModerationRuleUpdateDispatchData, GatewayChannelCreateDispatchData, GatewayChannelDeleteDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayChannelUpdateDispatchData, GatewayGuildAuditLogEntryCreateDispatchData, GatewayGuildBanAddDispatchData, GatewayGuildBanRemoveDispatchData, GatewayGuildCreateDispatchData, GatewayGuildDeleteDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberAddDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberUpdateDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleCreateDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildRoleUpdateDispatchData, GatewayGuildScheduledEventCreateDispatchData, GatewayGuildScheduledEventDeleteDispatchData, GatewayGuildScheduledEventUpdateDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildUpdateDispatchData, GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntegrationUpdateDispatchData, GatewayInteractionCreateDispatchData, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageCreateDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData, GatewayPresenceUpdateDispatchData, GatewayReadyDispatchData, GatewayStageInstanceCreateDispatchData, GatewayStageInstanceDeleteDispatchData, GatewayStageInstanceUpdateDispatchData, GatewayThreadCreateDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSyncDispatchData, GatewayThreadMemberUpdateDispatchData, GatewayThreadMembersUpdateDispatchData, GatewayThreadUpdateDispatchData, GatewayTypingStartDispatchData, GatewayUserUpdateDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GatewayRequestGuildMembersData, APIGuildMember, GatewayVoiceStateUpdateData, GatewayPresenceUpdateData } from 'discord-api-types/v10';
7
+ export * from 'discord-api-types/v10';
1470
8
 
1471
9
  interface IntrinsicProps {
1472
10
  /**
@@ -1588,33 +126,10 @@ declare class Client extends AsyncEventEmitter<ManagerShardEventsMap> {
1588
126
  private wrapIntrinsicProps;
1589
127
  }
1590
128
 
1591
- interface DescriptiveRawFile extends RawFile {
1592
- description?: string;
1593
- }
1594
129
  /**
1595
- * A utility function to create a form data payload given an array of file buffers
1596
- *
1597
- * @param files - The files to create a form data payload for
1598
- * @param options - The additional options for the form data payload
130
+ * The {@link https://github.com/discordjs/discord.js/blob/main/packages/core/#readme | @discordjs/core} version
131
+ * that you are currently using.
1599
132
  */
1600
- declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionResponseCallbackData): {
1601
- body: {
1602
- attachments: {
1603
- id: string;
1604
- description: string | undefined;
1605
- }[];
1606
- content?: string | undefined;
1607
- tts?: boolean | undefined;
1608
- embeds?: discord_api_types_v10.APIEmbed[] | undefined;
1609
- allowed_mentions?: discord_api_types_v10.APIAllowedMentions | undefined;
1610
- components?: discord_api_types_v10.APIActionRowComponent<discord_api_types_v10.APIMessageActionRowComponent>[] | undefined;
1611
- flags?: discord_api_types_v10.MessageFlags;
1612
- thread_name?: string | undefined;
1613
- };
1614
- files: {
1615
- name: string;
1616
- data: string | number | boolean | Buffer;
1617
- }[];
1618
- };
133
+ declare const version: string;
1619
134
 
1620
- export { API, ApplicationCommandsAPI, ChannelsAPI, Client, ClientOptions, DescriptiveRawFile, GuildsAPI, InteractionsAPI, IntrinsicProps, InvitesAPI, ManagerShardEventsMap, MappedEvents, OAuth2API, RoleConnectionsAPI, StartForumThreadOptions, StartThreadOptions, StickersAPI, ThreadsAPI, UsersAPI, VoiceAPI, WebhooksAPI, WithIntrinsicProps, withFiles };
135
+ export { API, Client, ClientOptions, IntrinsicProps, ManagerShardEventsMap, MappedEvents, WithIntrinsicProps, version };