@discordeno/rest 19.0.0-next.f5f97e0 → 19.0.0-next.fbd26f4
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/manager.d.ts +733 -1624
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +2 -2
- package/package.json +3 -3
package/dist/manager.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Queue } from './queue.js';
|
|
2
|
-
import type { ApplicationCommandPermissions, BigString, Camelize, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuildChannel, CreateGuildEmoji, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, DeleteWebhookMessageOptions, DiscordActiveThreads, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordArchivedThreads, DiscordAutoModerationRule, DiscordChannel, DiscordEmoji, DiscordFollowedChannel, DiscordGetGatewayBot, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordScheduledEvent, DiscordStageInstance, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordWebhook, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditMessage, EditScheduledEvent, EditStageInstanceOptions, ExecuteWebhook, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, ModifyChannel, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason } from '@discordeno/types';
|
|
2
|
+
import type { ApplicationCommandPermissions, AtLeastOne, BigString, Camelize, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuild, CreateGuildChannel, CreateGuildEmoji, CreateGuildFromTemplate, CreateGuildRole, CreateGuildStickerOptions, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, DeleteWebhookMessageOptions, DiscordActiveThreads, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordArchivedThreads, DiscordAuditLog, DiscordAutoModerationRule, DiscordBan, DiscordChannel, DiscordEmoji, DiscordFollowedChannel, DiscordGetGatewayBot, DiscordGuild, DiscordGuildPreview, DiscordGuildWidget, DiscordGuildWidgetSettings, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordModifyGuildWelcomeScreen, DiscordPrunedCount, DiscordRole, DiscordScheduledEvent, DiscordStageInstance, DiscordSticker, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordVanityUrl, DiscordVoiceRegion, DiscordWebhook, DiscordWelcomeScreen, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditGuildStickerOptions, EditMessage, EditOwnVoiceState, EditScheduledEvent, EditStageInstanceOptions, EditUserVoiceState, ExecuteWebhook, GetBans, GetGuildAuditLog, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetReactions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, MfaLevels, ModifyChannel, ModifyGuild, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyRolePositions, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason } from '@discordeno/types';
|
|
3
3
|
import type { InvalidRequestBucket } from './invalidBucket.js';
|
|
4
4
|
export declare function createRestManager(options: CreateRestManagerOptions): RestManager;
|
|
5
5
|
export interface CreateRestManagerOptions {
|
|
@@ -80,8 +80,14 @@ export interface RestManager {
|
|
|
80
80
|
};
|
|
81
81
|
/** Routes for channel related endpoints. */
|
|
82
82
|
channels: {
|
|
83
|
+
/** Route for handling bulk messages in a channel. */
|
|
84
|
+
bulk: (channelId: BigString) => string;
|
|
83
85
|
/** Route for non-specific dm channel. */
|
|
84
86
|
dm: () => string;
|
|
87
|
+
/** Route for handling a specific pin. */
|
|
88
|
+
pin: (channelId: BigString, messageId: BigString) => string;
|
|
89
|
+
/** Route for handling a channels pins. */
|
|
90
|
+
pins: (channelId: BigString) => string;
|
|
85
91
|
/** Route for non-specific webhook in a channel. */
|
|
86
92
|
webhooks: (channelId: BigString) => string;
|
|
87
93
|
/** Route for a specific channel. */
|
|
@@ -129,9 +135,26 @@ export interface RestManager {
|
|
|
129
135
|
};
|
|
130
136
|
/** Route for handling typing indicators in a c«hannel. */
|
|
131
137
|
typing: (channelId: BigString) => string;
|
|
138
|
+
/** Routes for handling reactions on a message. */
|
|
139
|
+
reactions: {
|
|
140
|
+
/** Route for handling a bots reaction. */
|
|
141
|
+
bot: (channelId: BigString, messageId: BigString, emoji: string) => string;
|
|
142
|
+
/** Route for handling a user's reactions. */
|
|
143
|
+
user: (channelId: BigString, messageId: BigString, emoji: string, userId: BigString) => string;
|
|
144
|
+
/** Route for handling all the reactions on a message. */
|
|
145
|
+
all: (channelId: BigString, messageId: BigString) => string;
|
|
146
|
+
/** Route for handling all reactions for a single emoji on a message. */
|
|
147
|
+
emoji: (channelId: BigString, messageId: BigString, emoji: string, options?: GetReactions) => string;
|
|
148
|
+
/** Route for handling a specific reaction on a message. */
|
|
149
|
+
message: (channelId: BigString, messageId: BigString, emoji: string, options?: GetReactions) => string;
|
|
150
|
+
};
|
|
132
151
|
};
|
|
133
152
|
/** Routes for guild related endpoints. */
|
|
134
153
|
guilds: {
|
|
154
|
+
/** Routes for handling a non-specific guild. */
|
|
155
|
+
all: () => string;
|
|
156
|
+
/** Route for handling audit logs in a guild. */
|
|
157
|
+
auditlogs: (guildId: BigString, options?: GetGuildAuditLog) => string;
|
|
135
158
|
/** Routes for a guilds automoderation. */
|
|
136
159
|
automod: {
|
|
137
160
|
/** Route for handling a guild's automoderation. */
|
|
@@ -154,6 +177,8 @@ export interface RestManager {
|
|
|
154
177
|
emoji: (guildId: BigString, id: BigString) => string;
|
|
155
178
|
/** Route for handling non-specific emojis. */
|
|
156
179
|
emojis: (guildId: BigString) => string;
|
|
180
|
+
/** Route for handling a specific guild. */
|
|
181
|
+
guild: (guildId: BigString, withCounts?: boolean) => string;
|
|
157
182
|
/** Route for handling a specific integration. */
|
|
158
183
|
integration: (guildId: BigString, integrationId: BigString) => string;
|
|
159
184
|
/** Route for handling non-specific integrations. */
|
|
@@ -162,12 +187,28 @@ export interface RestManager {
|
|
|
162
187
|
invite: (inviteCode: string, options?: GetInvite) => string;
|
|
163
188
|
/** Route for handling non-specific invites in a guild. */
|
|
164
189
|
invites: (guildId: BigString) => string;
|
|
190
|
+
/** Route for handling a bot leaving a guild. */
|
|
191
|
+
leave: (guildId: BigString) => string;
|
|
192
|
+
/** Route for handling a guild's preview. */
|
|
193
|
+
preview: (guildId: BigString) => string;
|
|
194
|
+
/** Route for handling pruning of a guild. */
|
|
195
|
+
prune: (guildId: BigString, options?: GetGuildPruneCountQuery) => string;
|
|
165
196
|
/** Route for handling non-specific webhooks in a guild */
|
|
166
197
|
webhooks: (guildId: BigString) => string;
|
|
198
|
+
/** Route for handling a guild's welcome screen. */
|
|
199
|
+
welcome: (guildId: BigString) => string;
|
|
200
|
+
/** Route for handling a guild's widget. */
|
|
201
|
+
widget: (guildId: BigString) => string;
|
|
202
|
+
/** Route for handling a guild's widget in the form of json. */
|
|
203
|
+
widgetJson: (guildId: BigString) => string;
|
|
204
|
+
/** Route for handling a guilds mfa level. */
|
|
205
|
+
mfa: (guildId: BigString) => string;
|
|
167
206
|
/** Routes for handling a guild's members. */
|
|
168
207
|
members: {
|
|
169
208
|
/** Route for handling a specific guild member's ban. */
|
|
170
209
|
ban: (guildId: BigString, userId: BigString) => string;
|
|
210
|
+
/** Route for handling non-specific bans in a guild. */
|
|
211
|
+
bans: (guildId: BigString, options?: GetBans) => string;
|
|
171
212
|
/** Route for handling a the bot guild member. */
|
|
172
213
|
bot: (guildId: BigString) => string;
|
|
173
214
|
/** Route for handling a specific guild member. */
|
|
@@ -190,6 +231,25 @@ export interface RestManager {
|
|
|
190
231
|
/** Route for handling non-specific guild's templates. */
|
|
191
232
|
all: (guildId: BigString) => string;
|
|
192
233
|
};
|
|
234
|
+
/** Route for handling a guild's vanity url. */
|
|
235
|
+
vanity: (guildId: BigString) => string;
|
|
236
|
+
/** Route for handling a guild's regions. */
|
|
237
|
+
regions: (guildId: BigString) => string;
|
|
238
|
+
/** Routes for handling a guild's roles. */
|
|
239
|
+
roles: {
|
|
240
|
+
/** Route for handling a specific guild role. */
|
|
241
|
+
one: (guildId: BigString, roleId: BigString) => string;
|
|
242
|
+
/** Route for handling a guild's roles. */
|
|
243
|
+
all: (guildId: BigString) => string;
|
|
244
|
+
/** Route for handling a members roles in a guild. */
|
|
245
|
+
member: (guildId: BigString, memberId: BigString, roleId: BigString) => string;
|
|
246
|
+
};
|
|
247
|
+
/** Route for handling a specific guild sticker. */
|
|
248
|
+
stickers: (guildId: BigString) => string;
|
|
249
|
+
/** Route for handling non-specific guild stickers. */
|
|
250
|
+
sticker: (guildId: BigString, stickerId: BigString) => string;
|
|
251
|
+
/** Route for handling a voice state. */
|
|
252
|
+
voice: (guildId: BigString, userId?: BigString) => string;
|
|
193
253
|
};
|
|
194
254
|
/** Routes for interaction related endpoints. */
|
|
195
255
|
interactions: {
|
|
@@ -221,9 +281,15 @@ export interface RestManager {
|
|
|
221
281
|
message: (applicationId: BigString, token: string, messageId: BigString) => string;
|
|
222
282
|
};
|
|
223
283
|
};
|
|
284
|
+
/** Route for handling a sticker. */
|
|
285
|
+
sticker: (stickerId: BigString) => string;
|
|
286
|
+
/** Route for handling all voice regions. */
|
|
287
|
+
regions: () => string;
|
|
224
288
|
};
|
|
225
289
|
/** Check the rate limits for a url or a bucket. */
|
|
226
290
|
checkRateLimits: (url: string) => number | false;
|
|
291
|
+
/** Reshapes and modifies the obj as needed to make it ready for discords api. */
|
|
292
|
+
changeToDiscordFormat: (obj: any) => any;
|
|
227
293
|
/** Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord. */
|
|
228
294
|
createRequest: (options: CreateRequestBodyOptions) => RequestBody;
|
|
229
295
|
/** This will create a infinite loop running in 1 seconds using tail recursion to keep rate limits clean. When a rate limit resets, this will remove it so the queue can proceed. */
|
|
@@ -248,1629 +314,59 @@ export interface RestManager {
|
|
|
248
314
|
delete: (url: string, body?: Record<string, any>) => Promise<void>;
|
|
249
315
|
/** Make a patch request to the api. */
|
|
250
316
|
patch: <T = void>(url: string, body?: Record<string, any>) => Promise<Camelize<T>>;
|
|
251
|
-
/**
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
* @param messageId - The ID of the message to cross-post.
|
|
305
|
-
* @returns An instance of the cross-posted {@link Message}.
|
|
306
|
-
*
|
|
307
|
-
* @remarks
|
|
308
|
-
* Requires the `SEND_MESSAGES` permission.
|
|
309
|
-
*
|
|
310
|
-
* If not cross-posting own message:
|
|
311
|
-
* - Requires the `MANAGE_MESSAGES` permission.
|
|
312
|
-
*
|
|
313
|
-
* Fires a _Message Create_ event in the guilds the subscribed channels are in.
|
|
314
|
-
*
|
|
315
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
|
|
316
|
-
*/
|
|
317
|
-
publish: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
318
|
-
/**
|
|
319
|
-
* Deletes a message from a channel.
|
|
320
|
-
*
|
|
321
|
-
* @param channelId - The ID of the channel to delete the message from.
|
|
322
|
-
* @param messageId - The ID of the message to delete from the channel.
|
|
323
|
-
*
|
|
324
|
-
* @remarks
|
|
325
|
-
* If not deleting own message:
|
|
326
|
-
* - Requires the `MANAGE_MESSAGES` permission.
|
|
327
|
-
*
|
|
328
|
-
* Fires a _Message Delete_ gateway event.
|
|
329
|
-
*
|
|
330
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
|
|
331
|
-
*/
|
|
332
|
-
delete: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
333
|
-
};
|
|
334
|
-
/**
|
|
335
|
-
* Gets a channel by its ID.
|
|
336
|
-
*
|
|
337
|
-
* @param id - The ID of the channel to get.
|
|
338
|
-
* @returns An instance of {@link DiscordChannel}.
|
|
339
|
-
*
|
|
340
|
-
* @remarks
|
|
341
|
-
* If the channel is a thread, a {@link ThreadMember} object is included in the result.
|
|
342
|
-
*
|
|
343
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
|
|
344
|
-
*/
|
|
345
|
-
get: (id: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
346
|
-
/**
|
|
347
|
-
* Creates a channel within a guild.
|
|
348
|
-
*
|
|
349
|
-
* @param guildId - The ID of the guild to create the channel within.
|
|
350
|
-
* @param options - The parameters for the creation of the channel.
|
|
351
|
-
* @returns An instance of the created {@link DiscordChannel}.
|
|
352
|
-
*
|
|
353
|
-
* @remarks
|
|
354
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
355
|
-
*
|
|
356
|
-
* If setting permission overwrites, only the permissions the bot user has in the guild can be allowed or denied.
|
|
357
|
-
*
|
|
358
|
-
* Setting the `MANAGE_ROLES` permission is only possible for guild administrators.
|
|
359
|
-
*
|
|
360
|
-
* Fires a _Channel Create_ gateway event.
|
|
361
|
-
*
|
|
362
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
|
|
363
|
-
*/
|
|
364
|
-
create: (guildId: BigString, options: CreateGuildChannel) => Promise<Camelize<DiscordChannel>>;
|
|
365
|
-
/**
|
|
366
|
-
* Deletes a channel from within a guild.
|
|
367
|
-
*
|
|
368
|
-
* @param channelId - The ID of the channel to delete.
|
|
369
|
-
* @returns An instance of the deleted {@link Channel}.
|
|
370
|
-
*
|
|
371
|
-
* @remarks
|
|
372
|
-
* For community guilds, the _Rules_, _Guidelines_ and _Community Update_ channels cannot be deleted.
|
|
373
|
-
*
|
|
374
|
-
* If the channel is a thread:
|
|
375
|
-
* - Requires the `MANAGE_THREADS` permission.
|
|
376
|
-
*
|
|
377
|
-
* - Fires a _Thread Delete_ gateway event.
|
|
378
|
-
*
|
|
379
|
-
* Otherwise:
|
|
380
|
-
* - Requires the `MANAGE_CHANNELS` permission.
|
|
381
|
-
*
|
|
382
|
-
* - ⚠️ Deleting a category channel does not delete its child channels.
|
|
383
|
-
* Instead, they will have their `parent_id` property removed, and a `Channel Update` gateway event will fire for each of them.
|
|
384
|
-
*
|
|
385
|
-
* - Fires a _Channel Delete_ gateway event.
|
|
386
|
-
*
|
|
387
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#deleteclose-channel}
|
|
388
|
-
*/
|
|
389
|
-
delete: (channelId: BigString, reason?: string) => Promise<void>;
|
|
390
|
-
/**
|
|
391
|
-
* Edits a channel's settings.
|
|
392
|
-
*
|
|
393
|
-
* @param channelId - The ID of the channel to edit.
|
|
394
|
-
* @param options - The parameters for the edit of the channel.
|
|
395
|
-
* @returns An instance of the edited {@link DiscordChannel}.
|
|
396
|
-
*
|
|
397
|
-
* @remarks
|
|
398
|
-
* If editing a channel of type {@link ChannelTypes.GroupDm}:
|
|
399
|
-
* - Fires a _Channel Update_ gateway event.
|
|
400
|
-
*
|
|
401
|
-
* If editing a thread channel:
|
|
402
|
-
* - Requires the `MANAGE_THREADS` permission __unless__ if setting the `archived` property to `false` when the `locked` property is also `false`, in which case only the `SEND_MESSAGES` permission is required.
|
|
403
|
-
*
|
|
404
|
-
* - Fires a _Thread Update_ gateway event.
|
|
405
|
-
*
|
|
406
|
-
* If editing a guild channel:
|
|
407
|
-
* - Requires the `MANAGE_CHANNELS` permission.
|
|
408
|
-
*
|
|
409
|
-
* - If modifying permission overrides:
|
|
410
|
-
* - Requires the `MANAGE_ROLES` permission.
|
|
411
|
-
*
|
|
412
|
-
* - Only permissions the bot user has in the guild or parent channel can be allowed/denied __unless__ the bot user has a `MANAGE_ROLES` permission override in the channel.
|
|
413
|
-
*
|
|
414
|
-
* - If modifying a channel of type {@link ChannelTypes.GuildCategory}:
|
|
415
|
-
* - Fires a _Channel Update_ gateway event for each child channel impacted in this change.
|
|
416
|
-
* - Otherwise:
|
|
417
|
-
* - Fires a _Channel Update_ gateway event.
|
|
418
|
-
*/
|
|
419
|
-
edit: (channelId: BigString, options: ModifyChannel) => Promise<Camelize<DiscordChannel>>;
|
|
420
|
-
/**
|
|
421
|
-
* Follows an announcement channel, allowing messages posted within it to be cross-posted into the target channel.
|
|
422
|
-
*
|
|
423
|
-
* @param sourceChannelId - The ID of the announcement channel to follow.
|
|
424
|
-
* @param targetChannelId - The ID of the target channel - the channel to cross-post to.
|
|
425
|
-
* @returns An instance of {@link DiscordFollowedChannel}.
|
|
426
|
-
*
|
|
427
|
-
* @remarks
|
|
428
|
-
* Requires the `MANAGE_WEBHOOKS` permission in the __target channel__.
|
|
429
|
-
*
|
|
430
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
431
|
-
*
|
|
432
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
|
|
433
|
-
*/
|
|
434
|
-
follow: (sourceChannelId: BigString, targetChannelId: BigString) => Promise<Camelize<DiscordFollowedChannel>>;
|
|
435
|
-
/** Forum related helpers in a channel */
|
|
436
|
-
forums: {
|
|
437
|
-
/**
|
|
438
|
-
* Creates a new thread in a forum channel, and sends a message within the created thread.
|
|
439
|
-
*
|
|
440
|
-
* @param channelId - The ID of the forum channel to create the thread within.
|
|
441
|
-
* @param options - The parameters for the creation of the thread.
|
|
442
|
-
* @returns An instance of {@link DiscordChannel} with a nested {@link Message} object.
|
|
443
|
-
*
|
|
444
|
-
* @remarks
|
|
445
|
-
* Requires the `CREATE_MESSAGES` permission.
|
|
446
|
-
*
|
|
447
|
-
* Fires a _Thread Create_ gateway event.
|
|
448
|
-
* Fires a _Message Create_ gateway event.
|
|
449
|
-
*
|
|
450
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel}
|
|
451
|
-
*
|
|
452
|
-
* @experimental
|
|
453
|
-
*/
|
|
454
|
-
post: (channelId: BigString, options: CreateForumPostWithMessage) => Promise<Camelize<DiscordChannel>>;
|
|
455
|
-
};
|
|
456
|
-
/** Permission related helpers in a channel */
|
|
457
|
-
permissions: {
|
|
458
|
-
/**
|
|
459
|
-
* Edits the permission overrides for a user or role in a channel.
|
|
460
|
-
*
|
|
461
|
-
* @param channelId - The ID of the channel to edit the permission overrides of.
|
|
462
|
-
* @param options - The permission override.
|
|
463
|
-
*
|
|
464
|
-
* @remarks
|
|
465
|
-
* Requires the `MANAGE_ROLES` permission.
|
|
466
|
-
*
|
|
467
|
-
* Only permissions the bot user has in the guild or parent channel can be allowed/denied __unless__ the bot user has a `MANAGE_ROLES` permission override in the channel.
|
|
468
|
-
*
|
|
469
|
-
* Fires a _Channel Update_ gateway event.
|
|
470
|
-
*
|
|
471
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#edit-channel-permissions}
|
|
472
|
-
*/
|
|
473
|
-
edit: (channelId: BigString, options: EditChannelPermissionOverridesOptions) => Promise<void>;
|
|
474
|
-
/**
|
|
475
|
-
* Deletes a permission override for a user or role in a channel.
|
|
476
|
-
*
|
|
477
|
-
* @param channelId - The ID of the channel to delete the permission override of.
|
|
478
|
-
* @param overwriteId - The ID of the permission override to delete.
|
|
479
|
-
*
|
|
480
|
-
* @remarks
|
|
481
|
-
* Requires the `MANAGE_ROLES` permission.
|
|
482
|
-
*
|
|
483
|
-
* Fires a _Channel Update_ gateway event.
|
|
484
|
-
*
|
|
485
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-permission}
|
|
486
|
-
*/
|
|
487
|
-
delete: (channelId: BigString, overwriteId: BigString, reason?: string) => Promise<void>;
|
|
488
|
-
};
|
|
489
|
-
threads: {
|
|
490
|
-
get: {
|
|
491
|
-
/**
|
|
492
|
-
* Gets the list of all active threads for a guild.
|
|
493
|
-
*
|
|
494
|
-
* @param guildId - The ID of the guild to get the threads of.
|
|
495
|
-
* @returns An instance of {@link DiscordActiveThreads}.
|
|
496
|
-
*
|
|
497
|
-
* @remarks
|
|
498
|
-
* Returns both public and private threads.
|
|
499
|
-
*
|
|
500
|
-
* Threads are ordered by the `id` property in descending order.
|
|
501
|
-
*
|
|
502
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#list-active-guild-threads}
|
|
503
|
-
*/
|
|
504
|
-
active: (guildId: BigString) => Promise<Camelize<DiscordActiveThreads>>;
|
|
505
|
-
/** Methods related to getting archived threads. */
|
|
506
|
-
archived: {
|
|
507
|
-
/**
|
|
508
|
-
* Gets the list of private archived threads for a channel.
|
|
509
|
-
*
|
|
510
|
-
* @param channelId - The ID of the channel to get the archived threads for.
|
|
511
|
-
* @param options - The parameters for the fetching of threads.
|
|
512
|
-
* @returns An instance of {@link DiscordArchivedThreads}.
|
|
513
|
-
*
|
|
514
|
-
* @remarks
|
|
515
|
-
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
516
|
-
* Requires the `MANAGE_THREADS` permission.
|
|
517
|
-
*
|
|
518
|
-
* Returns threads of type {@link ChannelTypes.GuildPrivateThread}.
|
|
519
|
-
*
|
|
520
|
-
* Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
|
|
521
|
-
*
|
|
522
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-private-archived-threads}
|
|
523
|
-
*/
|
|
524
|
-
private: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
525
|
-
/**
|
|
526
|
-
* Gets the list of private archived threads the bot is a member of for a channel.
|
|
527
|
-
*
|
|
528
|
-
* @param channelId - The ID of the channel to get the archived threads for.
|
|
529
|
-
* @param options - The parameters for the fetching of threads.
|
|
530
|
-
* @returns An instance of {@link DiscordArchivedThreads}.
|
|
531
|
-
*
|
|
532
|
-
* @remarks
|
|
533
|
-
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
534
|
-
*
|
|
535
|
-
* Returns threads of type {@link ChannelTypes.GuildPrivateThread}.
|
|
536
|
-
*
|
|
537
|
-
* Threads are ordered by the `id` property in descending order.
|
|
538
|
-
*
|
|
539
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
|
|
540
|
-
*/
|
|
541
|
-
joined: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
542
|
-
/**
|
|
543
|
-
* Gets the list of public archived threads for a channel.
|
|
544
|
-
*
|
|
545
|
-
* @param channelId - The ID of the channel to get the archived threads for.
|
|
546
|
-
* @param options - The parameters for the fetching of threads.
|
|
547
|
-
* @returns An instance of {@link ArchivedThreads}.
|
|
548
|
-
*
|
|
549
|
-
* @remarks
|
|
550
|
-
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
551
|
-
*
|
|
552
|
-
* If called on a channel of type {@link ChannelTypes.GuildText}, returns threads of type {@link ChannelTypes.GuildPublicThread}.
|
|
553
|
-
* If called on a channel of type {@link ChannelTypes.GuildNews}, returns threads of type {@link ChannelTypes.GuildNewsThread}.
|
|
554
|
-
*
|
|
555
|
-
* Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
|
|
556
|
-
*
|
|
557
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
|
|
558
|
-
*/
|
|
559
|
-
public: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
560
|
-
};
|
|
561
|
-
/**
|
|
562
|
-
* Gets a thread member by their user ID.
|
|
563
|
-
*
|
|
564
|
-
* @param channelId - The ID of the thread to get the thread member of.
|
|
565
|
-
* @param userId - The user ID of the thread member to get.
|
|
566
|
-
* @returns An instance of {@link DiscordThreadMember}.
|
|
567
|
-
*
|
|
568
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#get-thread-member}
|
|
569
|
-
*/
|
|
570
|
-
member: (channelId: BigString, userId: BigString) => Promise<Camelize<DiscordThreadMember>>;
|
|
571
|
-
/**
|
|
572
|
-
* Gets the list of thread members for a thread.
|
|
573
|
-
*
|
|
574
|
-
* @param channelId - The ID of the thread to get the thread members of.
|
|
575
|
-
* @returns A collection of {@link DiscordThreadMember} assorted by user ID.
|
|
576
|
-
*
|
|
577
|
-
* @remarks
|
|
578
|
-
* Requires the application to have the `GUILD_MEMBERS` privileged intent enabled.
|
|
579
|
-
*
|
|
580
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
|
|
581
|
-
*/
|
|
582
|
-
members: (channelId: BigString) => Promise<Camelize<DiscordThreadMember[]>>;
|
|
583
|
-
};
|
|
584
|
-
/**
|
|
585
|
-
* Adds the bot user to a thread.
|
|
586
|
-
*
|
|
587
|
-
* @param channelId - The ID of the thread to add the bot user to.
|
|
588
|
-
*
|
|
589
|
-
* @remarks
|
|
590
|
-
* Requires the thread not be archived.
|
|
591
|
-
*
|
|
592
|
-
* Fires a _Thread Members Update_ gateway event.
|
|
593
|
-
*
|
|
594
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
|
|
595
|
-
*/
|
|
596
|
-
join: (channelId: BigString) => Promise<void>;
|
|
597
|
-
/**
|
|
598
|
-
* Removes the bot user from a thread.
|
|
599
|
-
*
|
|
600
|
-
* @param channelId - The ID of the thread to remove the bot user from.
|
|
601
|
-
*
|
|
602
|
-
* @remarks
|
|
603
|
-
* Requires the thread not be archived.
|
|
604
|
-
*
|
|
605
|
-
* Fires a _Thread Members Update_ gateway event.
|
|
606
|
-
*
|
|
607
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#leave-thread}
|
|
608
|
-
*/
|
|
609
|
-
leave: (channelId: BigString) => Promise<void>;
|
|
610
|
-
/**
|
|
611
|
-
* Removes a member from a thread.
|
|
612
|
-
*
|
|
613
|
-
* @param channelId - The ID of the thread to remove the thread member of.
|
|
614
|
-
* @param userId - The user ID of the thread member to remove.
|
|
615
|
-
*
|
|
616
|
-
* @remarks
|
|
617
|
-
* If the thread is of type {@link ChannelTypes.GuildPrivateThread}, requires to be the creator of the thread.
|
|
618
|
-
* Otherwise, requires the `MANAGE_THREADS` permission.
|
|
619
|
-
*
|
|
620
|
-
* Requires the thread not be archived.
|
|
621
|
-
*
|
|
622
|
-
* Fires a _Thread Members Update_ gateway event.
|
|
623
|
-
*
|
|
624
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#remove-thread-member}
|
|
625
|
-
*/
|
|
626
|
-
kick: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
627
|
-
/** Methods related to creating a thread. */
|
|
628
|
-
create: {
|
|
629
|
-
with: {
|
|
630
|
-
/**
|
|
631
|
-
* Creates a thread, using an existing message as its point of origin.
|
|
632
|
-
*
|
|
633
|
-
* @param channelId - The ID of the channel in which to create the thread.
|
|
634
|
-
* @param messageId - The ID of the message to use as the thread's point of origin.
|
|
635
|
-
* @param options - The parameters to use for the creation of the thread.
|
|
636
|
-
* @returns An instance of the created {@link Channel | Thread}.
|
|
637
|
-
*
|
|
638
|
-
* @remarks
|
|
639
|
-
* If called on a channel of type {@link ChannelTypes.GuildText}, creates a {@link ChannelTypes.GuildPublicThread}.
|
|
640
|
-
* If called on a channel of type {@link ChannelTypes.GuildNews}, creates a {@link ChannelTypes.GuildNewsThread}.
|
|
641
|
-
* Does not work on channels of type {@link ChannelTypes.GuildForum}.
|
|
642
|
-
*
|
|
643
|
-
* The ID of the created thread will be the same as the ID of the source message.
|
|
644
|
-
*
|
|
645
|
-
* Fires a _Thread Create_ gateway event.
|
|
646
|
-
*
|
|
647
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message}
|
|
648
|
-
*/
|
|
649
|
-
message: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage) => Promise<Camelize<DiscordChannel>>;
|
|
650
|
-
};
|
|
651
|
-
without: {
|
|
652
|
-
/**
|
|
653
|
-
* Creates a thread without using a message as the thread's point of origin.
|
|
654
|
-
*
|
|
655
|
-
* @param channelId - The ID of the channel in which to create the thread.
|
|
656
|
-
* @param options - The parameters to use for the creation of the thread.
|
|
657
|
-
* @returns An instance of the created {@link DiscordChannel | Thread}.
|
|
658
|
-
*
|
|
659
|
-
* @remarks
|
|
660
|
-
* Creating a private thread requires the server to be boosted.
|
|
661
|
-
*
|
|
662
|
-
* Fires a _Thread Create_ gateway event.
|
|
663
|
-
*
|
|
664
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
|
|
665
|
-
*/
|
|
666
|
-
message: (channelId: BigString, options: StartThreadWithoutMessage) => Promise<Camelize<DiscordChannel>>;
|
|
667
|
-
};
|
|
668
|
-
};
|
|
669
|
-
};
|
|
670
|
-
/**
|
|
671
|
-
* Edits the positions of a set of channels in a guild.
|
|
672
|
-
*
|
|
673
|
-
* @param guildId - The ID of the guild in which to edit the positions of the channels.
|
|
674
|
-
* @param channelPositions - A set of objects defining the updated positions of the channels.
|
|
675
|
-
*
|
|
676
|
-
* @remarks
|
|
677
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
678
|
-
*
|
|
679
|
-
* Fires a _Channel Update_ gateway event for every channel impacted in this change.
|
|
680
|
-
*
|
|
681
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions}
|
|
682
|
-
*/
|
|
683
|
-
positions: (guildId: BigString, channelPositions: ModifyGuildChannelPositions[]) => Promise<void>;
|
|
684
|
-
/**
|
|
685
|
-
* Gets the list of invites for a channel.
|
|
686
|
-
*
|
|
687
|
-
* @param channelId - The ID of the channel to get the invites of.
|
|
688
|
-
* @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
|
|
689
|
-
*
|
|
690
|
-
* @remarks
|
|
691
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
692
|
-
*
|
|
693
|
-
* Only usable for guild channels.
|
|
694
|
-
*
|
|
695
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-invites}
|
|
696
|
-
*/
|
|
697
|
-
invites: (channelId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
|
|
698
|
-
/** Stage related helpers for a channel. */
|
|
699
|
-
stages: {
|
|
700
|
-
/**
|
|
701
|
-
* Creates a stage instance associated with a stage channel.
|
|
702
|
-
*
|
|
703
|
-
* @param options - The parameters for the creation of the stage instance.
|
|
704
|
-
* @returns An instance of the created {@link DiscordStageInstance}.
|
|
705
|
-
*
|
|
706
|
-
* @remarks
|
|
707
|
-
* Requires the user to be a moderator of the stage channel.
|
|
708
|
-
*
|
|
709
|
-
* Fires a _Stage Instance Create_ gateway event.
|
|
710
|
-
*
|
|
711
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#create-stage-instance}
|
|
712
|
-
*/
|
|
713
|
-
create: (options: CreateStageInstance) => Promise<Camelize<DiscordStageInstance>>;
|
|
714
|
-
/**
|
|
715
|
-
* Deletes the stage instance associated with a stage channel, if one exists.
|
|
716
|
-
*
|
|
717
|
-
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
718
|
-
*
|
|
719
|
-
* @remarks
|
|
720
|
-
* Requires the user to be a moderator of the stage channel.
|
|
721
|
-
*
|
|
722
|
-
* Fires a _Stage Instance Delete_ gateway event.
|
|
723
|
-
*
|
|
724
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance}
|
|
725
|
-
*/
|
|
726
|
-
delete: (channelId: BigString, reason?: string) => Promise<void>;
|
|
727
|
-
/**
|
|
728
|
-
* Edits a stage instance.
|
|
729
|
-
*
|
|
730
|
-
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
731
|
-
* @returns An instance of the updated {@link DiscordStageInstance}.
|
|
732
|
-
*
|
|
733
|
-
* @remarks
|
|
734
|
-
* Requires the user to be a moderator of the stage channel.
|
|
735
|
-
*
|
|
736
|
-
* Fires a _Stage Instance Update_ event.
|
|
737
|
-
*
|
|
738
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance}
|
|
739
|
-
*/
|
|
740
|
-
edit: (channelId: BigString, data: EditStageInstanceOptions) => Promise<Camelize<DiscordStageInstance>>;
|
|
741
|
-
/**
|
|
742
|
-
* Gets the stage instance associated with a stage channel, if one exists.
|
|
743
|
-
*
|
|
744
|
-
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
745
|
-
* @returns An instance of {@link DiscordStageInstance}.
|
|
746
|
-
*
|
|
747
|
-
* @see {@link https://discord.com/developers/docs/resources/stage-instance#get-stage-instance}
|
|
748
|
-
*/
|
|
749
|
-
get: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
|
|
750
|
-
};
|
|
751
|
-
/**
|
|
752
|
-
* Triggers a typing indicator for the bot user.
|
|
753
|
-
*
|
|
754
|
-
* @param channelId - The ID of the channel in which to trigger the typing indicator.
|
|
755
|
-
*
|
|
756
|
-
* @remarks
|
|
757
|
-
* Generally, bots should _not_ use this route.
|
|
758
|
-
*
|
|
759
|
-
* Fires a _Typing Start_ gateway event.
|
|
760
|
-
*
|
|
761
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#trigger-typing-indicator}
|
|
762
|
-
*/
|
|
763
|
-
typing: (channelId: BigString) => Promise<void>;
|
|
764
|
-
};
|
|
765
|
-
/** Emoji related helper methods. */
|
|
766
|
-
emojis: {
|
|
767
|
-
/**
|
|
768
|
-
* Creates an emoji in a guild.
|
|
769
|
-
*
|
|
770
|
-
* @param guildId - The ID of the guild in which to create the emoji.
|
|
771
|
-
* @param options - The parameters for the creation of the emoji.
|
|
772
|
-
* @returns An instance of the created {@link DiscordEmoji}.
|
|
773
|
-
*
|
|
774
|
-
* @remarks
|
|
775
|
-
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
776
|
-
*
|
|
777
|
-
* Emojis have a maximum file size of 256 kilobits. Attempting to upload a larger emoji will cause the route to return 400 Bad Request.
|
|
778
|
-
*
|
|
779
|
-
* Fires a _Guild Emojis Update_ gateway event.
|
|
780
|
-
*
|
|
781
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#create-guild-emoji}
|
|
782
|
-
*/
|
|
783
|
-
create: (guildId: BigString, options: CreateGuildEmoji) => Promise<Camelize<DiscordEmoji>>;
|
|
784
|
-
/**
|
|
785
|
-
* Deletes an emoji from a guild.
|
|
786
|
-
*
|
|
787
|
-
* @param guildId - The ID of the guild from which to delete the emoji.
|
|
788
|
-
* @param id - The ID of the emoji to delete.
|
|
789
|
-
*
|
|
790
|
-
* @remarks
|
|
791
|
-
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
792
|
-
*
|
|
793
|
-
* Fires a _Guild Emojis Update_ gateway event.
|
|
794
|
-
*
|
|
795
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#delete-guild-emoji}
|
|
796
|
-
*/
|
|
797
|
-
delete: (guildId: BigString, id: BigString, reason?: string) => Promise<void>;
|
|
798
|
-
/**
|
|
799
|
-
* Edits an emoji.
|
|
800
|
-
*
|
|
801
|
-
* @param guildId - The ID of the guild in which to edit the emoji.
|
|
802
|
-
* @param id - The ID of the emoji to edit.
|
|
803
|
-
* @param options - The parameters for the edit of the emoji.
|
|
804
|
-
* @returns An instance of the updated {@link DiscordEmoji}.
|
|
805
|
-
*
|
|
806
|
-
* @remarks
|
|
807
|
-
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
808
|
-
*
|
|
809
|
-
* Fires a `Guild Emojis Update` gateway event.
|
|
810
|
-
*
|
|
811
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-guild-emoji}
|
|
812
|
-
*/
|
|
813
|
-
edit: (guildId: BigString, id: BigString, options: ModifyGuildEmoji) => Promise<Camelize<DiscordEmoji>>;
|
|
814
|
-
/**
|
|
815
|
-
* Gets an emoji by its ID.
|
|
816
|
-
*
|
|
817
|
-
* @param guildId - The ID of the guild from which to get the emoji.
|
|
818
|
-
* @param emojiId - The ID of the emoji to get.
|
|
819
|
-
* @returns An instance of {@link DiscordEmoji}.
|
|
820
|
-
*
|
|
821
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#get-guild-emoji}
|
|
822
|
-
*/
|
|
823
|
-
get: (guildId: BigString, emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
|
|
824
|
-
};
|
|
825
|
-
/** Guild related helper methods */
|
|
826
|
-
guilds: {
|
|
827
|
-
automod: {
|
|
828
|
-
/**
|
|
829
|
-
* Creates an automod rule in a guild.
|
|
830
|
-
*
|
|
831
|
-
* @param guildId - The ID of the guild to create the rule in.
|
|
832
|
-
* @param options - The parameters for the creation of the rule.
|
|
833
|
-
* @returns An instance of the created {@link DiscordAutoModerationRule}.
|
|
834
|
-
*
|
|
835
|
-
* @remarks
|
|
836
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
837
|
-
*
|
|
838
|
-
* Fires an _Auto Moderation Rule Create_ gateway event.
|
|
839
|
-
*
|
|
840
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule}
|
|
841
|
-
*/
|
|
842
|
-
create: (guildId: BigString, options: CreateAutoModerationRuleOptions) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
843
|
-
/**
|
|
844
|
-
* Deletes a scheduled event from a guild.
|
|
845
|
-
*
|
|
846
|
-
* @param guildId - The ID of the guild to delete the scheduled event from.
|
|
847
|
-
* @param eventId - The ID of the scheduled event to delete.
|
|
848
|
-
*
|
|
849
|
-
* @remarks
|
|
850
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
851
|
-
*
|
|
852
|
-
* Fires a _Guild Scheduled Event Delete_ gateway event.
|
|
853
|
-
*
|
|
854
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
|
|
855
|
-
*/
|
|
856
|
-
delete: (guildId: BigString, eventId: BigString) => Promise<void>;
|
|
857
|
-
/**
|
|
858
|
-
* Edits an automod rule.
|
|
859
|
-
*
|
|
860
|
-
* @param guildId - The ID of the guild to edit the rule in.
|
|
861
|
-
* @param ruleId - The ID of the rule to edit.
|
|
862
|
-
* @param options - The parameters for the edit of the rule.
|
|
863
|
-
* @returns An instance of the edited {@link DiscordAutoModerationRule}.
|
|
864
|
-
*
|
|
865
|
-
* @remarks
|
|
866
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
867
|
-
*
|
|
868
|
-
* Fires an _Auto Moderation Rule Update_ gateway event.
|
|
869
|
-
*
|
|
870
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule}
|
|
871
|
-
*/
|
|
872
|
-
edit: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions>) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
873
|
-
/** Methods related to getting automoderation data in a guild. */
|
|
874
|
-
get: {
|
|
875
|
-
/**
|
|
876
|
-
* Gets an automod rule by its ID.
|
|
877
|
-
*
|
|
878
|
-
* @param guildId - The ID of the guild to get the rule of.
|
|
879
|
-
* @param ruleId - The ID of the rule to get.
|
|
880
|
-
* @returns An instance of {@link DiscordAutoModerationRule}.
|
|
881
|
-
*
|
|
882
|
-
* @remarks
|
|
883
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
884
|
-
*
|
|
885
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule}
|
|
886
|
-
*/
|
|
887
|
-
rule: (guildId: BigString, ruleId: BigString) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
888
|
-
/**
|
|
889
|
-
* Gets the list of automod rules for a guild.
|
|
890
|
-
*
|
|
891
|
-
* @param guildId - The ID of the guild to get the rules from.
|
|
892
|
-
* @returns A collection of {@link DiscordAutoModerationRule} objects assorted by rule ID.
|
|
893
|
-
*
|
|
894
|
-
* @remarks
|
|
895
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
896
|
-
*
|
|
897
|
-
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
|
|
898
|
-
*/
|
|
899
|
-
rules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
|
|
900
|
-
};
|
|
901
|
-
};
|
|
902
|
-
/**
|
|
903
|
-
* Gets the list of channels for a guild.
|
|
904
|
-
*
|
|
905
|
-
* @param guildId - The ID of the guild to get the channels of.
|
|
906
|
-
* @returns A collection of {@link DiscordChannel} objects assorted by channel ID.
|
|
907
|
-
*
|
|
908
|
-
* @remarks
|
|
909
|
-
* Excludes threads.
|
|
910
|
-
*
|
|
911
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
|
|
912
|
-
*/
|
|
913
|
-
channels: (guildId: BigString) => Promise<Camelize<DiscordChannel[]>>;
|
|
914
|
-
/**
|
|
915
|
-
* Gets the list of emojis for a guild.
|
|
916
|
-
*
|
|
917
|
-
* @param guildId - The ID of the guild which to get the emojis of.
|
|
918
|
-
* @returns A collection of {@link DiscordEmoji} objects assorted by emoji ID.
|
|
919
|
-
*
|
|
920
|
-
* @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
|
|
921
|
-
*/
|
|
922
|
-
emojis: (guildId: BigString) => Promise<Camelize<DiscordEmoji[]>>;
|
|
923
|
-
/** Methods related to a guild's scheduled events. */
|
|
924
|
-
events: {
|
|
925
|
-
/**
|
|
926
|
-
* Creates a scheduled event in a guild.
|
|
927
|
-
*
|
|
928
|
-
* @param guildId - The ID of the guild to create the scheduled event in.
|
|
929
|
-
* @param options - The parameters for the creation of the scheduled event.
|
|
930
|
-
* @returns An instance of the created {@link ScheduledEvent}.
|
|
931
|
-
*
|
|
932
|
-
* @remarks
|
|
933
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
934
|
-
*
|
|
935
|
-
* A guild can only have a maximum of 100 events with a status of {@link ScheduledEventStatus.Active} or {@link ScheduledEventStatus.Scheduled} (inclusive).
|
|
936
|
-
*
|
|
937
|
-
* Fires a _Guild Scheduled Event Create_ gateway event.
|
|
938
|
-
*
|
|
939
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event}
|
|
940
|
-
*/
|
|
941
|
-
create: (guildId: BigString, options: CreateScheduledEvent) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
942
|
-
/**
|
|
943
|
-
* Deletes a scheduled event from a guild.
|
|
944
|
-
*
|
|
945
|
-
* @param guildId - The ID of the guild to delete the scheduled event from.
|
|
946
|
-
* @param eventId - The ID of the scheduled event to delete.
|
|
947
|
-
*
|
|
948
|
-
* @remarks
|
|
949
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
950
|
-
*
|
|
951
|
-
* Fires a _Guild Scheduled Event Delete_ gateway event.
|
|
952
|
-
*
|
|
953
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
|
|
954
|
-
*/
|
|
955
|
-
delete: (guildId: BigString, eventId: BigString) => Promise<void>;
|
|
956
|
-
/**
|
|
957
|
-
* Edits a scheduled event.
|
|
958
|
-
*
|
|
959
|
-
* @param guildId - The ID of the guild to edit the scheduled event in.
|
|
960
|
-
* @param eventId - The ID of the scheduled event to edit.
|
|
961
|
-
* @returns An instance of the edited {@link ScheduledEvent}.
|
|
962
|
-
*
|
|
963
|
-
* @remarks
|
|
964
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
965
|
-
*
|
|
966
|
-
* To start or end an event, modify the event's `status` property.
|
|
967
|
-
*
|
|
968
|
-
* The `entity_metadata` property is discarded for events whose `entity_type` is not {@link ScheduledEventEntityType.External}.
|
|
969
|
-
*
|
|
970
|
-
* Fires a _Guild Scheduled Event Update_ gateway event.
|
|
971
|
-
*
|
|
972
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
|
973
|
-
*/
|
|
974
|
-
edit: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent>) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
975
|
-
get: {
|
|
976
|
-
/**
|
|
977
|
-
* Gets a scheduled event by its ID.
|
|
978
|
-
*
|
|
979
|
-
* @param guildId - The ID of the guild to get the scheduled event from.
|
|
980
|
-
* @param eventId - The ID of the scheduled event to get.
|
|
981
|
-
* @param options - The parameters for the fetching of the scheduled event.
|
|
982
|
-
* @returns An instance of {@link ScheduledEvent}.
|
|
983
|
-
*
|
|
984
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event}
|
|
985
|
-
*/
|
|
986
|
-
event: (guildId: BigString, eventId: BigString, options?: {
|
|
987
|
-
withUserCount?: boolean;
|
|
988
|
-
}) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
989
|
-
/**
|
|
990
|
-
* Gets the list of scheduled events for a guild.
|
|
991
|
-
*
|
|
992
|
-
* @param guildId - The ID of the guild to get the scheduled events from.
|
|
993
|
-
* @param options - The parameters for the fetching of the scheduled events.
|
|
994
|
-
* @returns A collection of {@link ScheduledEvent} objects assorted by event ID.
|
|
995
|
-
*
|
|
996
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild}
|
|
997
|
-
*/
|
|
998
|
-
events: (guildId: BigString, options?: GetScheduledEvents) => Promise<Camelize<DiscordScheduledEvent[]>>;
|
|
999
|
-
/**
|
|
1000
|
-
* Gets the list of subscribers to a scheduled event from a guild.
|
|
1001
|
-
*
|
|
1002
|
-
* @param guildId - The ID of the guild to get the subscribers to the scheduled event from.
|
|
1003
|
-
* @param eventId - The ID of the scheduled event to get the subscribers of.
|
|
1004
|
-
* @param options - The parameters for the fetching of the subscribers.
|
|
1005
|
-
* @returns A collection of {@link User} objects assorted by user ID.
|
|
1006
|
-
*
|
|
1007
|
-
* @remarks
|
|
1008
|
-
* Requires the `MANAGE_EVENTS` permission.
|
|
1009
|
-
*
|
|
1010
|
-
* Users are ordered by their IDs in _ascending_ order.
|
|
1011
|
-
*
|
|
1012
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users}
|
|
1013
|
-
*/
|
|
1014
|
-
users: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => Promise<Array<{
|
|
1015
|
-
user: Camelize<DiscordUser>;
|
|
1016
|
-
member?: Camelize<DiscordMember>;
|
|
1017
|
-
}>>;
|
|
1018
|
-
};
|
|
1019
|
-
};
|
|
1020
|
-
/** Methods related to a guild's integrations. */
|
|
1021
|
-
integrations: {
|
|
1022
|
-
/**
|
|
1023
|
-
* Gets the list of integrations attached to a guild.
|
|
1024
|
-
*
|
|
1025
|
-
* @param guildId - The ID of the guild to get the list of integrations from.
|
|
1026
|
-
* @returns A collection of {@link Integration} objects assorted by integration ID.
|
|
1027
|
-
*
|
|
1028
|
-
* @remarks
|
|
1029
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1030
|
-
*
|
|
1031
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-integrations}
|
|
1032
|
-
*/
|
|
1033
|
-
get: (guildId: BigString) => Promise<Camelize<DiscordIntegration[]>>;
|
|
1034
|
-
/**
|
|
1035
|
-
* Deletes an integration attached to a guild.
|
|
1036
|
-
*
|
|
1037
|
-
* @param guildId - The ID of the guild from which to delete the integration.
|
|
1038
|
-
* @param integrationId - The ID of the integration to delete from the guild.
|
|
1039
|
-
*
|
|
1040
|
-
* @remarks
|
|
1041
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1042
|
-
*
|
|
1043
|
-
* Deletes all webhooks associated with the integration, and kicks the associated bot if there is one.
|
|
1044
|
-
*
|
|
1045
|
-
* Fires a _Guild Integrations Update_ gateway event.
|
|
1046
|
-
* Fires a _Integration Delete_ gateway event.
|
|
1047
|
-
*
|
|
1048
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-integration}
|
|
1049
|
-
*/
|
|
1050
|
-
delete: (guildId: BigString, integrationId: BigString) => Promise<void>;
|
|
1051
|
-
};
|
|
1052
|
-
/** Methods related to a guild's invites. */
|
|
1053
|
-
invites: {
|
|
1054
|
-
/**
|
|
1055
|
-
* Creates an invite to a channel in a guild.
|
|
1056
|
-
*
|
|
1057
|
-
* @param channelId - The ID of the channel to create the invite to.
|
|
1058
|
-
* @param options - The parameters for the creation of the invite.
|
|
1059
|
-
* @returns An instance of the created {@link DiscordInvite}.
|
|
1060
|
-
*
|
|
1061
|
-
* @remarks
|
|
1062
|
-
* Requires the `CREATE_INSTANT_INVITE` permission.
|
|
1063
|
-
*
|
|
1064
|
-
* Fires an _Invite Create_ gateway event.
|
|
1065
|
-
*
|
|
1066
|
-
* @privateRemarks
|
|
1067
|
-
* The request body is not optional, and an empty JSON object must be sent regardless of whether any fields are being transmitted.
|
|
1068
|
-
*
|
|
1069
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
|
|
1070
|
-
*/
|
|
1071
|
-
create: (channelId: BigString, options?: CreateChannelInvite) => Promise<Camelize<DiscordInvite>>;
|
|
1072
|
-
/**
|
|
1073
|
-
* Deletes an invite to a channel.
|
|
1074
|
-
*
|
|
1075
|
-
* @param inviteCode - The invite code of the invite to delete.
|
|
1076
|
-
*
|
|
1077
|
-
* @remarks
|
|
1078
|
-
* Requires the `MANAGE_CHANNELS` permission.
|
|
1079
|
-
*
|
|
1080
|
-
* Fires an _Invite Delete_ gateway event.
|
|
1081
|
-
*
|
|
1082
|
-
* @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-invite}
|
|
1083
|
-
*/
|
|
1084
|
-
delete: (inviteCode: string, reason?: string) => Promise<void>;
|
|
1085
|
-
/**
|
|
1086
|
-
* Gets an invite to a channel by its invite code.
|
|
1087
|
-
*
|
|
1088
|
-
* @param inviteCode - The invite code of the invite to get.
|
|
1089
|
-
* @param options - The parameters for the fetching of the invite.
|
|
1090
|
-
* @returns An instance of {@link DiscordInviteMetadata}.
|
|
1091
|
-
*
|
|
1092
|
-
* @see {@link https://discord.com/developers/docs/resources/invite#get-invite}
|
|
1093
|
-
*/
|
|
1094
|
-
get: (inviteCode: string, options?: GetInvite) => Promise<Camelize<DiscordInviteMetadata>>;
|
|
1095
|
-
/**
|
|
1096
|
-
* Gets the list of invites for a guild.
|
|
1097
|
-
*
|
|
1098
|
-
* @param guildId - The ID of the guild to get the invites from.
|
|
1099
|
-
* @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
|
|
1100
|
-
*
|
|
1101
|
-
* @remarks
|
|
1102
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1103
|
-
*
|
|
1104
|
-
* @see {@link https://discord.com/developers/docs/resources/invite#get-invites}
|
|
1105
|
-
*/
|
|
1106
|
-
list: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
|
|
1107
|
-
};
|
|
1108
|
-
/** Methods related to a guild's templates. */
|
|
1109
|
-
templates: {
|
|
1110
|
-
/**
|
|
1111
|
-
* Creates a template from a guild.
|
|
1112
|
-
*
|
|
1113
|
-
* @param guildId - The ID of the guild to create the template from.
|
|
1114
|
-
* @param options - The parameters for the creation of the template.
|
|
1115
|
-
* @returns An instance of the created {@link Template}.
|
|
1116
|
-
*
|
|
1117
|
-
* @remarks
|
|
1118
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1119
|
-
*
|
|
1120
|
-
* Fires a _Guild Update_ gateway event.
|
|
1121
|
-
*
|
|
1122
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
|
|
1123
|
-
*/
|
|
1124
|
-
create: (guildId: BigString, options: CreateTemplate) => Promise<Camelize<DiscordTemplate>>;
|
|
1125
|
-
/**
|
|
1126
|
-
* Deletes a template from a guild.
|
|
1127
|
-
*
|
|
1128
|
-
* @param guildId - The ID of the guild to delete the template from.
|
|
1129
|
-
* @param templateCode - The code of the template to delete.
|
|
1130
|
-
*
|
|
1131
|
-
* @remarks
|
|
1132
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1133
|
-
*
|
|
1134
|
-
* Fires a _Guild Update_ gateway event.
|
|
1135
|
-
*
|
|
1136
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#delete-guild-template}
|
|
1137
|
-
*/
|
|
1138
|
-
delete: (guildId: BigString, templateCode: string) => Promise<void>;
|
|
1139
|
-
/**
|
|
1140
|
-
* Edits a template's settings.
|
|
1141
|
-
*
|
|
1142
|
-
* @param guildId - The ID of the guild to edit a template of.
|
|
1143
|
-
* @param templateCode - The code of the template to edit.
|
|
1144
|
-
* @param options - The parameters for the edit of the template.
|
|
1145
|
-
* @returns An instance of the edited {@link Template}.
|
|
1146
|
-
*
|
|
1147
|
-
* @remarks
|
|
1148
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1149
|
-
*
|
|
1150
|
-
* Fires a _Guild Update_ gateway event.
|
|
1151
|
-
*
|
|
1152
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#modify-guild-template}
|
|
1153
|
-
*/
|
|
1154
|
-
edit: (guildId: BigString, templateCode: string, options: ModifyGuildTemplate) => Promise<Camelize<DiscordTemplate>>;
|
|
1155
|
-
/**
|
|
1156
|
-
* Gets a template by its code.
|
|
1157
|
-
*
|
|
1158
|
-
* @param templateCode - The code of the template to get.
|
|
1159
|
-
* @returns An instance of {@link Template}.
|
|
1160
|
-
*
|
|
1161
|
-
* @remarks
|
|
1162
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1163
|
-
*
|
|
1164
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-template}
|
|
1165
|
-
*/
|
|
1166
|
-
get: (templateCode: string) => Promise<Camelize<DiscordTemplate>>;
|
|
1167
|
-
/**
|
|
1168
|
-
* Gets the list of templates for a guild.
|
|
1169
|
-
*
|
|
1170
|
-
* @param guildId - The ID of the guild to get the list of templates for.
|
|
1171
|
-
* @returns A collection of {@link Template} objects assorted by template code.
|
|
1172
|
-
*
|
|
1173
|
-
* @remarks
|
|
1174
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1175
|
-
*
|
|
1176
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
|
|
1177
|
-
*/
|
|
1178
|
-
list: (guildId: BigString) => Promise<Camelize<DiscordTemplate[]>>;
|
|
1179
|
-
/**
|
|
1180
|
-
* Synchronises a template with the current state of a guild.
|
|
1181
|
-
*
|
|
1182
|
-
* @param guildId - The ID of the guild to synchronise a template of.
|
|
1183
|
-
* @returns An instance of the edited {@link Template}.
|
|
1184
|
-
*
|
|
1185
|
-
* @remarks
|
|
1186
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1187
|
-
*
|
|
1188
|
-
* Fires a _Guild Update_ gateway event.
|
|
1189
|
-
*
|
|
1190
|
-
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
|
|
1191
|
-
*/
|
|
1192
|
-
sync: (guildId: BigString) => Promise<Camelize<DiscordTemplate>>;
|
|
1193
|
-
};
|
|
1194
|
-
members: {
|
|
1195
|
-
/**
|
|
1196
|
-
* Bans a user from a guild.
|
|
1197
|
-
*
|
|
1198
|
-
* @param guildId - The ID of the guild to ban the user from.
|
|
1199
|
-
* @param userId - The ID of the user to ban from the guild.
|
|
1200
|
-
* @param options - The parameters for the creation of the ban.
|
|
1201
|
-
*
|
|
1202
|
-
* @remarks
|
|
1203
|
-
* Requires the `BAN_MEMBERS` permission.
|
|
1204
|
-
*
|
|
1205
|
-
* Fires a _Guild Ban Add_ gateway event.
|
|
1206
|
-
*
|
|
1207
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban}
|
|
1208
|
-
*/
|
|
1209
|
-
ban: (guildId: BigString, userId: BigString, options?: CreateGuildBan) => Promise<void>;
|
|
1210
|
-
/**
|
|
1211
|
-
* Edits the nickname of the bot user.
|
|
1212
|
-
*
|
|
1213
|
-
* @param guildId - The ID of the guild to edit the nickname of the bot user in.
|
|
1214
|
-
* @param options - The parameters for the edit of the nickname.
|
|
1215
|
-
* @returns An instance of the edited {@link DiscordMember}
|
|
1216
|
-
*
|
|
1217
|
-
* @remarks
|
|
1218
|
-
* Fires a _Guild Member Update_ gateway event.
|
|
1219
|
-
*
|
|
1220
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#modify-current-member}
|
|
1221
|
-
*/
|
|
1222
|
-
editSelf: (guildId: BigString, options: EditBotMemberOptions) => Promise<Camelize<DiscordMember>>;
|
|
1223
|
-
/**
|
|
1224
|
-
* Edits a member's properties.
|
|
1225
|
-
*
|
|
1226
|
-
* @param guildId - The ID of the guild to edit the member of.
|
|
1227
|
-
* @param userId - The user ID of the member to edit.
|
|
1228
|
-
* @param options - The parameters for the edit of the user.
|
|
1229
|
-
*
|
|
1230
|
-
* @remarks
|
|
1231
|
-
* This endpoint requires various permissions depending on what is edited about the member.
|
|
1232
|
-
* To find out the required permission to enact a change, read the documentation of this endpoint's {@link ModifyGuildMember | parameters}.
|
|
1233
|
-
*
|
|
1234
|
-
* Fires a _Guild Member Update_ gateway event.
|
|
1235
|
-
*
|
|
1236
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-member}
|
|
1237
|
-
*/
|
|
1238
|
-
edit: (guildId: BigString, userId: BigString, options: ModifyGuildMember) => Promise<Camelize<DiscordMember>>;
|
|
1239
|
-
/**
|
|
1240
|
-
* Gets or creates a DM channel with a user.
|
|
1241
|
-
*
|
|
1242
|
-
* @param userId - The ID of the user to create the DM channel with.
|
|
1243
|
-
* @returns An instance of {@link Channel}.
|
|
1244
|
-
*
|
|
1245
|
-
* @see {@link https://discord.com/developers/docs/resources/user#create-dm}
|
|
1246
|
-
*/
|
|
1247
|
-
dm: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
1248
|
-
/**
|
|
1249
|
-
* Gets the member object by user ID.
|
|
1250
|
-
*
|
|
1251
|
-
* @param guildId - The ID of the guild to get the member object for.
|
|
1252
|
-
* @param userId - The ID of the user to get the member object for.
|
|
1253
|
-
* @returns An instance of {@link DiscordMemberWithUser}.
|
|
1254
|
-
*
|
|
1255
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
|
|
1256
|
-
*/
|
|
1257
|
-
get: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordMemberWithUser>>;
|
|
1258
|
-
/**
|
|
1259
|
-
* Gets the list of members for a guild.
|
|
1260
|
-
*
|
|
1261
|
-
* @param guildId - The ID of the guild to get the list of members for.
|
|
1262
|
-
* @param options - The parameters for the fetching of the members.
|
|
1263
|
-
* @returns A collection of {@link DiscordMemberWithUser} objects assorted by user ID.
|
|
1264
|
-
*
|
|
1265
|
-
* @remarks
|
|
1266
|
-
* Requires the `GUILD_MEMBERS` intent.
|
|
1267
|
-
*
|
|
1268
|
-
* ⚠️ It is not recommended to use this endpoint with very large bots. Instead, opt to use `fetchMembers()`:
|
|
1269
|
-
* REST communication only permits 50 requests to be made per second, while gateways allow for up to 120 requests
|
|
1270
|
-
* per minute per shard. For more information, read {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}.
|
|
1271
|
-
*
|
|
1272
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
|
|
1273
|
-
* @see {@link https://discord.com/developers/docs/topics/gateway#request-guild-members}
|
|
1274
|
-
* @see {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}
|
|
1275
|
-
*/
|
|
1276
|
-
list: (guildId: BigString, options: ListGuildMembers) => Promise<Camelize<DiscordMemberWithUser[]>>;
|
|
1277
|
-
/**
|
|
1278
|
-
* Kicks a member from a guild.
|
|
1279
|
-
*
|
|
1280
|
-
* @param guildId - The ID of the guild to kick the member from.
|
|
1281
|
-
* @param userId - The user ID of the member to kick from the guild.
|
|
1282
|
-
*
|
|
1283
|
-
* @remarks
|
|
1284
|
-
* Requires the `KICK_MEMBERS` permission.
|
|
1285
|
-
*
|
|
1286
|
-
* Fires a _Guild Member Remove_ gateway event.
|
|
1287
|
-
*
|
|
1288
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
|
|
1289
|
-
*/
|
|
1290
|
-
kick: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
|
|
1291
|
-
/**
|
|
1292
|
-
* Initiates the process of pruning inactive members.
|
|
1293
|
-
*
|
|
1294
|
-
* @param guildId - The ID of the guild to prune the members of.
|
|
1295
|
-
* @param options - The parameters for the pruning of members.
|
|
1296
|
-
* @returns A number indicating how many members were pruned.
|
|
1297
|
-
*
|
|
1298
|
-
* @remarks
|
|
1299
|
-
* Requires the `KICK_MEMBERS` permission.
|
|
1300
|
-
*
|
|
1301
|
-
* ❗ Requests to this endpoint will time out for large guilds. To prevent this from happening, set the {@link BeginGuildPrune.computePruneCount} property of the {@link options} object parameter to `false`. This will begin the process of pruning, and immediately return `undefined`, rather than wait for the process to complete before returning the actual count of members that have been kicked.
|
|
1302
|
-
*
|
|
1303
|
-
* ⚠️ By default, this process will not remove members with a role. To include the members who have a _particular subset of roles_, specify the role(s) in the {@link BeginGuildPrune.includeRoles | includeRoles} property of the {@link options} object parameter.
|
|
1304
|
-
*
|
|
1305
|
-
* Fires a _Guild Member Remove_ gateway event for every member kicked.
|
|
1306
|
-
*
|
|
1307
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#begin-guild-prune}
|
|
1308
|
-
*/
|
|
1309
|
-
prune: (guildId: BigString, options: BeginGuildPrune) => Promise<{
|
|
1310
|
-
pruned: number | null;
|
|
1311
|
-
}>;
|
|
1312
|
-
/**
|
|
1313
|
-
* Gets the list of members whose usernames or nicknames start with a provided string.
|
|
1314
|
-
*
|
|
1315
|
-
* @param guildId - The ID of the guild to search in.
|
|
1316
|
-
* @param query - The string to match usernames or nicknames against.
|
|
1317
|
-
* @param options - The parameters for searching through the members.
|
|
1318
|
-
* @returns A collection of {@link DiscordMember} objects assorted by user ID.
|
|
1319
|
-
*
|
|
1320
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#search-guild-members}
|
|
1321
|
-
*/
|
|
1322
|
-
search: (guildId: BigString, query: string, options?: Omit<SearchMembers, 'query'>) => Promise<Camelize<DiscordMemberWithUser[]>>;
|
|
1323
|
-
/**
|
|
1324
|
-
* Unbans a user from a guild.
|
|
1325
|
-
*
|
|
1326
|
-
* @param guildId - The ID of the guild to unban the user in.
|
|
1327
|
-
* @param userId - The ID of the user to unban.
|
|
1328
|
-
*
|
|
1329
|
-
* @remarks
|
|
1330
|
-
* Requires the `BAN_MEMBERS` permission.
|
|
1331
|
-
*
|
|
1332
|
-
* Fires a _Guild Ban Remove_ gateway event.
|
|
1333
|
-
*
|
|
1334
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
|
|
1335
|
-
*/
|
|
1336
|
-
unban: (guildId: BigString, userId: BigString) => Promise<void>;
|
|
1337
|
-
};
|
|
1338
|
-
/** Interaction related helper methods. */
|
|
1339
|
-
interactions: {
|
|
1340
|
-
/** Command related helper methods. */
|
|
1341
|
-
commands: {
|
|
1342
|
-
/** Methods for creating a command. */
|
|
1343
|
-
create: {
|
|
1344
|
-
/**
|
|
1345
|
-
* Creates an application command accessible globally; across different guilds and channels.
|
|
1346
|
-
*
|
|
1347
|
-
* @param command - The command to create.
|
|
1348
|
-
* @returns An instance of the created {@link ApplicationCommand}.
|
|
1349
|
-
*
|
|
1350
|
-
* @remarks
|
|
1351
|
-
* ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
|
|
1352
|
-
* ⚠️ Global commands once created are cached for periods of __an hour__, so changes made to existing commands will take an hour to surface.
|
|
1353
|
-
* ⚠️ You can only create up to 200 _new_ commands daily.
|
|
1354
|
-
*
|
|
1355
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
|
|
1356
|
-
*/
|
|
1357
|
-
global: (command: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1358
|
-
/**
|
|
1359
|
-
* Creates an application command only accessible in a specific guild.
|
|
1360
|
-
*
|
|
1361
|
-
* @param command - The command to create.
|
|
1362
|
-
* @param guildId - The ID of the guild to create the command for.
|
|
1363
|
-
* @returns An instance of the created {@link ApplicationCommand}.
|
|
1364
|
-
*
|
|
1365
|
-
* @remarks
|
|
1366
|
-
* ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
|
|
1367
|
-
* ⚠️ You can only create up to 200 _new_ commands daily.
|
|
1368
|
-
*
|
|
1369
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
|
|
1370
|
-
*/
|
|
1371
|
-
guild: (command: CreateApplicationCommand, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1372
|
-
};
|
|
1373
|
-
/** Methods for deleting a command. */
|
|
1374
|
-
delete: {
|
|
1375
|
-
/**
|
|
1376
|
-
* Deletes an application command registered globally.
|
|
1377
|
-
*
|
|
1378
|
-
* @param commandId - The ID of the command to delete.
|
|
1379
|
-
*
|
|
1380
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
|
|
1381
|
-
*/
|
|
1382
|
-
global: (commandId: BigString) => Promise<void>;
|
|
1383
|
-
/**
|
|
1384
|
-
* Deletes an application command registered in a guild.
|
|
1385
|
-
*
|
|
1386
|
-
* @param guildId - The ID of the guild to delete the command from.
|
|
1387
|
-
* @param commandId - The ID of the command to delete from the guild.
|
|
1388
|
-
*
|
|
1389
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
|
|
1390
|
-
*/
|
|
1391
|
-
guild: (commandId: BigString, guildId: BigString) => Promise<void>;
|
|
1392
|
-
};
|
|
1393
|
-
/** Methods for editing a command. */
|
|
1394
|
-
edit: {
|
|
1395
|
-
/**
|
|
1396
|
-
* Edits a global application command.
|
|
1397
|
-
*
|
|
1398
|
-
* @param commandId - The ID of the command to edit.
|
|
1399
|
-
* @param options - The parameters for the edit of the command.
|
|
1400
|
-
* @returns An instance of the edited {@link ApplicationCommand}.
|
|
1401
|
-
*
|
|
1402
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
|
|
1403
|
-
*/
|
|
1404
|
-
global: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1405
|
-
/**
|
|
1406
|
-
* Edits an application command registered in a guild.
|
|
1407
|
-
*
|
|
1408
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
1409
|
-
* @param commandId - The ID of the command to edit.
|
|
1410
|
-
* @param options - The parameters for the edit of the command.
|
|
1411
|
-
* @returns An instance of the edited {@link ApplicationCommand}.
|
|
1412
|
-
*
|
|
1413
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
|
|
1414
|
-
*/
|
|
1415
|
-
guild: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1416
|
-
/**
|
|
1417
|
-
* Edits the permissions for a guild application command.
|
|
1418
|
-
*
|
|
1419
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
1420
|
-
* @param commandId - The ID of the command to edit the permissions of.
|
|
1421
|
-
* @param bearerToken - The bearer token to use to make the request.
|
|
1422
|
-
* @param options - The parameters for the edit of the command permissions.
|
|
1423
|
-
* @returns An instance of the edited {@link ApplicationCommandPermission}.
|
|
1424
|
-
*
|
|
1425
|
-
* @remarks
|
|
1426
|
-
* The bearer token requires the `applications.commands.permissions.update` scope to be enabled, and to have access to the guild whose ID has been provided in the parameters.
|
|
1427
|
-
*
|
|
1428
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
|
|
1429
|
-
*/
|
|
1430
|
-
permissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: ApplicationCommandPermissions[]) => Promise<Camelize<DiscordApplicationCommandPermissions>>;
|
|
1431
|
-
};
|
|
1432
|
-
/** Methods for getting a command. */
|
|
1433
|
-
get: {
|
|
1434
|
-
global: {
|
|
1435
|
-
/**
|
|
1436
|
-
* Gets a global application command by its ID.
|
|
1437
|
-
*
|
|
1438
|
-
* @param commandId - The ID of the command to get.
|
|
1439
|
-
* @returns An instance of {@link ApplicationCommand}.
|
|
1440
|
-
*
|
|
1441
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-command}
|
|
1442
|
-
*/
|
|
1443
|
-
one: (commandId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1444
|
-
/**
|
|
1445
|
-
* Gets the list of your bot's global application commands.
|
|
1446
|
-
*
|
|
1447
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
1448
|
-
*
|
|
1449
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
|
|
1450
|
-
*/
|
|
1451
|
-
all: () => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
1452
|
-
};
|
|
1453
|
-
guilds: {
|
|
1454
|
-
/**
|
|
1455
|
-
* Gets a guild application command by its ID.
|
|
1456
|
-
*
|
|
1457
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
1458
|
-
* @param commandId - The ID of the command to get.
|
|
1459
|
-
* @returns An instance of {@link ApplicationCommand}.
|
|
1460
|
-
*
|
|
1461
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command}
|
|
1462
|
-
*/
|
|
1463
|
-
one: (commandId: BigString, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1464
|
-
/**
|
|
1465
|
-
* Gets the list of application commands registered by your bot in a guild.
|
|
1466
|
-
*
|
|
1467
|
-
* @param guildId - The ID of the guild the commands are registered in.
|
|
1468
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
1469
|
-
*
|
|
1470
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
|
|
1471
|
-
*/
|
|
1472
|
-
all: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
1473
|
-
};
|
|
1474
|
-
/**
|
|
1475
|
-
* Gets the permissions of a guild application command.
|
|
1476
|
-
*
|
|
1477
|
-
* @param guildId - The ID of the guild the command is registered in.
|
|
1478
|
-
* @param commandId - The ID of the command to get the permissions of.
|
|
1479
|
-
* @returns An instance of {@link ApplicationCommandPermission}.
|
|
1480
|
-
*
|
|
1481
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
|
|
1482
|
-
*/
|
|
1483
|
-
permission: (guildId: BigString, commandId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions>>;
|
|
1484
|
-
/**
|
|
1485
|
-
* Gets the permissions of all application commands registered in a guild by the ID of the guild.
|
|
1486
|
-
*
|
|
1487
|
-
* @param guildId - The ID of the guild to get the permissions objects of.
|
|
1488
|
-
* @returns A collection of {@link ApplicationCommandPermission} objects assorted by command ID.
|
|
1489
|
-
*
|
|
1490
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
|
|
1491
|
-
*/
|
|
1492
|
-
permissions: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions[]>>;
|
|
1493
|
-
};
|
|
1494
|
-
/** Methods for replacing existing commands in bulk. */
|
|
1495
|
-
replace: {
|
|
1496
|
-
/**
|
|
1497
|
-
* Re-registers the list of global application commands, overwriting the previous commands completely.
|
|
1498
|
-
*
|
|
1499
|
-
* @param commands - The list of commands to use to overwrite the previous list.
|
|
1500
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
1501
|
-
*
|
|
1502
|
-
* @remarks
|
|
1503
|
-
* ❗ Commands that are not present in the `commands` array will be __deleted__.
|
|
1504
|
-
*
|
|
1505
|
-
* ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
|
|
1506
|
-
*
|
|
1507
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands}
|
|
1508
|
-
*/
|
|
1509
|
-
global: (commands: CreateApplicationCommand[]) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
1510
|
-
/**
|
|
1511
|
-
* Re-registers the list of application commands registered in a guild, overwriting the previous commands completely.
|
|
1512
|
-
*
|
|
1513
|
-
* @param guildId - The ID of the guild whose list of commands to overwrite.
|
|
1514
|
-
* @param commands - The list of commands to use to overwrite the previous list.
|
|
1515
|
-
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
1516
|
-
*
|
|
1517
|
-
* @remarks
|
|
1518
|
-
* ❗ Commands that are not present in the `commands` array will be __deleted__.
|
|
1519
|
-
*
|
|
1520
|
-
* ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
|
|
1521
|
-
*
|
|
1522
|
-
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands}
|
|
1523
|
-
*/
|
|
1524
|
-
guild: (guildId: BigString, commands: CreateApplicationCommand[]) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
1525
|
-
};
|
|
1526
|
-
};
|
|
1527
|
-
/** Response related helper methods. */
|
|
1528
|
-
responses: {
|
|
1529
|
-
/** Helper methods related to creating a response. */
|
|
1530
|
-
create: {
|
|
1531
|
-
/**
|
|
1532
|
-
* Sends a follow-up message to an interaction.
|
|
1533
|
-
*
|
|
1534
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1535
|
-
* @param options - The parameters for the creation of the message.
|
|
1536
|
-
* @returns An instance of the created {@link Message}.
|
|
1537
|
-
*
|
|
1538
|
-
* @remarks
|
|
1539
|
-
* ⚠️ Interaction tokens are only valid for _15 minutes_.
|
|
1540
|
-
*
|
|
1541
|
-
* By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
|
|
1542
|
-
*
|
|
1543
|
-
* Unlike `sendMessage()`, this endpoint allows the bot user to act without:
|
|
1544
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
1545
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
1546
|
-
*
|
|
1547
|
-
* Fires a _Message Create_ event.
|
|
1548
|
-
*
|
|
1549
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message}
|
|
1550
|
-
*/
|
|
1551
|
-
followup: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
|
|
1552
|
-
/**
|
|
1553
|
-
* Sends a response to an interaction.
|
|
1554
|
-
*
|
|
1555
|
-
* @param interactionId - The ID of the interaction to respond to.
|
|
1556
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1557
|
-
* @param options - The parameters for the creation of the message.
|
|
1558
|
-
* @returns An instance of the created {@link Message}.
|
|
1559
|
-
*
|
|
1560
|
-
* @remarks
|
|
1561
|
-
* ⚠️ Interaction tokens are only valid for _15 minutes_.
|
|
1562
|
-
*
|
|
1563
|
-
* By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
|
|
1564
|
-
*
|
|
1565
|
-
* Unlike `sendMessage()`, this endpoint allows the bot user to act without:
|
|
1566
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
1567
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
1568
|
-
*
|
|
1569
|
-
* Fires a _Message Create_ event.
|
|
1570
|
-
*
|
|
1571
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1572
|
-
*/
|
|
1573
|
-
original: (interactionId: BigString, token: string, options: InteractionResponse) => Promise<void>;
|
|
1574
|
-
};
|
|
1575
|
-
/** Helper methods related to deleting a response. */
|
|
1576
|
-
delete: {
|
|
1577
|
-
/**
|
|
1578
|
-
* Deletes a follow-up message to an interaction.
|
|
1579
|
-
*
|
|
1580
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1581
|
-
* @param messageId - The ID of the message to delete.
|
|
1582
|
-
*
|
|
1583
|
-
* @remarks
|
|
1584
|
-
* Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
1585
|
-
*
|
|
1586
|
-
* Fires a _Message Delete_ event.
|
|
1587
|
-
*
|
|
1588
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message}
|
|
1589
|
-
*/
|
|
1590
|
-
followup: (token: string, messageId: BigString) => Promise<void>;
|
|
1591
|
-
/**
|
|
1592
|
-
* Deletes the initial message response to an interaction.
|
|
1593
|
-
*
|
|
1594
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1595
|
-
*
|
|
1596
|
-
* @remarks
|
|
1597
|
-
* Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
1598
|
-
*
|
|
1599
|
-
* Fires a _Message Delete_ event.
|
|
1600
|
-
*
|
|
1601
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
|
|
1602
|
-
*/
|
|
1603
|
-
original: (token: string) => Promise<void>;
|
|
1604
|
-
};
|
|
1605
|
-
/** Helper methods related to editing a response. */
|
|
1606
|
-
edit: {
|
|
1607
|
-
/**
|
|
1608
|
-
* Edits a follow-up message to an interaction.
|
|
1609
|
-
*
|
|
1610
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1611
|
-
* @param messageId - The ID of the message to edit.
|
|
1612
|
-
* @param options - The parameters for the edit of the message.
|
|
1613
|
-
* @returns An instance of the edited {@link Message}.
|
|
1614
|
-
*
|
|
1615
|
-
* @remarks
|
|
1616
|
-
* Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
1617
|
-
*
|
|
1618
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1619
|
-
*
|
|
1620
|
-
* Fires a _Message Update_ event.
|
|
1621
|
-
*
|
|
1622
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message}
|
|
1623
|
-
*/
|
|
1624
|
-
followup: (token: string, messageId: BigString, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
|
|
1625
|
-
/**
|
|
1626
|
-
* Edits the initial message response to an interaction.
|
|
1627
|
-
*
|
|
1628
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1629
|
-
* @param options - The parameters for the edit of the response.
|
|
1630
|
-
* @returns An instance of the edited {@link Message}.
|
|
1631
|
-
*
|
|
1632
|
-
* @remarks
|
|
1633
|
-
* Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
|
|
1634
|
-
*
|
|
1635
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1636
|
-
*
|
|
1637
|
-
* Fires a _Message Update_ event.
|
|
1638
|
-
*
|
|
1639
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response}
|
|
1640
|
-
*/
|
|
1641
|
-
original: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage> | undefined>;
|
|
1642
|
-
};
|
|
1643
|
-
/** Helper methods related to getting a response. */
|
|
1644
|
-
get: {
|
|
1645
|
-
/**
|
|
1646
|
-
* Gets a follow-up message to an interaction by the ID of the message.
|
|
1647
|
-
*
|
|
1648
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1649
|
-
* @param messageId - The ID of the message to get.
|
|
1650
|
-
* @returns An instance of {@link Message}.
|
|
1651
|
-
*
|
|
1652
|
-
* @remarks
|
|
1653
|
-
* Unlike `getMessage()`, this endpoint allows the bot user to act without:
|
|
1654
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
1655
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
1656
|
-
*
|
|
1657
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1658
|
-
*
|
|
1659
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message}
|
|
1660
|
-
*/
|
|
1661
|
-
followup: (token: string, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
1662
|
-
/**
|
|
1663
|
-
* Gets the initial message response to an interaction.
|
|
1664
|
-
*
|
|
1665
|
-
* @param token - The interaction token to use, provided in the original interaction.
|
|
1666
|
-
* @returns An instance of {@link Message}.
|
|
1667
|
-
*
|
|
1668
|
-
* @remarks
|
|
1669
|
-
* Unlike `getMessage()`, this endpoint allows the bot user to act without:
|
|
1670
|
-
* - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
|
|
1671
|
-
* - Requiring the `MESSAGE_CONTENT` intent.
|
|
1672
|
-
*
|
|
1673
|
-
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1674
|
-
*
|
|
1675
|
-
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
|
|
1676
|
-
*/
|
|
1677
|
-
original: (token: string) => Promise<Camelize<DiscordMessage>>;
|
|
1678
|
-
};
|
|
1679
|
-
};
|
|
1680
|
-
};
|
|
1681
|
-
};
|
|
1682
|
-
/** Webhook related helper methods. */
|
|
1683
|
-
webhooks: {
|
|
1684
|
-
/**
|
|
1685
|
-
* Creates a webhook.
|
|
1686
|
-
*
|
|
1687
|
-
* @param channelId - The ID of the channel to create the webhook in.
|
|
1688
|
-
* @param options - The parameters for the creation of the webhook.
|
|
1689
|
-
* @returns An instance of the created {@link DiscordWebhook}.
|
|
1690
|
-
*
|
|
1691
|
-
* @remarks
|
|
1692
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1693
|
-
*
|
|
1694
|
-
* ⚠️ The webhook name must not contain the string 'clyde' (case-insensitive).
|
|
1695
|
-
*
|
|
1696
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
1697
|
-
*
|
|
1698
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#create-webhook}
|
|
1699
|
-
*/
|
|
1700
|
-
create: (channelId: BigString, options: CreateWebhook) => Promise<Camelize<DiscordWebhook>>;
|
|
1701
|
-
/** Methods to delete a webhook. */
|
|
1702
|
-
delete: {
|
|
1703
|
-
with: {
|
|
1704
|
-
/**
|
|
1705
|
-
* Deletes a webhook.
|
|
1706
|
-
*
|
|
1707
|
-
* @param id - The ID of the webhook to delete.
|
|
1708
|
-
*
|
|
1709
|
-
* @remarks
|
|
1710
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1711
|
-
*
|
|
1712
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
1713
|
-
*
|
|
1714
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
|
|
1715
|
-
*/
|
|
1716
|
-
id: (id: BigString, reason?: string) => Promise<void>;
|
|
1717
|
-
/**
|
|
1718
|
-
* Deletes a webhook message using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
1719
|
-
*
|
|
1720
|
-
* @param id - The ID of the webhook to delete the message belonging to.
|
|
1721
|
-
* @param token - The webhook token, used to delete the webhook.
|
|
1722
|
-
*
|
|
1723
|
-
* @remarks
|
|
1724
|
-
* Fires a _Message Delete_ gateway event.
|
|
1725
|
-
*
|
|
1726
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token}
|
|
1727
|
-
*/
|
|
1728
|
-
token: (id: BigString, token: string) => Promise<void>;
|
|
1729
|
-
};
|
|
1730
|
-
};
|
|
1731
|
-
/** Methods related to editing a webhook. */
|
|
1732
|
-
edit: {
|
|
1733
|
-
with: {
|
|
1734
|
-
/**
|
|
1735
|
-
* Edits a webhook.
|
|
1736
|
-
*
|
|
1737
|
-
* @param webhookId - The ID of the webhook to edit.
|
|
1738
|
-
* @returns An instance of the edited {@link DiscordWebhook}.
|
|
1739
|
-
*
|
|
1740
|
-
* @remarks
|
|
1741
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1742
|
-
*
|
|
1743
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
1744
|
-
*
|
|
1745
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook}
|
|
1746
|
-
*/
|
|
1747
|
-
id: (webhookId: BigString, options: ModifyWebhook) => Promise<Camelize<DiscordWebhook>>;
|
|
1748
|
-
/**
|
|
1749
|
-
* Edits a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
1750
|
-
*
|
|
1751
|
-
* @param webhookId - The ID of the webhook to edit.
|
|
1752
|
-
* @param token - The webhook token, used to edit the webhook.
|
|
1753
|
-
* @returns An instance of the edited {@link DiscordWebhook}.
|
|
1754
|
-
*
|
|
1755
|
-
* @remarks
|
|
1756
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1757
|
-
*
|
|
1758
|
-
* Fires a _Webhooks Update_ gateway event.
|
|
1759
|
-
*
|
|
1760
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
|
|
1761
|
-
*/
|
|
1762
|
-
token: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
|
|
1763
|
-
};
|
|
1764
|
-
};
|
|
1765
|
-
/**
|
|
1766
|
-
* Executes a webhook, causing a message to be posted in the channel configured for the webhook.
|
|
1767
|
-
*
|
|
1768
|
-
* @param webhookId - The ID of the webhook to execute.
|
|
1769
|
-
* @param token - The webhook token, used to execute the webhook.
|
|
1770
|
-
* @param options - The parameters for the execution of the webhook.
|
|
1771
|
-
* @returns An instance of the created {@link DiscordMessage}, or `undefined` if the {@link ExecuteWebhook.wait | wait} property of the {@link options} object parameter is set to `false`.
|
|
1772
|
-
*
|
|
1773
|
-
* @remarks
|
|
1774
|
-
* If the webhook channel is a forum channel, you must provide a value for either `threadId` or `threadName`.
|
|
1775
|
-
*
|
|
1776
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
|
|
1777
|
-
*/
|
|
1778
|
-
execute: (webhookId: BigString, token: string, options: ExecuteWebhook) => Promise<Camelize<DiscordMessage> | undefined>;
|
|
1779
|
-
/** Methods related to getting webhooks. */
|
|
1780
|
-
get: {
|
|
1781
|
-
/**
|
|
1782
|
-
* Gets a list of webhooks for a channel.
|
|
1783
|
-
*
|
|
1784
|
-
* @param channelId - The ID of the channel which to get the webhooks of.
|
|
1785
|
-
* @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
|
|
1786
|
-
*
|
|
1787
|
-
* @remarks
|
|
1788
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1789
|
-
*
|
|
1790
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-channel-webhooks}
|
|
1791
|
-
*/
|
|
1792
|
-
channel: (channelId: BigString) => Promise<Camelize<DiscordWebhook[]>>;
|
|
1793
|
-
/**
|
|
1794
|
-
* Gets the list of webhooks for a guild.
|
|
1795
|
-
*
|
|
1796
|
-
* @param guildId - The ID of the guild to get the list of webhooks for.
|
|
1797
|
-
* @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
|
|
1798
|
-
*
|
|
1799
|
-
* @remarks
|
|
1800
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1801
|
-
*
|
|
1802
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
|
|
1803
|
-
*/
|
|
1804
|
-
guild: (guildId: BigString) => Promise<Camelize<DiscordWebhook[]>>;
|
|
1805
|
-
/**
|
|
1806
|
-
* Gets a webhook message by its ID.
|
|
1807
|
-
*
|
|
1808
|
-
* @param webhookId - The ID of the webhook to get a message of.
|
|
1809
|
-
* @param token - The webhook token, used to get webhook messages.
|
|
1810
|
-
* @param messageId - the ID of the webhook message to get.
|
|
1811
|
-
* @param options - The parameters for the fetching of the message.
|
|
1812
|
-
* @returns An instance of {@link DiscordMessage}.
|
|
1813
|
-
*
|
|
1814
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-message}
|
|
1815
|
-
*/
|
|
1816
|
-
message: (webhookId: BigString, token: string, messageId: BigString, options?: GetWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
1817
|
-
with: {
|
|
1818
|
-
/**
|
|
1819
|
-
* Gets a webhook by its ID.
|
|
1820
|
-
*
|
|
1821
|
-
* @param webhookId - The ID of the webhook to get.
|
|
1822
|
-
* @returns An instance of {@link DiscordWebhook}.
|
|
1823
|
-
*
|
|
1824
|
-
* @remarks
|
|
1825
|
-
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1826
|
-
*
|
|
1827
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
|
|
1828
|
-
*/
|
|
1829
|
-
id: (webhookId: BigString) => Promise<Camelize<DiscordWebhook>>;
|
|
1830
|
-
/**
|
|
1831
|
-
* Gets a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
1832
|
-
*
|
|
1833
|
-
* @param webhookId - The ID of the webhook to get.
|
|
1834
|
-
* @param token - The webhook token, used to get the webhook.
|
|
1835
|
-
* @returns An instance of {@link DiscordWebhook}.
|
|
1836
|
-
*
|
|
1837
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
|
|
1838
|
-
*/
|
|
1839
|
-
token: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
|
|
1840
|
-
};
|
|
1841
|
-
};
|
|
1842
|
-
/** Methods related to message sent by a webhook. */
|
|
1843
|
-
messages: {
|
|
1844
|
-
/**
|
|
1845
|
-
* Deletes a webhook message.
|
|
1846
|
-
*
|
|
1847
|
-
* @param webhookId - The ID of the webhook to delete the message belonging to.
|
|
1848
|
-
* @param token - The webhook token, used to manage the webhook.
|
|
1849
|
-
* @param messageId - The ID of the message to delete.
|
|
1850
|
-
* @param options - The parameters for the deletion of the message.
|
|
1851
|
-
*
|
|
1852
|
-
* @remarks
|
|
1853
|
-
* Fires a _Message Delete_ gateway event.
|
|
1854
|
-
*
|
|
1855
|
-
* @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
|
|
1856
|
-
*/
|
|
1857
|
-
delete: (webhookId: BigString, token: string, messageId: BigString, options?: DeleteWebhookMessageOptions) => Promise<void>;
|
|
1858
|
-
/** Methods related to editing messages sent by a webhook. */
|
|
1859
|
-
edit: WebhookMessageEditor;
|
|
1860
|
-
};
|
|
1861
|
-
};
|
|
1862
|
-
/** User related helper methods. */
|
|
1863
|
-
users: {
|
|
1864
|
-
/**
|
|
1865
|
-
* Gets or creates a DM channel with a user.
|
|
1866
|
-
*
|
|
1867
|
-
* @param userId - The ID of the user to create the DM channel with.
|
|
1868
|
-
* @returns An instance of {@link DiscordChannel}.
|
|
1869
|
-
*
|
|
1870
|
-
* @see {@link https://discord.com/developers/docs/resources/user#create-dm}
|
|
1871
|
-
*/
|
|
1872
|
-
channel: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
1873
|
-
};
|
|
317
|
+
/**
|
|
318
|
+
* Adds a reaction to a message.
|
|
319
|
+
*
|
|
320
|
+
* @param channelId - The ID of the channel the message to add a reaction to is in.
|
|
321
|
+
* @param messageId - The ID of the message to add a reaction to.
|
|
322
|
+
* @param reaction - The reaction to add to the message.
|
|
323
|
+
* @returns
|
|
324
|
+
*
|
|
325
|
+
* @remarks
|
|
326
|
+
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
327
|
+
*
|
|
328
|
+
* If nobody else has reacted to the message:
|
|
329
|
+
* - Requires the `ADD_REACTIONS` permission.
|
|
330
|
+
*
|
|
331
|
+
* Fires a _Message Reaction Add_ gateway event.
|
|
332
|
+
*
|
|
333
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#create-reaction}
|
|
334
|
+
*/
|
|
335
|
+
addReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
|
|
336
|
+
/**
|
|
337
|
+
* Adds multiple a reaction to a message.
|
|
338
|
+
*
|
|
339
|
+
* This function uses the `addReaction()` helper behind the scenes.
|
|
340
|
+
*
|
|
341
|
+
* @param channelId - The ID of the channel the message to add reactions to is in.
|
|
342
|
+
* @param messageId - The ID of the message to add the reactions to.
|
|
343
|
+
* @param reactions - The reactions to add to the message.
|
|
344
|
+
* @param ordered - Whether the reactions must be added in order or not.
|
|
345
|
+
*
|
|
346
|
+
* @remarks
|
|
347
|
+
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
348
|
+
*
|
|
349
|
+
* If nobody else has reacted to the message:
|
|
350
|
+
* - Requires the `ADD_REACTIONS` permission.
|
|
351
|
+
*
|
|
352
|
+
* Fires a _Message Reaction Add_ gateway event for every reaction added.
|
|
353
|
+
*/
|
|
354
|
+
addReactions: (channelId: BigString, messageId: BigString, reactions: string[], ordered?: boolean) => Promise<void>;
|
|
355
|
+
/**
|
|
356
|
+
* Adds a role to a member.
|
|
357
|
+
*
|
|
358
|
+
* @param guildId - The ID of the guild the member to add the role to is in.
|
|
359
|
+
* @param userId - The user ID of the member to add the role to.
|
|
360
|
+
* @param roleId - The ID of the role to add to the member.
|
|
361
|
+
*
|
|
362
|
+
* @remarks
|
|
363
|
+
* Requires the `MANAGE_ROLES` permission.
|
|
364
|
+
*
|
|
365
|
+
* Fires a _Guild Member Update_ gateway event.
|
|
366
|
+
*
|
|
367
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#add-guild-member-role}
|
|
368
|
+
*/
|
|
369
|
+
addRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
|
|
1874
370
|
/**
|
|
1875
371
|
* Adds a member to a thread.
|
|
1876
372
|
*
|
|
@@ -1969,6 +465,20 @@ export interface RestManager {
|
|
|
1969
465
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
|
|
1970
466
|
*/
|
|
1971
467
|
createGlobalApplicationCommand: (command: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
468
|
+
/**
|
|
469
|
+
* Creates a guild.
|
|
470
|
+
*
|
|
471
|
+
* @param options - The parameters for the creation of the guild.
|
|
472
|
+
* @returns An instance of the created {@link DiscordGuild}.
|
|
473
|
+
*
|
|
474
|
+
* @remarks
|
|
475
|
+
* ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
|
|
476
|
+
*
|
|
477
|
+
* Fires a _Guild Create_ gateway event.
|
|
478
|
+
*
|
|
479
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
|
|
480
|
+
*/
|
|
481
|
+
createGuild: (options: CreateGuild) => Promise<Camelize<DiscordGuild>>;
|
|
1972
482
|
/**
|
|
1973
483
|
* Creates an application command only accessible in a specific guild.
|
|
1974
484
|
*
|
|
@@ -1983,6 +493,36 @@ export interface RestManager {
|
|
|
1983
493
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
|
|
1984
494
|
*/
|
|
1985
495
|
createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
496
|
+
/**
|
|
497
|
+
* Creates a guild from a template.
|
|
498
|
+
*
|
|
499
|
+
* @param templateCode - The code of the template.
|
|
500
|
+
* @param options - The parameters for the creation of the guild.
|
|
501
|
+
* @returns An instance of the created {@link Guild}.
|
|
502
|
+
*
|
|
503
|
+
* @remarks
|
|
504
|
+
* ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
|
|
505
|
+
*
|
|
506
|
+
* Fires a _Guild Create_ gateway event.
|
|
507
|
+
*
|
|
508
|
+
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template}
|
|
509
|
+
*/
|
|
510
|
+
createGuildFromTemplate: (templateCode: string, options: CreateGuildFromTemplate) => Promise<Camelize<DiscordGuild>>;
|
|
511
|
+
/**
|
|
512
|
+
* Create a new sticker for the guild.
|
|
513
|
+
*
|
|
514
|
+
* @param guildId The ID of the guild to get
|
|
515
|
+
* @return A {@link DiscordSticker}
|
|
516
|
+
*
|
|
517
|
+
* @remarks
|
|
518
|
+
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
519
|
+
* Fires a Guild Stickers Update Gateway event.
|
|
520
|
+
* Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
|
|
521
|
+
* Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
|
|
522
|
+
*
|
|
523
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
|
|
524
|
+
*/
|
|
525
|
+
createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions) => Promise<Camelize<DiscordSticker>>;
|
|
1986
526
|
/**
|
|
1987
527
|
* Creates a template from a guild.
|
|
1988
528
|
*
|
|
@@ -2016,6 +556,21 @@ export interface RestManager {
|
|
|
2016
556
|
* @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
|
|
2017
557
|
*/
|
|
2018
558
|
createInvite: (channelId: BigString, options?: CreateChannelInvite) => Promise<Camelize<DiscordInvite>>;
|
|
559
|
+
/**
|
|
560
|
+
* Creates a role in a guild.
|
|
561
|
+
*
|
|
562
|
+
* @param guildId - The ID of the guild to create the role in.
|
|
563
|
+
* @param options - The parameters for the creation of the role.
|
|
564
|
+
* @returns An instance of the created {@link DiscordRole}.
|
|
565
|
+
*
|
|
566
|
+
* @remarks
|
|
567
|
+
* Requires the `MANAGE_ROLES` permission.
|
|
568
|
+
*
|
|
569
|
+
* Fires a _Guild Role Create_ gateway event.
|
|
570
|
+
*
|
|
571
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-role}
|
|
572
|
+
*/
|
|
573
|
+
createRole: (guildId: BigString, options: CreateGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
|
|
2019
574
|
/**
|
|
2020
575
|
* Creates a scheduled event in a guild.
|
|
2021
576
|
*
|
|
@@ -2153,6 +708,19 @@ export interface RestManager {
|
|
|
2153
708
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
|
|
2154
709
|
*/
|
|
2155
710
|
deleteGlobalApplicationCommand: (commandId: BigString) => Promise<void>;
|
|
711
|
+
/**
|
|
712
|
+
* Deletes a guild.
|
|
713
|
+
*
|
|
714
|
+
* @param guildId - The ID of the guild to delete.
|
|
715
|
+
*
|
|
716
|
+
* @remarks
|
|
717
|
+
* The bot user must be the owner of the guild.
|
|
718
|
+
*
|
|
719
|
+
* Fires a _Guild Delete_ gateway event.
|
|
720
|
+
*
|
|
721
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
|
|
722
|
+
*/
|
|
723
|
+
deleteGuild: (guildId: BigString) => Promise<void>;
|
|
2156
724
|
/**
|
|
2157
725
|
* Deletes an application command registered in a guild.
|
|
2158
726
|
*
|
|
@@ -2162,6 +730,21 @@ export interface RestManager {
|
|
|
2162
730
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
|
|
2163
731
|
*/
|
|
2164
732
|
deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<void>;
|
|
733
|
+
/**
|
|
734
|
+
* Delete a new sticker for the guild.
|
|
735
|
+
*
|
|
736
|
+
* @param guildId The ID of the guild to get
|
|
737
|
+
* @return A {@link DiscordSticker}
|
|
738
|
+
*
|
|
739
|
+
* @remarks
|
|
740
|
+
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
741
|
+
* Fires a Guild Stickers Update Gateway event.
|
|
742
|
+
* Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
|
|
743
|
+
* Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
|
|
744
|
+
*
|
|
745
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
|
|
746
|
+
*/
|
|
747
|
+
deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
|
|
2165
748
|
/**
|
|
2166
749
|
* Deletes a template from a guild.
|
|
2167
750
|
*
|
|
@@ -2221,6 +804,22 @@ export interface RestManager {
|
|
|
2221
804
|
* @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
|
|
2222
805
|
*/
|
|
2223
806
|
deleteMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
807
|
+
/**
|
|
808
|
+
* Deletes multiple messages from a channel.
|
|
809
|
+
*
|
|
810
|
+
* @param channelId - The ID of the channel to delete the messages from.
|
|
811
|
+
* @param messageIds - The IDs of the messages to delete from the channel.
|
|
812
|
+
*
|
|
813
|
+
* @remarks
|
|
814
|
+
* Requires the `MANAGE_MESSAGES` permission.
|
|
815
|
+
*
|
|
816
|
+
* ⚠️ Messages older than 2 weeks old cannot be deleted.
|
|
817
|
+
*
|
|
818
|
+
* Fires a _Message Delete Bulk_ gateway event.
|
|
819
|
+
*
|
|
820
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#bulk-delete-messages}
|
|
821
|
+
*/
|
|
822
|
+
deleteMessages: (channelId: BigString, messageIds: BigString[], reason?: string) => Promise<void>;
|
|
2224
823
|
/**
|
|
2225
824
|
* Deletes the initial message response to an interaction.
|
|
2226
825
|
*
|
|
@@ -2234,6 +833,68 @@ export interface RestManager {
|
|
|
2234
833
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
|
|
2235
834
|
*/
|
|
2236
835
|
deleteOriginalInteractionResponse: (token: string) => Promise<void>;
|
|
836
|
+
/**
|
|
837
|
+
* Deletes a reaction added by the bot user from a message.
|
|
838
|
+
*
|
|
839
|
+
* @param channelId - The ID of the channel the message to delete the reaction from is in.
|
|
840
|
+
* @param messageId - The ID of the message to delete the reaction from.
|
|
841
|
+
* @param reaction - The reaction to delete from the message.
|
|
842
|
+
*
|
|
843
|
+
* @remarks
|
|
844
|
+
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
845
|
+
*
|
|
846
|
+
* Fires a _Message Reaction Remove_ gateway event.
|
|
847
|
+
*
|
|
848
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#delete-own-reaction}
|
|
849
|
+
*/
|
|
850
|
+
deleteOwnReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
|
|
851
|
+
/**
|
|
852
|
+
* Deletes all reactions for all emojis from a message.
|
|
853
|
+
*
|
|
854
|
+
* @param channelId - The ID of the channel the message to delete the reactions from is in.
|
|
855
|
+
* @param messageId - The ID of the message to delete the reactions from.
|
|
856
|
+
*
|
|
857
|
+
* @remarks
|
|
858
|
+
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
859
|
+
*
|
|
860
|
+
* Requires the `MANAGE_MESSAGES` permission.
|
|
861
|
+
*
|
|
862
|
+
* Fires a _Message Reaction Remove All_ gateway event.
|
|
863
|
+
*
|
|
864
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions}
|
|
865
|
+
*/
|
|
866
|
+
deleteReactionsAll: (channelId: BigString, messageId: BigString) => Promise<void>;
|
|
867
|
+
/**
|
|
868
|
+
* Deletes all reactions for an emoji from a message.
|
|
869
|
+
*
|
|
870
|
+
* @param channelId - The ID of the channel the message to delete the reactions from is in.
|
|
871
|
+
* @param messageId - The ID of the message to delete the reactions from.
|
|
872
|
+
* @param reaction - The reaction to remove from the message.
|
|
873
|
+
*
|
|
874
|
+
* @remarks
|
|
875
|
+
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
876
|
+
*
|
|
877
|
+
* Requires the `MANAGE_MESSAGES` permission.
|
|
878
|
+
*
|
|
879
|
+
* Fires a _Message Reaction Remove Emoji_ gateway event.
|
|
880
|
+
*
|
|
881
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji}
|
|
882
|
+
*/
|
|
883
|
+
deleteReactionsEmoji: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
|
|
884
|
+
/**
|
|
885
|
+
* Deletes a role from a guild.
|
|
886
|
+
*
|
|
887
|
+
* @param guildId - The ID of the guild to delete the role from.
|
|
888
|
+
* @param roleId - The ID of the role to delete.
|
|
889
|
+
*
|
|
890
|
+
* @remarks
|
|
891
|
+
* Requires the `MANAGE_ROLES` permission.
|
|
892
|
+
*
|
|
893
|
+
* Fires a _Guild Role Delete_ gateway event.
|
|
894
|
+
*
|
|
895
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-role}
|
|
896
|
+
*/
|
|
897
|
+
deleteRole: (guildId: BigString, roleId: BigString) => Promise<void>;
|
|
2237
898
|
/**
|
|
2238
899
|
* Deletes a scheduled event from a guild.
|
|
2239
900
|
*
|
|
@@ -2261,6 +922,24 @@ export interface RestManager {
|
|
|
2261
922
|
* @see {@link https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance}
|
|
2262
923
|
*/
|
|
2263
924
|
deleteStageInstance: (channelId: BigString, reason?: string) => Promise<void>;
|
|
925
|
+
/**
|
|
926
|
+
* Deletes a user's reaction from a message.
|
|
927
|
+
*
|
|
928
|
+
* @param channelId - The ID of the channel the message to delete the reaction from is in.
|
|
929
|
+
* @param messageId - The ID of the message to delete the reaction from.
|
|
930
|
+
* @param userId - The ID of the user whose reaction to delete.
|
|
931
|
+
* @param reaction - The reaction to delete from the message.
|
|
932
|
+
*
|
|
933
|
+
* @remarks
|
|
934
|
+
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
935
|
+
*
|
|
936
|
+
* Requires the `MANAGE_MESSAGES` permission.
|
|
937
|
+
*
|
|
938
|
+
* Fires a _Message Reaction Remove_ gateway event.
|
|
939
|
+
*
|
|
940
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#delete-user-reaction}
|
|
941
|
+
*/
|
|
942
|
+
deleteUserReaction: (channelId: BigString, messageId: BigString, userId: BigString, reaction: string) => Promise<void>;
|
|
2264
943
|
/**
|
|
2265
944
|
* Deletes a webhook.
|
|
2266
945
|
*
|
|
@@ -2443,6 +1122,25 @@ export interface RestManager {
|
|
|
2443
1122
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
|
|
2444
1123
|
*/
|
|
2445
1124
|
editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1125
|
+
/**
|
|
1126
|
+
* Edits a guild's settings.
|
|
1127
|
+
*
|
|
1128
|
+
* @param guildId - The ID of the guild to edit.
|
|
1129
|
+
* @param shardId - The ID of the shard the guild is in.
|
|
1130
|
+
* @param options - The parameters for the edit of the guild.
|
|
1131
|
+
* @returns An instance of the edited {@link Guild}.
|
|
1132
|
+
*
|
|
1133
|
+
* @remarks
|
|
1134
|
+
* Requires the `MANAGE_GUILD` permission.
|
|
1135
|
+
*
|
|
1136
|
+
* If attempting to add or remove the {@link GuildFeatures.Community} feature:
|
|
1137
|
+
* - Requires the `ADMINISTRATOR` permission.
|
|
1138
|
+
*
|
|
1139
|
+
* Fires a _Guild Update_ gateway event.
|
|
1140
|
+
*
|
|
1141
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
|
|
1142
|
+
*/
|
|
1143
|
+
editGuild: (guildId: BigString, options: ModifyGuild) => Promise<Camelize<DiscordGuild>>;
|
|
2446
1144
|
/**
|
|
2447
1145
|
* Edits an application command registered in a guild.
|
|
2448
1146
|
*
|
|
@@ -2454,6 +1152,21 @@ export interface RestManager {
|
|
|
2454
1152
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
|
|
2455
1153
|
*/
|
|
2456
1154
|
editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1155
|
+
/** Modify a guild's MFA level. Requires guild ownership. */
|
|
1156
|
+
editGuildMfaLevel: (guildId: BigString, mfaLevel: MfaLevels, reason?: string) => Promise<void>;
|
|
1157
|
+
/**
|
|
1158
|
+
* Edit the given sticker.
|
|
1159
|
+
*
|
|
1160
|
+
* @param guildId The ID of the guild to get
|
|
1161
|
+
* @return A {@link DiscordSticker}
|
|
1162
|
+
*
|
|
1163
|
+
* @remarks
|
|
1164
|
+
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1165
|
+
* Fires a Guild Stickers Update Gateway event.
|
|
1166
|
+
*
|
|
1167
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
|
|
1168
|
+
*/
|
|
1169
|
+
editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>) => Promise<Camelize<DiscordSticker>>;
|
|
2457
1170
|
/**
|
|
2458
1171
|
* Edits a template's settings.
|
|
2459
1172
|
*
|
|
@@ -2521,6 +1234,55 @@ export interface RestManager {
|
|
|
2521
1234
|
editOriginalWebhookMessage: (webhookId: BigString, token: string, options: InteractionCallbackData & {
|
|
2522
1235
|
threadId?: BigString;
|
|
2523
1236
|
}) => Promise<Camelize<DiscordMessage>>;
|
|
1237
|
+
/**
|
|
1238
|
+
* Edits the voice state of the bot user.
|
|
1239
|
+
*
|
|
1240
|
+
* @param guildId - The ID of the guild in which to edit the voice state of the bot user.
|
|
1241
|
+
* @param options - The parameters for the edit of the voice state.
|
|
1242
|
+
*
|
|
1243
|
+
* @remarks
|
|
1244
|
+
* The {@link EditOwnVoiceState.channelId | channelId} property of the {@link options} object parameter must point to a stage channel, and the bot user must already have joined it.
|
|
1245
|
+
*
|
|
1246
|
+
* If attempting to unmute oneself:
|
|
1247
|
+
* - Requires the `MUTE_MEMBERS` permission.
|
|
1248
|
+
*
|
|
1249
|
+
* If attempting to request to speak:
|
|
1250
|
+
* - Requires the `REQUEST_TO_SPEAK` permission.
|
|
1251
|
+
*
|
|
1252
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
|
|
1253
|
+
*/
|
|
1254
|
+
editOwnVoiceState: (guildId: BigString, options: EditOwnVoiceState) => Promise<void>;
|
|
1255
|
+
/**
|
|
1256
|
+
* Edits a role in a guild.
|
|
1257
|
+
*
|
|
1258
|
+
* @param guildId - The ID of the guild to edit the role in.
|
|
1259
|
+
* @param roleId - The ID of the role to edit.
|
|
1260
|
+
* @param options - The parameters for the edit of the role.
|
|
1261
|
+
* @returns An instance of the edited {@link DiscordRole}.
|
|
1262
|
+
*
|
|
1263
|
+
* @remarks
|
|
1264
|
+
* Requires the `MANAGE_ROLES` permission.
|
|
1265
|
+
*
|
|
1266
|
+
* Fires a _Guild Role Update_ gateway event.
|
|
1267
|
+
*
|
|
1268
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role}
|
|
1269
|
+
*/
|
|
1270
|
+
editRole: (guildId: BigString, roleId: BigString, options: EditGuildRole) => Promise<Camelize<DiscordRole>>;
|
|
1271
|
+
/**
|
|
1272
|
+
* Edits the positions of a set of roles.
|
|
1273
|
+
*
|
|
1274
|
+
* @param guildId - The ID of the guild to edit the role positions in.
|
|
1275
|
+
* @param options - The parameters for the edit of the role positions.
|
|
1276
|
+
* @returns A collection of {@link DiscordRole} objects assorted by role ID.
|
|
1277
|
+
*
|
|
1278
|
+
* @remarks
|
|
1279
|
+
* Requires the `MANAGE_ROLES` permission.
|
|
1280
|
+
*
|
|
1281
|
+
* Fires a _Guild Role Update_ gateway event for every role impacted in this change.
|
|
1282
|
+
*
|
|
1283
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role-positions}
|
|
1284
|
+
*/
|
|
1285
|
+
editRolePositions: (guildId: BigString, options: ModifyRolePositions[]) => Promise<Camelize<DiscordRole[]>>;
|
|
2524
1286
|
/**
|
|
2525
1287
|
* Edits a scheduled event.
|
|
2526
1288
|
*
|
|
@@ -2554,6 +1316,20 @@ export interface RestManager {
|
|
|
2554
1316
|
* @see {@link https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance}
|
|
2555
1317
|
*/
|
|
2556
1318
|
editStageInstance: (channelId: BigString, data: EditStageInstanceOptions) => Promise<Camelize<DiscordStageInstance>>;
|
|
1319
|
+
/**
|
|
1320
|
+
* Edits the voice state of another user.
|
|
1321
|
+
*
|
|
1322
|
+
* @param guildId - The ID of the guild in which to edit the voice state of the bot user.
|
|
1323
|
+
* @param options - The parameters for the edit of the voice state.
|
|
1324
|
+
*
|
|
1325
|
+
* @remarks
|
|
1326
|
+
* The {@link EditOwnVoiceState.channelId | channelId} property of the {@link options} object parameter must point to a stage channel, and the user must already have joined it.
|
|
1327
|
+
*
|
|
1328
|
+
* Requires the `MUTE_MEMBERS` permission.
|
|
1329
|
+
*
|
|
1330
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
|
|
1331
|
+
*/
|
|
1332
|
+
editUserVoiceState: (guildId: BigString, options: EditUserVoiceState) => Promise<void>;
|
|
2557
1333
|
/**
|
|
2558
1334
|
* Edits a webhook.
|
|
2559
1335
|
*
|
|
@@ -2600,6 +1376,35 @@ export interface RestManager {
|
|
|
2600
1376
|
* @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
|
|
2601
1377
|
*/
|
|
2602
1378
|
editWebhookWithToken: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
|
|
1379
|
+
/**
|
|
1380
|
+
* Edits a guild's welcome screen.
|
|
1381
|
+
*
|
|
1382
|
+
* @param guildId - The ID of the guild to edit the welcome screen of.
|
|
1383
|
+
* @param options - The parameters for the edit of the welcome screen.
|
|
1384
|
+
* @returns An instance of the edited {@link WelcomeScreen}.
|
|
1385
|
+
*
|
|
1386
|
+
* @remarks
|
|
1387
|
+
* Requires the `MANAGE_GUILD` permission.
|
|
1388
|
+
*
|
|
1389
|
+
* Fires a _Guild Update_ gateway event.
|
|
1390
|
+
*
|
|
1391
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen}
|
|
1392
|
+
*/
|
|
1393
|
+
editWelcomeScreen: (guildId: BigString, options: Camelize<DiscordModifyGuildWelcomeScreen>) => Promise<Camelize<DiscordWelcomeScreen>>;
|
|
1394
|
+
/**
|
|
1395
|
+
* Edits the settings of a guild's widget.
|
|
1396
|
+
*
|
|
1397
|
+
* @param guildId - The ID of the guild to edit the settings of the widget of.
|
|
1398
|
+
* @returns An instance of the edited {@link GuildWidgetSettings}.
|
|
1399
|
+
*
|
|
1400
|
+
* @remarks
|
|
1401
|
+
* Requires the `MANAGE_GUILD` permission.
|
|
1402
|
+
*
|
|
1403
|
+
* Fires a _Guild Update_ gateway event.
|
|
1404
|
+
*
|
|
1405
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-widget}
|
|
1406
|
+
*/
|
|
1407
|
+
editWidgetSettings: (guildId: BigString, options: Camelize<DiscordGuildWidgetSettings>) => Promise<Camelize<DiscordGuildWidgetSettings>>;
|
|
2603
1408
|
/**
|
|
2604
1409
|
* Executes a webhook, causing a message to be posted in the channel configured for the webhook.
|
|
2605
1410
|
*
|
|
@@ -2664,6 +1469,19 @@ export interface RestManager {
|
|
|
2664
1469
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
|
|
2665
1470
|
*/
|
|
2666
1471
|
getApplicationCommandPermissions: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions[]>>;
|
|
1472
|
+
/**
|
|
1473
|
+
* Gets a guild's audit log.
|
|
1474
|
+
*
|
|
1475
|
+
* @param guildId - The ID of the guild to get the audit log of.
|
|
1476
|
+
* @param options - The parameters for the fetching of the audit log.
|
|
1477
|
+
* @returns An instance of {@link AuditLog}.
|
|
1478
|
+
*
|
|
1479
|
+
* @remarks
|
|
1480
|
+
* Requires the `VIEW_AUDIT_LOG` permission.
|
|
1481
|
+
*
|
|
1482
|
+
* @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
|
|
1483
|
+
*/
|
|
1484
|
+
getAuditLog: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
|
|
2667
1485
|
/**
|
|
2668
1486
|
* Gets an automod rule by its ID.
|
|
2669
1487
|
*
|
|
@@ -2689,6 +1507,40 @@ export interface RestManager {
|
|
|
2689
1507
|
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
|
|
2690
1508
|
*/
|
|
2691
1509
|
getAutomodRules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
|
|
1510
|
+
/**
|
|
1511
|
+
* Gets the list of available voice regions.
|
|
1512
|
+
*
|
|
1513
|
+
* @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
|
|
1514
|
+
*/
|
|
1515
|
+
getAvailableVoiceRegions: () => Promise<Camelize<DiscordVoiceRegion[]>>;
|
|
1516
|
+
/**
|
|
1517
|
+
* Gets a ban by user ID.
|
|
1518
|
+
*
|
|
1519
|
+
* @param guildId - The ID of the guild to get the ban from.
|
|
1520
|
+
* @param userId - The ID of the user to get the ban for.
|
|
1521
|
+
* @returns An instance of {@link DiscordBan}.
|
|
1522
|
+
*
|
|
1523
|
+
* @remarks
|
|
1524
|
+
* Requires the `BAN_MEMBERS` permission.
|
|
1525
|
+
*
|
|
1526
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
|
|
1527
|
+
*/
|
|
1528
|
+
getBan: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
|
|
1529
|
+
/**
|
|
1530
|
+
* Gets the list of bans for a guild.
|
|
1531
|
+
*
|
|
1532
|
+
* @param guildId - The ID of the guild to get the list of bans for.
|
|
1533
|
+
* @param options - The parameters for the fetching of the list of bans.
|
|
1534
|
+
* @returns A collection of {@link DiscordBan} objects assorted by user ID.
|
|
1535
|
+
*
|
|
1536
|
+
* @remarks
|
|
1537
|
+
* Requires the `BAN_MEMBERS` permission.
|
|
1538
|
+
*
|
|
1539
|
+
* Users are ordered by their IDs in _ascending_ order.
|
|
1540
|
+
*
|
|
1541
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
|
|
1542
|
+
*/
|
|
1543
|
+
getBans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan[]>>;
|
|
2692
1544
|
/**
|
|
2693
1545
|
* Gets a channel by its ID.
|
|
2694
1546
|
*
|
|
@@ -2803,6 +1655,18 @@ export interface RestManager {
|
|
|
2803
1655
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
|
|
2804
1656
|
*/
|
|
2805
1657
|
getGlobalApplicationCommands: () => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
1658
|
+
/**
|
|
1659
|
+
* Gets a guild by its ID.
|
|
1660
|
+
*
|
|
1661
|
+
* @param guildId - The ID of the guild to get.
|
|
1662
|
+
* @param options - The parameters for the fetching of the guild.
|
|
1663
|
+
* @returns An instance of {@link Guild}.
|
|
1664
|
+
*
|
|
1665
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
|
|
1666
|
+
*/
|
|
1667
|
+
getGuild: (guildId: BigString, options?: {
|
|
1668
|
+
counts?: boolean;
|
|
1669
|
+
}) => Promise<Camelize<DiscordGuild>>;
|
|
2806
1670
|
/**
|
|
2807
1671
|
* Gets a guild application command by its ID.
|
|
2808
1672
|
*
|
|
@@ -2822,6 +1686,41 @@ export interface RestManager {
|
|
|
2822
1686
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
|
|
2823
1687
|
*/
|
|
2824
1688
|
getGuildApplicationCommands: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
1689
|
+
/**
|
|
1690
|
+
* Gets the preview of a guild by a guild's ID.
|
|
1691
|
+
*
|
|
1692
|
+
* @param guildId - The ID of the guild to get the preview of.
|
|
1693
|
+
* @returns An instance of {@link GuildPreview}.
|
|
1694
|
+
*
|
|
1695
|
+
* @remarks
|
|
1696
|
+
* If the bot user is not in the guild, the guild must be lurkable.
|
|
1697
|
+
*
|
|
1698
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-preview}
|
|
1699
|
+
*/
|
|
1700
|
+
getGuildPreview: (guildId: BigString) => Promise<Camelize<DiscordGuildPreview>>;
|
|
1701
|
+
/**
|
|
1702
|
+
* Returns a sticker object for the given guild and sticker IDs.
|
|
1703
|
+
*
|
|
1704
|
+
* @param guildId The ID of the guild to get
|
|
1705
|
+
* @param stickerId The ID of the sticker to get
|
|
1706
|
+
* @return A {@link DiscordSticker}
|
|
1707
|
+
*
|
|
1708
|
+
* @remarks Includes the user field if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1709
|
+
*
|
|
1710
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
|
|
1711
|
+
*/
|
|
1712
|
+
getGuildSticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
|
|
1713
|
+
/**
|
|
1714
|
+
* Returns an array of sticker objects for the given guild.
|
|
1715
|
+
*
|
|
1716
|
+
* @param guildId The ID of the guild to get
|
|
1717
|
+
* @returns A collection of {@link DiscordSticker} objects assorted by sticker ID.
|
|
1718
|
+
*
|
|
1719
|
+
* @remarks Includes user fields if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1720
|
+
*
|
|
1721
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
|
|
1722
|
+
*/
|
|
1723
|
+
getGuildStickers: (guildId: BigString) => Promise<Camelize<DiscordSticker[]>>;
|
|
2825
1724
|
/**
|
|
2826
1725
|
* Gets a template by its code.
|
|
2827
1726
|
*
|
|
@@ -2892,6 +1791,38 @@ export interface RestManager {
|
|
|
2892
1791
|
* @see {@link https://discord.com/developers/docs/resources/invite#get-invites}
|
|
2893
1792
|
*/
|
|
2894
1793
|
getInvites: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
|
|
1794
|
+
/**
|
|
1795
|
+
* Gets a message from a channel by the ID of the message.
|
|
1796
|
+
*
|
|
1797
|
+
* @param channelId - The ID of the channel from which to get the message.
|
|
1798
|
+
* @param messageId - The ID of the message to get.
|
|
1799
|
+
* @returns An instance of {@link Message}.
|
|
1800
|
+
*
|
|
1801
|
+
* @remarks
|
|
1802
|
+
* Requires that the bot user be able to see the contents of the channel in which the message was posted.
|
|
1803
|
+
*
|
|
1804
|
+
* If getting a message from a guild channel:
|
|
1805
|
+
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1806
|
+
*
|
|
1807
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-message}
|
|
1808
|
+
*/
|
|
1809
|
+
getMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
1810
|
+
/**
|
|
1811
|
+
* Gets multiple messages from a channel.
|
|
1812
|
+
*
|
|
1813
|
+
* @param channelId - The ID of the channel from which to get the messages.
|
|
1814
|
+
* @param options - The parameters for the fetching of the messages.
|
|
1815
|
+
* @returns A collection of {@link Message} objects assorted by message ID.
|
|
1816
|
+
*
|
|
1817
|
+
* @remarks
|
|
1818
|
+
* Requires that the bot user be able to see the contents of the channel in which the messages were posted.
|
|
1819
|
+
*
|
|
1820
|
+
* If getting a messages from a guild channel:
|
|
1821
|
+
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1822
|
+
*
|
|
1823
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-messages}
|
|
1824
|
+
*/
|
|
1825
|
+
getMessages: (channelId: BigString, options?: GetMessagesOptions) => Promise<Camelize<DiscordMessage[]>>;
|
|
2895
1826
|
/**
|
|
2896
1827
|
* Returns the list of sticker packs available to Nitro subscribers.
|
|
2897
1828
|
*
|
|
@@ -2917,6 +1848,21 @@ export interface RestManager {
|
|
|
2917
1848
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
|
|
2918
1849
|
*/
|
|
2919
1850
|
getOriginalInteractionResponse: (token: string) => Promise<Camelize<DiscordMessage>>;
|
|
1851
|
+
/**
|
|
1852
|
+
* Gets the pinned messages for a channel.
|
|
1853
|
+
*
|
|
1854
|
+
* @param channelId - The ID of the channel to get the pinned messages for.
|
|
1855
|
+
* @returns A collection of {@link Message} objects assorted by message ID.
|
|
1856
|
+
*
|
|
1857
|
+
* @remarks
|
|
1858
|
+
* Requires that the bot user be able to see the contents of the channel in which the messages were posted.
|
|
1859
|
+
*
|
|
1860
|
+
* If getting a message from a guild channel:
|
|
1861
|
+
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1862
|
+
*
|
|
1863
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages}
|
|
1864
|
+
*/
|
|
1865
|
+
getPinnedMessages: (channelId: BigString) => Promise<Camelize<DiscordMessage[]>>;
|
|
2920
1866
|
/**
|
|
2921
1867
|
* Gets the list of private archived threads for a channel.
|
|
2922
1868
|
*
|
|
@@ -2952,6 +1898,19 @@ export interface RestManager {
|
|
|
2952
1898
|
* @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
|
|
2953
1899
|
*/
|
|
2954
1900
|
getPrivateJoinedArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
1901
|
+
/**
|
|
1902
|
+
* Gets the number of members that would be kicked from a guild during pruning.
|
|
1903
|
+
*
|
|
1904
|
+
* @param guildId - The ID of the guild to get the prune count of.
|
|
1905
|
+
* @param options - The parameters for the fetching of the prune count.
|
|
1906
|
+
* @returns A number indicating the number of members that would be kicked.
|
|
1907
|
+
*
|
|
1908
|
+
* @remarks
|
|
1909
|
+
* Requires the `KICK_MEMBERS` permission.
|
|
1910
|
+
*
|
|
1911
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-prune-count}
|
|
1912
|
+
*/
|
|
1913
|
+
getPruneCount: (guildId: BigString, options?: GetGuildPruneCountQuery) => Promise<Camelize<DiscordPrunedCount>>;
|
|
2955
1914
|
/**
|
|
2956
1915
|
* Gets the list of public archived threads for a channel.
|
|
2957
1916
|
*
|
|
@@ -2970,6 +1929,18 @@ export interface RestManager {
|
|
|
2970
1929
|
* @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
|
|
2971
1930
|
*/
|
|
2972
1931
|
getPublicArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
|
|
1932
|
+
/**
|
|
1933
|
+
* Gets the list of roles for a guild.
|
|
1934
|
+
*
|
|
1935
|
+
* @param guildId - The ID of the guild to get the list of roles for.
|
|
1936
|
+
* @returns A collection of {@link DisorcRole} objects assorted by role ID.
|
|
1937
|
+
*
|
|
1938
|
+
* @remarks
|
|
1939
|
+
* ⚠️ This endpoint should be used sparingly due to {@link User} objects already being included in guild payloads.
|
|
1940
|
+
*
|
|
1941
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-roles}
|
|
1942
|
+
*/
|
|
1943
|
+
getRoles: (guildId: BigString) => Promise<Camelize<DiscordRole[]>>;
|
|
2973
1944
|
/**
|
|
2974
1945
|
* Gets a scheduled event by its ID.
|
|
2975
1946
|
*
|
|
@@ -3023,6 +1994,15 @@ export interface RestManager {
|
|
|
3023
1994
|
* @see {@link https://discord.com/developers/docs/resources/stage-instance#get-stage-instance}
|
|
3024
1995
|
*/
|
|
3025
1996
|
getStageInstance: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
|
|
1997
|
+
/**
|
|
1998
|
+
* Returns a sticker object for the given sticker ID.
|
|
1999
|
+
*
|
|
2000
|
+
* @param stickerId The ID of the sticker to get
|
|
2001
|
+
* @returns A {@link DiscordSticker}
|
|
2002
|
+
*
|
|
2003
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
|
|
2004
|
+
*/
|
|
2005
|
+
getSticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
|
|
3026
2006
|
/**
|
|
3027
2007
|
* Gets a thread member by their user ID.
|
|
3028
2008
|
*
|
|
@@ -3045,6 +2025,18 @@ export interface RestManager {
|
|
|
3045
2025
|
* @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
|
|
3046
2026
|
*/
|
|
3047
2027
|
getThreadMembers: (channelId: BigString) => Promise<Camelize<DiscordThreadMember[]>>;
|
|
2028
|
+
/**
|
|
2029
|
+
* Gets the list of users that reacted with an emoji to a message.
|
|
2030
|
+
*
|
|
2031
|
+
* @param channelId - The ID of the channel the message to get the users for is in.
|
|
2032
|
+
* @param messageId - The ID of the message to get the users for.
|
|
2033
|
+
* @param reaction - The reaction for which to get the users.
|
|
2034
|
+
* @param options - The parameters for the fetching of the users.
|
|
2035
|
+
* @returns A collection of {@link User} objects assorted by user ID.
|
|
2036
|
+
*
|
|
2037
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#get-reactions}
|
|
2038
|
+
*/
|
|
2039
|
+
getReactions: (channelId: BigString, messageId: BigString, reaction: string, options?: GetReactions) => Promise<Camelize<DiscordUser[]>>;
|
|
3048
2040
|
/**
|
|
3049
2041
|
* Get a user's data from the api
|
|
3050
2042
|
*
|
|
@@ -3052,6 +2044,29 @@ export interface RestManager {
|
|
|
3052
2044
|
* @returns {Camelize<DiscordUser>}
|
|
3053
2045
|
*/
|
|
3054
2046
|
getUser: (id: BigString) => Promise<Camelize<DiscordUser>>;
|
|
2047
|
+
/**
|
|
2048
|
+
* Gets information about the vanity url of a guild.
|
|
2049
|
+
*
|
|
2050
|
+
* @param guildId - The ID of the guild to get the vanity url information for.
|
|
2051
|
+
* @returns An instance of {@link VanityUrl}.
|
|
2052
|
+
*
|
|
2053
|
+
* @remarks
|
|
2054
|
+
* Requires the `MANAGE_GUILD` permission.
|
|
2055
|
+
*
|
|
2056
|
+
* The `code` property will be `null` if the guild does not have a set vanity url.
|
|
2057
|
+
*
|
|
2058
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
|
|
2059
|
+
*/
|
|
2060
|
+
getVanityUrl: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
|
|
2061
|
+
/**
|
|
2062
|
+
* Gets the list of voice regions for a guild.
|
|
2063
|
+
*
|
|
2064
|
+
* @param guildId - The ID of the guild to get the voice regions for.
|
|
2065
|
+
* @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
|
|
2066
|
+
*
|
|
2067
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
|
|
2068
|
+
*/
|
|
2069
|
+
getVoiceRegions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion[]>>;
|
|
3055
2070
|
/**
|
|
3056
2071
|
* Gets a webhook by its ID.
|
|
3057
2072
|
*
|
|
@@ -3086,6 +2101,40 @@ export interface RestManager {
|
|
|
3086
2101
|
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
|
|
3087
2102
|
*/
|
|
3088
2103
|
getWebhookWithToken: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
|
|
2104
|
+
/**
|
|
2105
|
+
* Gets the welcome screen for a guild.
|
|
2106
|
+
*
|
|
2107
|
+
* @param guildId - The ID of the guild to get the welcome screen for.
|
|
2108
|
+
* @returns An instance of {@link WelcomeScreen}.
|
|
2109
|
+
*
|
|
2110
|
+
* @remarks
|
|
2111
|
+
* If the welcome screen is not enabled:
|
|
2112
|
+
* - Requires the `MANAGE_GUILD` permission.
|
|
2113
|
+
*
|
|
2114
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen}
|
|
2115
|
+
*/
|
|
2116
|
+
getWelcomeScreen: (guildId: BigString) => Promise<Camelize<DiscordWelcomeScreen>>;
|
|
2117
|
+
/**
|
|
2118
|
+
* Gets the guild widget by guild ID.
|
|
2119
|
+
*
|
|
2120
|
+
* @param guildId - The ID of the guild to get the widget of.
|
|
2121
|
+
* @returns An instance of {@link GuildWidget}.
|
|
2122
|
+
*
|
|
2123
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget}
|
|
2124
|
+
*/
|
|
2125
|
+
getWidget: (guildId: BigString) => Promise<Camelize<DiscordGuildWidget>>;
|
|
2126
|
+
/**
|
|
2127
|
+
* Gets the settings of a guild's widget.
|
|
2128
|
+
*
|
|
2129
|
+
* @param guildId - The ID of the guild to get the widget of.
|
|
2130
|
+
* @returns An instance of {@link GuildWidgetSettings}.
|
|
2131
|
+
*
|
|
2132
|
+
* @remarks
|
|
2133
|
+
* Requires the `MANAGE_GUILD` permission.
|
|
2134
|
+
*
|
|
2135
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget-settings}
|
|
2136
|
+
*/
|
|
2137
|
+
getWidgetSettings: (guildId: BigString) => Promise<Camelize<DiscordGuildWidgetSettings>>;
|
|
3089
2138
|
/**
|
|
3090
2139
|
* Adds the bot user to a thread.
|
|
3091
2140
|
*
|
|
@@ -3099,6 +2148,17 @@ export interface RestManager {
|
|
|
3099
2148
|
* @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
|
|
3100
2149
|
*/
|
|
3101
2150
|
joinThread: (channelId: BigString) => Promise<void>;
|
|
2151
|
+
/**
|
|
2152
|
+
* Leaves a guild.
|
|
2153
|
+
*
|
|
2154
|
+
* @param guildId - The ID of the guild to leave.
|
|
2155
|
+
*
|
|
2156
|
+
* @remarks
|
|
2157
|
+
* Fires a _Guild Delete_ event.
|
|
2158
|
+
*
|
|
2159
|
+
* @see {@link https://discord.com/developers/docs/resources/user#leave-guild}
|
|
2160
|
+
*/
|
|
2161
|
+
leaveGuild: (guildId: BigString) => Promise<void>;
|
|
3102
2162
|
/**
|
|
3103
2163
|
* Removes the bot user from a thread.
|
|
3104
2164
|
*
|
|
@@ -3130,6 +2190,21 @@ export interface RestManager {
|
|
|
3130
2190
|
* @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
|
|
3131
2191
|
*/
|
|
3132
2192
|
publishMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
2193
|
+
/**
|
|
2194
|
+
* Removes a role from a member.
|
|
2195
|
+
*
|
|
2196
|
+
* @param guildId - The ID of the guild the member to remove the role from is in.
|
|
2197
|
+
* @param userId - The user ID of the member to remove the role from.
|
|
2198
|
+
* @param roleId - The ID of the role to remove from the member.
|
|
2199
|
+
*
|
|
2200
|
+
* @remarks
|
|
2201
|
+
* Requires the `MANAGE_ROLES` permission.
|
|
2202
|
+
*
|
|
2203
|
+
* Fires a _Guild Member Update_ gateway event.
|
|
2204
|
+
*
|
|
2205
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member-role}
|
|
2206
|
+
*/
|
|
2207
|
+
removeRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
|
|
3133
2208
|
/**
|
|
3134
2209
|
* Removes a member from a thread.
|
|
3135
2210
|
*
|
|
@@ -3398,6 +2473,24 @@ export interface RestManager {
|
|
|
3398
2473
|
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
|
|
3399
2474
|
*/
|
|
3400
2475
|
kickMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
|
|
2476
|
+
/**
|
|
2477
|
+
* Pins a message in a channel.
|
|
2478
|
+
*
|
|
2479
|
+
* @param channelId - The ID of the channel where the message is to be pinned.
|
|
2480
|
+
* @param messageId - The ID of the message to pin.
|
|
2481
|
+
*
|
|
2482
|
+
* @remarks
|
|
2483
|
+
* Requires that the bot user be able to see the contents of the channel in which the messages were posted.
|
|
2484
|
+
*
|
|
2485
|
+
* Requires the `MANAGE_MESSAGES` permission.
|
|
2486
|
+
*
|
|
2487
|
+
* ⚠️ There can only be at max 50 messages pinned in a channel.
|
|
2488
|
+
*
|
|
2489
|
+
* Fires a _Channel Pins Update_ event.
|
|
2490
|
+
*
|
|
2491
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#pin-message}
|
|
2492
|
+
*/
|
|
2493
|
+
pinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
3401
2494
|
/**
|
|
3402
2495
|
* Initiates the process of pruning inactive members.
|
|
3403
2496
|
*
|
|
@@ -3447,6 +2540,22 @@ export interface RestManager {
|
|
|
3447
2540
|
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
|
|
3448
2541
|
*/
|
|
3449
2542
|
unbanMember: (guildId: BigString, userId: BigString) => Promise<void>;
|
|
2543
|
+
/**
|
|
2544
|
+
* Unpins a pinned message in a channel.
|
|
2545
|
+
*
|
|
2546
|
+
* @param channelId - The ID of the channel where the message is pinned.
|
|
2547
|
+
* @param messageId - The ID of the message to unpin.
|
|
2548
|
+
*
|
|
2549
|
+
* @remarks
|
|
2550
|
+
* Requires that the bot user be able to see the contents of the channel in which the messages were posted.
|
|
2551
|
+
*
|
|
2552
|
+
* Requires the `MANAGE_MESSAGES` permission.
|
|
2553
|
+
*
|
|
2554
|
+
* Fires a _Channel Pins Update_ event.
|
|
2555
|
+
*
|
|
2556
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#unpin-message}
|
|
2557
|
+
*/
|
|
2558
|
+
unpinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
3450
2559
|
}
|
|
3451
2560
|
export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
|
|
3452
2561
|
export type ApiVersions = 9 | 10;
|