@discordeno/rest 19.0.0-next.2dafa8f → 19.0.0-next.2faeab1

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 CHANGED
@@ -1,2339 +1,3 @@
1
- import { Queue } from './queue.js';
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, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordRole, DiscordScheduledEvent, DiscordStageInstance, DiscordSticker, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordVanityUrl, DiscordVoiceRegion, DiscordWebhook, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditGuildStickerOptions, EditMessage, EditScheduledEvent, EditStageInstanceOptions, ExecuteWebhook, GetBans, GetGuildAuditLog, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, ModifyChannel, ModifyGuild, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyRolePositions, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason } from '@discordeno/types';
3
- import type { InvalidRequestBucket } from './invalidBucket.js';
1
+ import type { CreateRestManagerOptions, RestManager } from './types.js';
4
2
  export declare function createRestManager(options: CreateRestManagerOptions): RestManager;
5
- export interface CreateRestManagerOptions {
6
- /** The bot token which will be used to make requests. */
7
- token: string;
8
- /**
9
- * For old bots that have a different bot id and application id.
10
- * @default bot id from token
11
- */
12
- applicationId?: BigString;
13
- /**
14
- * The base url to connect to. If you create a proxy rest, that url would go here.
15
- * IT SHOULD NOT END WITH A /
16
- * @default https://discord.com/api
17
- */
18
- baseUrl?: string;
19
- /**
20
- * The api versions which can be used to make requests.
21
- * @default 10
22
- */
23
- version?: ApiVersions;
24
- }
25
- export interface RestManager {
26
- /** The bot token which will be used to make requests. */
27
- token: string;
28
- /** The application id. Normally this is not required for recent bots but old bot's application id is sometimes different from the bot id so it is required for those bots. */
29
- applicationId: bigint;
30
- /** The api version to use when making requests. Only the latest supported version will be tested. */
31
- version: ApiVersions;
32
- /**
33
- * The base url to connect to. If you create a proxy rest, that url would go here.
34
- * IT SHOULD NOT END WITH A /
35
- * @default https://discord.com/api
36
- */
37
- baseUrl: string;
38
- /** The maximum amount of times a request should be retried. Defaults to Infinity */
39
- maxRetryCount: number;
40
- /** Whether or not the manager is rate limited globally across all requests. Defaults to false. */
41
- globallyRateLimited: boolean;
42
- /** Whether or not the rate limited paths are being processed to allow requests to be made once time is up. Defaults to false. */
43
- processingRateLimitedPaths: boolean;
44
- /** The time in milliseconds to wait before deleting this queue if it is empty. Defaults to 60000(one minute). */
45
- deleteQueueDelay: number;
46
- /** The queues that hold all the requests to be processed. */
47
- queues: Map<string, Queue>;
48
- /** The paths that are currently rate limited. */
49
- rateLimitedPaths: Map<string, RestRateLimitedPath>;
50
- /** The bucket for handling any invalid requests. */
51
- invalidBucket: InvalidRequestBucket;
52
- /** The routes that are available for this manager. */
53
- routes: {
54
- /** Route to get a bots session info. */
55
- sessionInfo: () => string;
56
- /** A specific user route. */
57
- user: (id: BigString) => string;
58
- /** Current bot user route. */
59
- userBot: () => string;
60
- oauth2Application: () => string;
61
- gatewayBot: () => string;
62
- nitroStickerPacks: () => string;
63
- /** Routes for webhook related routes. */
64
- webhooks: {
65
- /** Route for managing the original message sent by a webhook. */
66
- original: (webhookId: BigString, token: string, options?: {
67
- threadId?: BigString;
68
- }) => string;
69
- /** Route for webhook with a id. */
70
- id: (webhookId: BigString) => string;
71
- /** Route for handling a webhook with a token. */
72
- webhook: (webhookId: BigString, token: string, options?: {
73
- wait?: boolean;
74
- threadId?: BigString;
75
- }) => string;
76
- /** Route for handling a message that was sent through a webhook. */
77
- message: (webhookId: BigString, token: string, messageId: BigString, options?: {
78
- threadId?: BigString;
79
- }) => string;
80
- };
81
- /** Routes for channel related endpoints. */
82
- channels: {
83
- /** Route for non-specific dm channel. */
84
- dm: () => string;
85
- /** Route for non-specific webhook in a channel. */
86
- webhooks: (channelId: BigString) => string;
87
- /** Route for a specific channel. */
88
- channel: (channelId: BigString) => string;
89
- /** Route for following a specific channel. */
90
- follow: (channelId: BigString) => string;
91
- /** Route for managing a forum with a message. */
92
- forum: (channelId: BigString) => string;
93
- /** Route for a specific channel's invites. */
94
- invites: (channelId: BigString) => string;
95
- /** Route for a specific message */
96
- message: (channelId: BigString, id: BigString) => string;
97
- /** Route for handling non-specific messages. */
98
- messages: (channelId: BigString, options?: GetMessagesOptions) => string;
99
- /** Route for handling a specific overwrite. */
100
- overwrite: (channelId: BigString, overwriteId: BigString) => string;
101
- /** Route for handling crossposting a specific message. */
102
- crosspost: (channelId: BigString, messageId: BigString) => string;
103
- /** Route for handling non-specific stages */
104
- stages: () => string;
105
- /** Route for handling a specific stage */
106
- stage: (channelId: BigString) => string;
107
- /** Routes for handling thread related to a channel. */
108
- threads: {
109
- /** Route for thread a specific message. */
110
- message: (channelId: BigString, messageId: BigString) => string;
111
- /** Route for thread without a message. */
112
- all: (channelId: BigString) => string;
113
- /** Route for active threads. */
114
- active: (guildId: BigString) => string;
115
- /** Route for members in a thread. */
116
- members: (channelId: BigString) => string;
117
- /** Route for the bot member in a thread. */
118
- me: (channelId: BigString) => string;
119
- /** Route for a specific member in a thread. */
120
- user: (channelId: BigString, userId: BigString) => string;
121
- /** Route for handling archived threads. */
122
- archived: (channelId: BigString) => string;
123
- /** Route for handling publically archived threads. */
124
- public: (channelId: BigString, options?: ListArchivedThreads) => string;
125
- /** Route for handling private archived threads. */
126
- private: (channelId: BigString, options?: ListArchivedThreads) => string;
127
- /** Route for handling private archived threads that the bot has joined. */
128
- joined: (channelId: BigString, options?: ListArchivedThreads) => string;
129
- };
130
- /** Route for handling typing indicators in a c«hannel. */
131
- typing: (channelId: BigString) => string;
132
- /** Routes for handling reactions on a message. */
133
- reactions: {
134
- /** Route for handling a bots reaction. */
135
- bot: (channelId: BigString, messageId: BigString, emoji: string) => string;
136
- };
137
- };
138
- /** Routes for guild related endpoints. */
139
- guilds: {
140
- /** Routes for handling a non-specific guild. */
141
- all: () => string;
142
- /** Route for handling audit logs in a guild. */
143
- auditlogs: (guildId: BigString, options?: GetGuildAuditLog) => string;
144
- /** Routes for a guilds automoderation. */
145
- automod: {
146
- /** Route for handling a guild's automoderation. */
147
- rules: (guildId: BigString) => string;
148
- /** Route for handling a specific automoderation rule guild's */
149
- rule: (guildId: BigString, ruleId: BigString) => string;
150
- };
151
- /** Routes for handling a guild's scheduled events. */
152
- events: {
153
- /** Route for handling non-specific scheduled event. */
154
- events: (guildId: BigString, withUserCount?: boolean) => string;
155
- /** Route for handling a specific scheduled event. */
156
- event: (guildId: BigString, eventId: BigString, withUserCount?: boolean) => string;
157
- /** Route for handling a scheduled event users. */
158
- users: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => string;
159
- };
160
- /** Route for handling non-specific channels in a guild */
161
- channels: (guildId: BigString) => string;
162
- /** Route for handling a specific emoji. */
163
- emoji: (guildId: BigString, id: BigString) => string;
164
- /** Route for handling non-specific emojis. */
165
- emojis: (guildId: BigString) => string;
166
- /** Route for handling a specific guild. */
167
- guild: (guildId: BigString, withCounts?: boolean) => string;
168
- /** Route for handling a specific integration. */
169
- integration: (guildId: BigString, integrationId: BigString) => string;
170
- /** Route for handling non-specific integrations. */
171
- integrations: (guildId: BigString) => string;
172
- /** Route for handling a specific guild invite. */
173
- invite: (inviteCode: string, options?: GetInvite) => string;
174
- /** Route for handling non-specific invites in a guild. */
175
- invites: (guildId: BigString) => string;
176
- /** Route for handling non-specific webhooks in a guild */
177
- webhooks: (guildId: BigString) => string;
178
- /** Routes for handling a guild's members. */
179
- members: {
180
- /** Route for handling a specific guild member's ban. */
181
- ban: (guildId: BigString, userId: BigString) => string;
182
- /** Route for handling non-specific bans in a guild. */
183
- bans: (guildId: BigString, options?: GetBans) => string;
184
- /** Route for handling a the bot guild member. */
185
- bot: (guildId: BigString) => string;
186
- /** Route for handling a specific guild member. */
187
- member: (guildId: BigString, userId: BigString) => string;
188
- /** Route for handling non-specific guild members. */
189
- members: (guildId: BigString, options?: ListGuildMembers) => string;
190
- /** Route for handling member searching in a guild. */
191
- search: (guildId: BigString, query: string, options?: {
192
- limit?: number;
193
- }) => string;
194
- /** Route for handling pruning guild members. */
195
- prune: (guildId: BigString, options?: GetGuildPruneCountQuery) => string;
196
- };
197
- /** Routes for handling a guild's templates. */
198
- templates: {
199
- /** Route for handling a specifc guild's templates with a code only. */
200
- code: (code: string) => string;
201
- /** Route for handling a specific guild's template with a guild id and code. */
202
- guild: (guildId: BigString, code: string) => string;
203
- /** Route for handling non-specific guild's templates. */
204
- all: (guildId: BigString) => string;
205
- };
206
- /** Route for handling a guild's vanity url. */
207
- vanity: (guildId: BigString) => string;
208
- /** Route for handling a guild's regions. */
209
- regions: (guildId: BigString) => string;
210
- /** Routes for handling a guild's roles. */
211
- roles: {
212
- /** Route for handling a specific guild role. */
213
- one: (guildId: BigString, roleId: BigString) => string;
214
- /** Route for handling a guild's roles. */
215
- all: (guildId: BigString) => string;
216
- /** Route for handling a members roles in a guild. */
217
- member: (guildId: BigString, memberId: BigString, roleId: BigString) => string;
218
- };
219
- /** Route for handling a specific guild sticker. */
220
- stickers: (guildId: BigString) => string;
221
- /** Route for handling non-specific guild stickers. */
222
- sticker: (guildId: BigString, stickerId: BigString) => string;
223
- };
224
- /** Routes for interaction related endpoints. */
225
- interactions: {
226
- /** Routes for interaction command related endpoints. */
227
- commands: {
228
- /** Route for non-specific commands. */
229
- commands: (applicationId: BigString) => string;
230
- /** Route for guild related commands. */
231
- guilds: {
232
- /** Route for non-specific guild commands. */
233
- all: (applicationId: BigString, guildId: BigString) => string;
234
- /** Route for a specific guild command. */
235
- one: (applicationId: BigString, guildId: BigString, commandId: BigString, withLocalizations?: boolean) => string;
236
- };
237
- /** Route for non-specific command permissions. */
238
- permissions: (applicationId: BigString, guildId: BigString) => string;
239
- /** Route for a specific command's permission. */
240
- permission: (applicationId: BigString, guildId: BigString, commandId: BigString) => string;
241
- /** Route for a specific command. */
242
- command: (applicationId: BigString, commandId: BigString, withLocalizations?: boolean) => string;
243
- };
244
- /** Routes for interaction response related endpoints. */
245
- responses: {
246
- /** Route for handling a callback response with id and token. */
247
- callback: (interactionId: BigString, token: string) => string;
248
- /** Route for handling the original response using id and token. */
249
- original: (interactionId: BigString, token: string) => string;
250
- /** Route for handling a followup message from a interaction response. */
251
- message: (applicationId: BigString, token: string, messageId: BigString) => string;
252
- };
253
- };
254
- /** Route for handling a sticker. */
255
- sticker: (stickerId: BigString) => string;
256
- };
257
- /** Check the rate limits for a url or a bucket. */
258
- checkRateLimits: (url: string) => number | false;
259
- /** Reshapes and modifies the obj as needed to make it ready for discords api. */
260
- changeToDiscordFormat: (obj: any) => any;
261
- /** Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord. */
262
- createRequest: (options: CreateRequestBodyOptions) => RequestBody;
263
- /** 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. */
264
- processRateLimitedPaths: () => void;
265
- /** Processes the rate limit headers and determines if it needs to be rate limited and returns the bucket id if available */
266
- processHeaders: (url: string, headers: Headers) => string | undefined;
267
- /** Sends a request to the api. */
268
- sendRequest: (options: SendRequestOptions) => Promise<void>;
269
- /** Split a url to separate rate limit buckets based on major/minor parameters. */
270
- simplifyUrl: (url: string, method: RequestMethods) => string;
271
- /** Make a request to be sent to the api. */
272
- makeRequest: <T = unknown>(method: RequestMethods, url: string, body?: Record<string, any>, options?: Record<string, any>) => Promise<T>;
273
- /** Takes a request and processes it into a queue. */
274
- processRequest: (request: SendRequestOptions) => void;
275
- /** Make a get request to the api */
276
- get: <T = void>(url: string) => Promise<Camelize<T>>;
277
- /** Make a post request to the api. */
278
- post: <T = void>(url: string, body?: Record<string, any>) => Promise<Camelize<T>>;
279
- /** Make a put request to the api. */
280
- put: <T = void>(url: string, body?: Record<string, any>, options?: Record<string, any>) => Promise<Camelize<T>>;
281
- /** Make a delete request to the api. */
282
- delete: (url: string, body?: Record<string, any>) => Promise<void>;
283
- /** Make a patch request to the api. */
284
- patch: <T = void>(url: string, body?: Record<string, any>) => Promise<Camelize<T>>;
285
- /**
286
- * Adds a reaction to a message.
287
- *
288
- * @param channelId - The ID of the channel the message to add a reaction to is in.
289
- * @param messageId - The ID of the message to add a reaction to.
290
- * @param reaction - The reaction to add to the message.
291
- * @returns
292
- *
293
- * @remarks
294
- * Requires the `READ_MESSAGE_HISTORY` permission.
295
- *
296
- * If nobody else has reacted to the message:
297
- * - Requires the `ADD_REACTIONS` permission.
298
- *
299
- * Fires a _Message Reaction Add_ gateway event.
300
- *
301
- * @see {@link https://discord.com/developers/docs/resources/channel#create-reaction}
302
- */
303
- addReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
304
- /**
305
- * Adds multiple a reaction to a message.
306
- *
307
- * This function uses the `addReaction()` helper behind the scenes.
308
- *
309
- * @param channelId - The ID of the channel the message to add reactions to is in.
310
- * @param messageId - The ID of the message to add the reactions to.
311
- * @param reactions - The reactions to add to the message.
312
- * @param ordered - Whether the reactions must be added in order or not.
313
- *
314
- * @remarks
315
- * Requires the `READ_MESSAGE_HISTORY` permission.
316
- *
317
- * If nobody else has reacted to the message:
318
- * - Requires the `ADD_REACTIONS` permission.
319
- *
320
- * Fires a _Message Reaction Add_ gateway event for every reaction added.
321
- */
322
- addReactions: (channelId: BigString, messageId: BigString, reactions: string[], ordered?: boolean) => Promise<void>;
323
- /**
324
- * Adds a role to a member.
325
- *
326
- * @param guildId - The ID of the guild the member to add the role to is in.
327
- * @param userId - The user ID of the member to add the role to.
328
- * @param roleId - The ID of the role to add to the member.
329
- *
330
- * @remarks
331
- * Requires the `MANAGE_ROLES` permission.
332
- *
333
- * Fires a _Guild Member Update_ gateway event.
334
- *
335
- * @see {@link https://discord.com/developers/docs/resources/guild#add-guild-member-role}
336
- */
337
- addRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
338
- /**
339
- * Adds a member to a thread.
340
- *
341
- * @param channelId - The ID of the thread to add the member to.
342
- * @param userId - The user ID of the member to add to the thread.
343
- *
344
- * @remarks
345
- * Requires the ability to send messages in the thread.
346
- * Requires the thread not be archived.
347
- *
348
- * Fires a _Thread Members Update_ gateway event.
349
- *
350
- * @see {@link https://discord.com/developers/docs/resources/channel#add-thread-member}
351
- */
352
- addThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
353
- /**
354
- * Creates an automod rule in a guild.
355
- *
356
- * @param guildId - The ID of the guild to create the rule in.
357
- * @param options - The parameters for the creation of the rule.
358
- * @returns An instance of the created {@link DiscordAutoModerationRule}.
359
- *
360
- * @remarks
361
- * Requires the `MANAGE_GUILD` permission.
362
- *
363
- * Fires an _Auto Moderation Rule Create_ gateway event.
364
- *
365
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule}
366
- */
367
- createAutomodRule: (guildId: BigString, options: CreateAutoModerationRuleOptions) => Promise<Camelize<DiscordAutoModerationRule>>;
368
- /**
369
- * Creates a channel within a guild.
370
- *
371
- * @param guildId - The ID of the guild to create the channel within.
372
- * @param options - The parameters for the creation of the channel.
373
- * @returns An instance of the created {@link DiscordChannel}.
374
- *
375
- * @remarks
376
- * Requires the `MANAGE_CHANNELS` permission.
377
- *
378
- * If setting permission overwrites, only the permissions the bot user has in the guild can be allowed or denied.
379
- *
380
- * Setting the `MANAGE_ROLES` permission is only possible for guild administrators.
381
- *
382
- * Fires a _Channel Create_ gateway event.
383
- *
384
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
385
- */
386
- createChannel: (guildId: BigString, options: CreateGuildChannel) => Promise<Camelize<DiscordChannel>>;
387
- /**
388
- * Creates an emoji in a guild.
389
- *
390
- * @param guildId - The ID of the guild in which to create the emoji.
391
- * @param options - The parameters for the creation of the emoji.
392
- * @returns An instance of the created {@link DiscordEmoji}.
393
- *
394
- * @remarks
395
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
396
- *
397
- * Emojis have a maximum file size of 256 kilobits. Attempting to upload a larger emoji will cause the route to return 400 Bad Request.
398
- *
399
- * Fires a _Guild Emojis Update_ gateway event.
400
- *
401
- * @see {@link https://discord.com/developers/docs/resources/emoji#create-guild-emoji}
402
- */
403
- createEmoji: (guildId: BigString, options: CreateGuildEmoji) => Promise<Camelize<DiscordEmoji>>;
404
- /**
405
- * Creates a new thread in a forum channel, and sends a message within the created thread.
406
- *
407
- * @param channelId - The ID of the forum channel to create the thread within.
408
- * @param options - The parameters for the creation of the thread.
409
- * @returns An instance of {@link DiscordChannel} with a nested {@link Message} object.
410
- *
411
- * @remarks
412
- * Requires the `CREATE_MESSAGES` permission.
413
- *
414
- * Fires a _Thread Create_ gateway event.
415
- * Fires a _Message Create_ gateway event.
416
- *
417
- * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel}
418
- *
419
- * @experimental
420
- */
421
- createForumThread: (channelId: BigString, options: CreateForumPostWithMessage) => Promise<Camelize<DiscordChannel>>;
422
- /**
423
- * Creates an application command accessible globally; across different guilds and channels.
424
- *
425
- * @param command - The command to create.
426
- * @returns An instance of the created {@link ApplicationCommand}.
427
- *
428
- * @remarks
429
- * ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
430
- * ⚠️ Global commands once created are cached for periods of __an hour__, so changes made to existing commands will take an hour to surface.
431
- * ⚠️ You can only create up to 200 _new_ commands daily.
432
- *
433
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
434
- */
435
- createGlobalApplicationCommand: (command: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
436
- /**
437
- * Creates a guild.
438
- *
439
- * @param options - The parameters for the creation of the guild.
440
- * @returns An instance of the created {@link DiscordGuild}.
441
- *
442
- * @remarks
443
- * ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
444
- *
445
- * Fires a _Guild Create_ gateway event.
446
- *
447
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
448
- */
449
- createGuild: (options: CreateGuild) => Promise<Camelize<DiscordGuild>>;
450
- /**
451
- * Creates an application command only accessible in a specific guild.
452
- *
453
- * @param command - The command to create.
454
- * @param guildId - The ID of the guild to create the command for.
455
- * @returns An instance of the created {@link ApplicationCommand}.
456
- *
457
- * @remarks
458
- * ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
459
- * ⚠️ You can only create up to 200 _new_ commands daily.
460
- *
461
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
462
- */
463
- createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
464
- /**
465
- * Creates a guild from a template.
466
- *
467
- * @param templateCode - The code of the template.
468
- * @param options - The parameters for the creation of the guild.
469
- * @returns An instance of the created {@link Guild}.
470
- *
471
- * @remarks
472
- * ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
473
- *
474
- * Fires a _Guild Create_ gateway event.
475
- *
476
- * @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template}
477
- */
478
- createGuildFromTemplate: (templateCode: string, options: CreateGuildFromTemplate) => Promise<Camelize<DiscordGuild>>;
479
- /**
480
- * Create a new sticker for the guild.
481
- *
482
- * @param guildId The ID of the guild to get
483
- * @return A {@link DiscordSticker}
484
- *
485
- * @remarks
486
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
487
- * Fires a Guild Stickers Update Gateway event.
488
- * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
489
- * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
490
- *
491
- * @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
492
- */
493
- createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions) => Promise<Camelize<DiscordSticker>>;
494
- /**
495
- * Creates a template from a guild.
496
- *
497
- * @param guildId - The ID of the guild to create the template from.
498
- * @param options - The parameters for the creation of the template.
499
- * @returns An instance of the created {@link Template}.
500
- *
501
- * @remarks
502
- * Requires the `MANAGE_GUILD` permission.
503
- *
504
- * Fires a _Guild Update_ gateway event.
505
- *
506
- * @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
507
- */
508
- createGuildTemplate: (guildId: BigString, options: CreateTemplate) => Promise<Camelize<DiscordTemplate>>;
509
- /**
510
- * Creates an invite to a channel in a guild.
511
- *
512
- * @param channelId - The ID of the channel to create the invite to.
513
- * @param options - The parameters for the creation of the invite.
514
- * @returns An instance of the created {@link DiscordInvite}.
515
- *
516
- * @remarks
517
- * Requires the `CREATE_INSTANT_INVITE` permission.
518
- *
519
- * Fires an _Invite Create_ gateway event.
520
- *
521
- * @privateRemarks
522
- * The request body is not optional, and an empty JSON object must be sent regardless of whether any fields are being transmitted.
523
- *
524
- * @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
525
- */
526
- createInvite: (channelId: BigString, options?: CreateChannelInvite) => Promise<Camelize<DiscordInvite>>;
527
- /**
528
- * Creates a role in a guild.
529
- *
530
- * @param guildId - The ID of the guild to create the role in.
531
- * @param options - The parameters for the creation of the role.
532
- * @returns An instance of the created {@link DiscordRole}.
533
- *
534
- * @remarks
535
- * Requires the `MANAGE_ROLES` permission.
536
- *
537
- * Fires a _Guild Role Create_ gateway event.
538
- *
539
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-role}
540
- */
541
- createRole: (guildId: BigString, options: CreateGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
542
- /**
543
- * Creates a scheduled event in a guild.
544
- *
545
- * @param guildId - The ID of the guild to create the scheduled event in.
546
- * @param options - The parameters for the creation of the scheduled event.
547
- * @returns An instance of the created {@link ScheduledEvent}.
548
- *
549
- * @remarks
550
- * Requires the `MANAGE_EVENTS` permission.
551
- *
552
- * A guild can only have a maximum of 100 events with a status of {@link ScheduledEventStatus.Active} or {@link ScheduledEventStatus.Scheduled} (inclusive).
553
- *
554
- * Fires a _Guild Scheduled Event Create_ gateway event.
555
- *
556
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event}
557
- */
558
- createScheduledEvent: (guildId: BigString, options: CreateScheduledEvent) => Promise<Camelize<DiscordScheduledEvent>>;
559
- /**
560
- * Creates a stage instance associated with a stage channel.
561
- *
562
- * @param options - The parameters for the creation of the stage instance.
563
- * @returns An instance of the created {@link DiscordStageInstance}.
564
- *
565
- * @remarks
566
- * Requires the user to be a moderator of the stage channel.
567
- *
568
- * Fires a _Stage Instance Create_ gateway event.
569
- *
570
- * @see {@link https://discord.com/developers/docs/resources/stage-instance#create-stage-instance}
571
- */
572
- createStageInstance: (options: CreateStageInstance) => Promise<Camelize<DiscordStageInstance>>;
573
- /**
574
- * Creates a webhook.
575
- *
576
- * @param channelId - The ID of the channel to create the webhook in.
577
- * @param options - The parameters for the creation of the webhook.
578
- * @returns An instance of the created {@link DiscordWebhook}.
579
- *
580
- * @remarks
581
- * Requires the `MANAGE_WEBHOOKS` permission.
582
- *
583
- * ⚠️ The webhook name must not contain the string 'clyde' (case-insensitive).
584
- *
585
- * Fires a _Webhooks Update_ gateway event.
586
- *
587
- * @see {@link https://discord.com/developers/docs/resources/webhook#create-webhook}
588
- */
589
- createWebhook: (channelId: BigString, options: CreateWebhook) => Promise<Camelize<DiscordWebhook>>;
590
- /**
591
- * Deletes an automod rule.
592
- *
593
- * @param guildId - The ID of the guild to delete the rule from.
594
- * @param ruleId - The ID of the automod rule to delete.
595
- *
596
- * @remarks
597
- * Requires the `MANAGE_GUILD` permission.
598
- *
599
- * Fires an _Auto Moderation Rule Delete_ gateway event.
600
- *
601
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule}
602
- */
603
- deleteAutomodRule: (guildId: BigString, ruleId: BigString, reason?: string) => Promise<void>;
604
- /**
605
- * Deletes a channel from within a guild.
606
- *
607
- * @param channelId - The ID of the channel to delete.
608
- * @returns An instance of the deleted {@link Channel}.
609
- *
610
- * @remarks
611
- * For community guilds, the _Rules_, _Guidelines_ and _Community Update_ channels cannot be deleted.
612
- *
613
- * If the channel is a thread:
614
- * - Requires the `MANAGE_THREADS` permission.
615
- *
616
- * - Fires a _Thread Delete_ gateway event.
617
- *
618
- * Otherwise:
619
- * - Requires the `MANAGE_CHANNELS` permission.
620
- *
621
- * - ⚠️ Deleting a category channel does not delete its child channels.
622
- * Instead, they will have their `parent_id` property removed, and a `Channel Update` gateway event will fire for each of them.
623
- *
624
- * - Fires a _Channel Delete_ gateway event.
625
- *
626
- * @see {@link https://discord.com/developers/docs/resources/channel#deleteclose-channel}
627
- */
628
- deleteChannel: (channelId: BigString, reason?: string) => Promise<void>;
629
- /**
630
- * Deletes a permission override for a user or role in a channel.
631
- *
632
- * @param channelId - The ID of the channel to delete the permission override of.
633
- * @param overwriteId - The ID of the permission override to delete.
634
- *
635
- * @remarks
636
- * Requires the `MANAGE_ROLES` permission.
637
- *
638
- * Fires a _Channel Update_ gateway event.
639
- *
640
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-permission}
641
- */
642
- deleteChannelPermissionOverride: (channelId: BigString, overwriteId: BigString, reason?: string) => Promise<void>;
643
- /**
644
- * Deletes an emoji from a guild.
645
- *
646
- * @param guildId - The ID of the guild from which to delete the emoji.
647
- * @param id - The ID of the emoji to delete.
648
- *
649
- * @remarks
650
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
651
- *
652
- * Fires a _Guild Emojis Update_ gateway event.
653
- *
654
- * @see {@link https://discord.com/developers/docs/resources/emoji#delete-guild-emoji}
655
- */
656
- deleteEmoji: (guildId: BigString, id: BigString, reason?: string) => Promise<void>;
657
- /**
658
- * Deletes a follow-up message to an interaction.
659
- *
660
- * @param token - The interaction token to use, provided in the original interaction.
661
- * @param messageId - The ID of the message to delete.
662
- *
663
- * @remarks
664
- * Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
665
- *
666
- * Fires a _Message Delete_ event.
667
- *
668
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-followup-message}
669
- */
670
- deleteFollowupMessage: (token: string, messageId: BigString) => Promise<void>;
671
- /**
672
- * Deletes an application command registered globally.
673
- *
674
- * @param commandId - The ID of the command to delete.
675
- *
676
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command}
677
- */
678
- deleteGlobalApplicationCommand: (commandId: BigString) => Promise<void>;
679
- /**
680
- * Deletes a guild.
681
- *
682
- * @param guildId - The ID of the guild to delete.
683
- *
684
- * @remarks
685
- * The bot user must be the owner of the guild.
686
- *
687
- * Fires a _Guild Delete_ gateway event.
688
- *
689
- * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
690
- */
691
- deleteGuild: (guildId: BigString) => Promise<void>;
692
- /**
693
- * Deletes an application command registered in a guild.
694
- *
695
- * @param guildId - The ID of the guild to delete the command from.
696
- * @param commandId - The ID of the command to delete from the guild.
697
- *
698
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
699
- */
700
- deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<void>;
701
- /**
702
- * Delete a new sticker for the guild.
703
- *
704
- * @param guildId The ID of the guild to get
705
- * @return A {@link DiscordSticker}
706
- *
707
- * @remarks
708
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
709
- * Fires a Guild Stickers Update Gateway event.
710
- * Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
711
- * Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
712
- *
713
- * @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
714
- */
715
- deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
716
- /**
717
- * Deletes a template from a guild.
718
- *
719
- * @param guildId - The ID of the guild to delete the template from.
720
- * @param templateCode - The code of the template to delete.
721
- *
722
- * @remarks
723
- * Requires the `MANAGE_GUILD` permission.
724
- *
725
- * Fires a _Guild Update_ gateway event.
726
- *
727
- * @see {@link https://discord.com/developers/docs/resources/guild-template#delete-guild-template}
728
- */
729
- deleteGuildTemplate: (guildId: BigString, templateCode: string) => Promise<void>;
730
- /**
731
- * Deletes an integration attached to a guild.
732
- *
733
- * @param guildId - The ID of the guild from which to delete the integration.
734
- * @param integrationId - The ID of the integration to delete from the guild.
735
- *
736
- * @remarks
737
- * Requires the `MANAGE_GUILD` permission.
738
- *
739
- * Deletes all webhooks associated with the integration, and kicks the associated bot if there is one.
740
- *
741
- * Fires a _Guild Integrations Update_ gateway event.
742
- * Fires a _Integration Delete_ gateway event.
743
- *
744
- * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-integration}
745
- */
746
- deleteIntegration: (guildId: BigString, integrationId: BigString) => Promise<void>;
747
- /**
748
- * Deletes an invite to a channel.
749
- *
750
- * @param inviteCode - The invite code of the invite to delete.
751
- *
752
- * @remarks
753
- * Requires the `MANAGE_CHANNELS` permission.
754
- *
755
- * Fires an _Invite Delete_ gateway event.
756
- *
757
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-invite}
758
- */
759
- deleteInvite: (inviteCode: string, reason?: string) => Promise<void>;
760
- /**
761
- * Deletes a message from a channel.
762
- *
763
- * @param channelId - The ID of the channel to delete the message from.
764
- * @param messageId - The ID of the message to delete from the channel.
765
- *
766
- * @remarks
767
- * If not deleting own message:
768
- * - Requires the `MANAGE_MESSAGES` permission.
769
- *
770
- * Fires a _Message Delete_ gateway event.
771
- *
772
- * @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
773
- */
774
- deleteMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
775
- /**
776
- * Deletes the initial message response to an interaction.
777
- *
778
- * @param token - The interaction token to use, provided in the original interaction.
779
- *
780
- * @remarks
781
- * Unlike `deleteMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
782
- *
783
- * Fires a _Message Delete_ event.
784
- *
785
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response}
786
- */
787
- deleteOriginalInteractionResponse: (token: string) => Promise<void>;
788
- /**
789
- * Deletes a role from a guild.
790
- *
791
- * @param guildId - The ID of the guild to delete the role from.
792
- * @param roleId - The ID of the role to delete.
793
- *
794
- * @remarks
795
- * Requires the `MANAGE_ROLES` permission.
796
- *
797
- * Fires a _Guild Role Delete_ gateway event.
798
- *
799
- * @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-role}
800
- */
801
- deleteRole: (guildId: BigString, roleId: BigString) => Promise<void>;
802
- /**
803
- * Deletes a scheduled event from a guild.
804
- *
805
- * @param guildId - The ID of the guild to delete the scheduled event from.
806
- * @param eventId - The ID of the scheduled event to delete.
807
- *
808
- * @remarks
809
- * Requires the `MANAGE_EVENTS` permission.
810
- *
811
- * Fires a _Guild Scheduled Event Delete_ gateway event.
812
- *
813
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event}
814
- */
815
- deleteScheduledEvent: (guildId: BigString, eventId: BigString) => Promise<void>;
816
- /**
817
- * Deletes the stage instance associated with a stage channel, if one exists.
818
- *
819
- * @param channelId - The ID of the stage channel the stage instance is associated with.
820
- *
821
- * @remarks
822
- * Requires the user to be a moderator of the stage channel.
823
- *
824
- * Fires a _Stage Instance Delete_ gateway event.
825
- *
826
- * @see {@link https://discord.com/developers/docs/resources/stage-instance#delete-stage-instance}
827
- */
828
- deleteStageInstance: (channelId: BigString, reason?: string) => Promise<void>;
829
- /**
830
- * Deletes a webhook.
831
- *
832
- * @param webhookId - The ID of the webhook to delete.
833
- *
834
- * @remarks
835
- * Requires the `MANAGE_WEBHOOKS` permission.
836
- *
837
- * Fires a _Webhooks Update_ gateway event.
838
- *
839
- * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
840
- */
841
- deleteWebhook: (webhookId: BigString, reason?: string) => Promise<void>;
842
- /**
843
- * Deletes a webhook message.
844
- *
845
- * @param webhookId - The ID of the webhook to delete the message belonging to.
846
- * @param token - The webhook token, used to manage the webhook.
847
- * @param messageId - The ID of the message to delete.
848
- * @param options - The parameters for the deletion of the message.
849
- *
850
- * @remarks
851
- * Fires a _Message Delete_ gateway event.
852
- *
853
- * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook}
854
- */
855
- deleteWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: DeleteWebhookMessageOptions) => Promise<void>;
856
- /**
857
- * Deletes a webhook message using the webhook token, thereby bypassing the need for authentication + permissions.
858
- *
859
- * @param webhookId - The ID of the webhook to delete the message belonging to.
860
- * @param token - The webhook token, used to delete the webhook.
861
- *
862
- * @remarks
863
- * Fires a _Message Delete_ gateway event.
864
- *
865
- * @see {@link https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token}
866
- */
867
- deleteWebhookWithToken: (webhookId: BigString, token: string) => Promise<void>;
868
- /**
869
- * Edits the permissions for a guild application command.
870
- *
871
- * @param guildId - The ID of the guild the command is registered in.
872
- * @param commandId - The ID of the command to edit the permissions of.
873
- * @param bearerToken - The bearer token to use to make the request.
874
- * @param options - The parameters for the edit of the command permissions.
875
- * @returns An instance of the edited {@link ApplicationCommandPermission}.
876
- *
877
- * @remarks
878
- * 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.
879
- *
880
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
881
- */
882
- editApplicationCommandPermissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: ApplicationCommandPermissions[]) => Promise<Camelize<DiscordApplicationCommandPermissions>>;
883
- /**
884
- * Edits an automod rule.
885
- *
886
- * @param guildId - The ID of the guild to edit the rule in.
887
- * @param ruleId - The ID of the rule to edit.
888
- * @param options - The parameters for the edit of the rule.
889
- * @returns An instance of the edited {@link DiscordAutoModerationRule}.
890
- *
891
- * @remarks
892
- * Requires the `MANAGE_GUILD` permission.
893
- *
894
- * Fires an _Auto Moderation Rule Update_ gateway event.
895
- *
896
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule}
897
- */
898
- editAutomodRule: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions>) => Promise<Camelize<DiscordAutoModerationRule>>;
899
- /**
900
- * Modifies the bot's username or avatar.
901
- * NOTE: username: if changed may cause the bot's discriminator to be randomized.
902
- */
903
- editBotProfile: (options: {
904
- username?: string;
905
- botAvatarURL?: string | null;
906
- }) => Promise<Camelize<DiscordUser>>;
907
- /**
908
- * Edits a channel's settings.
909
- *
910
- * @param channelId - The ID of the channel to edit.
911
- * @param options - The parameters for the edit of the channel.
912
- * @returns An instance of the edited {@link DiscordChannel}.
913
- *
914
- * @remarks
915
- * If editing a channel of type {@link ChannelTypes.GroupDm}:
916
- * - Fires a _Channel Update_ gateway event.
917
- *
918
- * If editing a thread channel:
919
- * - 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.
920
- *
921
- * - Fires a _Thread Update_ gateway event.
922
- *
923
- * If editing a guild channel:
924
- * - Requires the `MANAGE_CHANNELS` permission.
925
- *
926
- * - If modifying permission overrides:
927
- * - Requires the `MANAGE_ROLES` permission.
928
- *
929
- * - 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.
930
- *
931
- * - If modifying a channel of type {@link ChannelTypes.GuildCategory}:
932
- * - Fires a _Channel Update_ gateway event for each child channel impacted in this change.
933
- * - Otherwise:
934
- * - Fires a _Channel Update_ gateway event.
935
- */
936
- editChannel: (channelId: BigString, options: ModifyChannel) => Promise<Camelize<DiscordChannel>>;
937
- /**
938
- * Edits the permission overrides for a user or role in a channel.
939
- *
940
- * @param channelId - The ID of the channel to edit the permission overrides of.
941
- * @param options - The permission override.
942
- *
943
- * @remarks
944
- * Requires the `MANAGE_ROLES` permission.
945
- *
946
- * 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.
947
- *
948
- * Fires a _Channel Update_ gateway event.
949
- *
950
- * @see {@link https://discord.com/developers/docs/resources/channel#edit-channel-permissions}
951
- */
952
- editChannelPermissionOverrides: (channelId: BigString, options: EditChannelPermissionOverridesOptions) => Promise<void>;
953
- /**
954
- * Edits the positions of a set of channels in a guild.
955
- *
956
- * @param guildId - The ID of the guild in which to edit the positions of the channels.
957
- * @param channelPositions - A set of objects defining the updated positions of the channels.
958
- *
959
- * @remarks
960
- * Requires the `MANAGE_CHANNELS` permission.
961
- *
962
- * Fires a _Channel Update_ gateway event for every channel impacted in this change.
963
- *
964
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions}
965
- */
966
- editChannelPositions: (guildId: BigString, channelPositions: ModifyGuildChannelPositions[]) => Promise<void>;
967
- /**
968
- * Edits an emoji.
969
- *
970
- * @param guildId - The ID of the guild in which to edit the emoji.
971
- * @param id - The ID of the emoji to edit.
972
- * @param options - The parameters for the edit of the emoji.
973
- * @returns An instance of the updated {@link DiscordEmoji}.
974
- *
975
- * @remarks
976
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
977
- *
978
- * Fires a `Guild Emojis Update` gateway event.
979
- *
980
- * @see {@link https://discord.com/developers/docs/resources/emoji#modify-guild-emoji}
981
- */
982
- editEmoji: (guildId: BigString, id: BigString, options: ModifyGuildEmoji) => Promise<Camelize<DiscordEmoji>>;
983
- /**
984
- * Edits a follow-up message to an interaction.
985
- *
986
- * @param token - The interaction token to use, provided in the original interaction.
987
- * @param messageId - The ID of the message to edit.
988
- * @param options - The parameters for the edit of the message.
989
- * @returns An instance of the edited {@link Message}.
990
- *
991
- * @remarks
992
- * Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
993
- *
994
- * Does not support ephemeral follow-up messages due to these being stateless.
995
- *
996
- * Fires a _Message Update_ event.
997
- *
998
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message}
999
- */
1000
- editFollowupMessage: (token: string, messageId: BigString, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
1001
- /**
1002
- * Edits a global application command.
1003
- *
1004
- * @param commandId - The ID of the command to edit.
1005
- * @param options - The parameters for the edit of the command.
1006
- * @returns An instance of the edited {@link ApplicationCommand}.
1007
- *
1008
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
1009
- */
1010
- editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
1011
- /**
1012
- * Edits a guild's settings.
1013
- *
1014
- * @param guildId - The ID of the guild to edit.
1015
- * @param shardId - The ID of the shard the guild is in.
1016
- * @param options - The parameters for the edit of the guild.
1017
- * @returns An instance of the edited {@link Guild}.
1018
- *
1019
- * @remarks
1020
- * Requires the `MANAGE_GUILD` permission.
1021
- *
1022
- * If attempting to add or remove the {@link GuildFeatures.Community} feature:
1023
- * - Requires the `ADMINISTRATOR` permission.
1024
- *
1025
- * Fires a _Guild Update_ gateway event.
1026
- *
1027
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
1028
- */
1029
- editGuild: (guildId: BigString, options: ModifyGuild) => Promise<Camelize<DiscordGuild>>;
1030
- /**
1031
- * Edits an application command registered in a guild.
1032
- *
1033
- * @param guildId - The ID of the guild the command is registered in.
1034
- * @param commandId - The ID of the command to edit.
1035
- * @param options - The parameters for the edit of the command.
1036
- * @returns An instance of the edited {@link ApplicationCommand}.
1037
- *
1038
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
1039
- */
1040
- editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
1041
- /**
1042
- * Edit the given sticker.
1043
- *
1044
- * @param guildId The ID of the guild to get
1045
- * @return A {@link DiscordSticker}
1046
- *
1047
- * @remarks
1048
- * Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
1049
- * Fires a Guild Stickers Update Gateway event.
1050
- *
1051
- * @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
1052
- */
1053
- editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>) => Promise<Camelize<DiscordSticker>>;
1054
- /**
1055
- * Edits a template's settings.
1056
- *
1057
- * @param guildId - The ID of the guild to edit a template of.
1058
- * @param templateCode - The code of the template to edit.
1059
- * @param options - The parameters for the edit of the template.
1060
- * @returns An instance of the edited {@link Template}.
1061
- *
1062
- * @remarks
1063
- * Requires the `MANAGE_GUILD` permission.
1064
- *
1065
- * Fires a _Guild Update_ gateway event.
1066
- *
1067
- * @see {@link https://discord.com/developers/docs/resources/guild-template#modify-guild-template}
1068
- */
1069
- editGuildTemplate: (guildId: BigString, templateCode: string, options: ModifyGuildTemplate) => Promise<Camelize<DiscordTemplate>>;
1070
- /**
1071
- * Edits a message.
1072
- *
1073
- * @param channelId - The ID of the channel to edit the message in.
1074
- * @param messageId - The IDs of the message to edit.
1075
- * @param options - The parameters for the edit of the message.
1076
- * @returns An instance of the edited {@link Message}.
1077
- *
1078
- * @remarks
1079
- * If editing another user's message:
1080
- * - Requires the `MANAGE_MESSAGES` permission.
1081
- * - Only the {@link EditMessage.flags | flags} property of the {@link options} object parameter can be edited.
1082
- *
1083
- * Fires a _Message Update_ gateway event.
1084
- *
1085
- * @see {@link https://discord.com/developers/docs/resources/channel#edit-message}
1086
- */
1087
- editMessage: (channelId: BigString, messageId: BigString, options: EditMessage) => Promise<Camelize<DiscordMessage>>;
1088
- /**
1089
- * Edits the initial message response to an interaction.
1090
- *
1091
- * @param token - The interaction token to use, provided in the original interaction.
1092
- * @param options - The parameters for the edit of the response.
1093
- * @returns An instance of the edited {@link Message}.
1094
- *
1095
- * @remarks
1096
- * Unlike `editMessage()`, this endpoint allows the bot user to act without needing to see the channel the message is in.
1097
- *
1098
- * Does not support ephemeral follow-up messages due to these being stateless.
1099
- *
1100
- * Fires a _Message Update_ event.
1101
- *
1102
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response}
1103
- */
1104
- editOriginalInteractionResponse: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage> | undefined>;
1105
- /**
1106
- * Edits the original webhook message.
1107
- *
1108
- * @param webhookId - The ID of the webhook to edit the original message of.
1109
- * @param token - The webhook token, used to edit the message.
1110
- * @param options - The parameters for the edit of the message.
1111
- * @returns An instance of the edited {@link DiscordMessage}.
1112
- *
1113
- * @remarks
1114
- * Fires a _Message Update_ gateway event.
1115
- *
1116
- * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
1117
- */
1118
- editOriginalWebhookMessage: (webhookId: BigString, token: string, options: InteractionCallbackData & {
1119
- threadId?: BigString;
1120
- }) => Promise<Camelize<DiscordMessage>>;
1121
- /**
1122
- * Edits a role in a guild.
1123
- *
1124
- * @param guildId - The ID of the guild to edit the role in.
1125
- * @param roleId - The ID of the role to edit.
1126
- * @param options - The parameters for the edit of the role.
1127
- * @returns An instance of the edited {@link DiscordRole}.
1128
- *
1129
- * @remarks
1130
- * Requires the `MANAGE_ROLES` permission.
1131
- *
1132
- * Fires a _Guild Role Update_ gateway event.
1133
- *
1134
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role}
1135
- */
1136
- editRole: (guildId: BigString, roleId: BigString, options: EditGuildRole) => Promise<Camelize<DiscordRole>>;
1137
- /**
1138
- * Edits the positions of a set of roles.
1139
- *
1140
- * @param guildId - The ID of the guild to edit the role positions in.
1141
- * @param options - The parameters for the edit of the role positions.
1142
- * @returns A collection of {@link DiscordRole} objects assorted by role ID.
1143
- *
1144
- * @remarks
1145
- * Requires the `MANAGE_ROLES` permission.
1146
- *
1147
- * Fires a _Guild Role Update_ gateway event for every role impacted in this change.
1148
- *
1149
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role-positions}
1150
- */
1151
- editRolePositions: (guildId: BigString, options: ModifyRolePositions[]) => Promise<Camelize<DiscordRole[]>>;
1152
- /**
1153
- * Edits a scheduled event.
1154
- *
1155
- * @param guildId - The ID of the guild to edit the scheduled event in.
1156
- * @param eventId - The ID of the scheduled event to edit.
1157
- * @returns An instance of the edited {@link ScheduledEvent}.
1158
- *
1159
- * @remarks
1160
- * Requires the `MANAGE_EVENTS` permission.
1161
- *
1162
- * To start or end an event, modify the event's `status` property.
1163
- *
1164
- * The `entity_metadata` property is discarded for events whose `entity_type` is not {@link ScheduledEventEntityType.External}.
1165
- *
1166
- * Fires a _Guild Scheduled Event Update_ gateway event.
1167
- *
1168
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
1169
- */
1170
- editScheduledEvent: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent>) => Promise<Camelize<DiscordScheduledEvent>>;
1171
- /**
1172
- * Edits a stage instance.
1173
- *
1174
- * @param channelId - The ID of the stage channel the stage instance is associated with.
1175
- * @returns An instance of the updated {@link DiscordStageInstance}.
1176
- *
1177
- * @remarks
1178
- * Requires the user to be a moderator of the stage channel.
1179
- *
1180
- * Fires a _Stage Instance Update_ event.
1181
- *
1182
- * @see {@link https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance}
1183
- */
1184
- editStageInstance: (channelId: BigString, data: EditStageInstanceOptions) => Promise<Camelize<DiscordStageInstance>>;
1185
- /**
1186
- * Edits a webhook.
1187
- *
1188
- * @param webhookId - The ID of the webhook to edit.
1189
- * @returns An instance of the edited {@link DiscordWebhook}.
1190
- *
1191
- * @remarks
1192
- * Requires the `MANAGE_WEBHOOKS` permission.
1193
- *
1194
- * Fires a _Webhooks Update_ gateway event.
1195
- *
1196
- * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook}
1197
- */
1198
- editWebhook: (webhookId: BigString, options: ModifyWebhook) => Promise<Camelize<DiscordWebhook>>;
1199
- /**
1200
- * Edits a webhook message.
1201
- *
1202
- * @param webhookId - The ID of the webhook to edit the message of.
1203
- * @param token - The webhook token, used to edit the message.
1204
- * @param messageId - The ID of the message to edit.
1205
- * @param options - The parameters for the edit of the message.
1206
- * @returns An instance of the edited {@link DiscordMessage}.
1207
- *
1208
- * @remarks
1209
- * Fires a _Message Update_ gateway event.
1210
- *
1211
- * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
1212
- */
1213
- editWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options: InteractionCallbackData & {
1214
- threadId?: BigString;
1215
- }) => Promise<Camelize<DiscordMessage>>;
1216
- /**
1217
- * Edits a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
1218
- *
1219
- * @param webhookId - The ID of the webhook to edit.
1220
- * @param token - The webhook token, used to edit the webhook.
1221
- * @returns An instance of the edited {@link DiscordWebhook}.
1222
- *
1223
- * @remarks
1224
- * Requires the `MANAGE_WEBHOOKS` permission.
1225
- *
1226
- * Fires a _Webhooks Update_ gateway event.
1227
- *
1228
- * @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
1229
- */
1230
- editWebhookWithToken: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
1231
- /**
1232
- * Executes a webhook, causing a message to be posted in the channel configured for the webhook.
1233
- *
1234
- * @param webhookId - The ID of the webhook to execute.
1235
- * @param token - The webhook token, used to execute the webhook.
1236
- * @param options - The parameters for the execution of the webhook.
1237
- * @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`.
1238
- *
1239
- * @remarks
1240
- * If the webhook channel is a forum channel, you must provide a value for either `threadId` or `threadName`.
1241
- *
1242
- * @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
1243
- */
1244
- executeWebhook: (webhookId: BigString, token: string, options: ExecuteWebhook) => Promise<Camelize<DiscordMessage> | undefined>;
1245
- /**
1246
- * Follows an announcement channel, allowing messages posted within it to be cross-posted into the target channel.
1247
- *
1248
- * @param sourceChannelId - The ID of the announcement channel to follow.
1249
- * @param targetChannelId - The ID of the target channel - the channel to cross-post to.
1250
- * @returns An instance of {@link DiscordFollowedChannel}.
1251
- *
1252
- * @remarks
1253
- * Requires the `MANAGE_WEBHOOKS` permission in the __target channel__.
1254
- *
1255
- * Fires a _Webhooks Update_ gateway event.
1256
- *
1257
- * @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
1258
- */
1259
- followAnnouncement: (sourceChannelId: BigString, targetChannelId: BigString) => Promise<Camelize<DiscordFollowedChannel>>;
1260
- /**
1261
- * Gets the list of all active threads for a guild.
1262
- *
1263
- * @param guildId - The ID of the guild to get the threads of.
1264
- * @returns An instance of {@link DiscordActiveThreads}.
1265
- *
1266
- * @remarks
1267
- * Returns both public and private threads.
1268
- *
1269
- * Threads are ordered by the `id` property in descending order.
1270
- *
1271
- * @see {@link https://discord.com/developers/docs/resources/guild#list-active-guild-threads}
1272
- */
1273
- getActiveThreads: (guildId: BigString) => Promise<Camelize<DiscordActiveThreads>>;
1274
- /** Get the applications info */
1275
- getApplicationInfo: () => Promise<Camelize<DiscordApplication>>;
1276
- /**
1277
- * Gets the permissions of a guild application command.
1278
- *
1279
- * @param guildId - The ID of the guild the command is registered in.
1280
- * @param commandId - The ID of the command to get the permissions of.
1281
- * @returns An instance of {@link ApplicationCommandPermission}.
1282
- *
1283
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
1284
- */
1285
- getApplicationCommandPermission: (guildId: BigString, commandId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions>>;
1286
- /**
1287
- * Gets the permissions of all application commands registered in a guild by the ID of the guild.
1288
- *
1289
- * @param guildId - The ID of the guild to get the permissions objects of.
1290
- * @returns A collection of {@link ApplicationCommandPermission} objects assorted by command ID.
1291
- *
1292
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
1293
- */
1294
- getApplicationCommandPermissions: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions[]>>;
1295
- /**
1296
- * Gets a guild's audit log.
1297
- *
1298
- * @param guildId - The ID of the guild to get the audit log of.
1299
- * @param options - The parameters for the fetching of the audit log.
1300
- * @returns An instance of {@link AuditLog}.
1301
- *
1302
- * @remarks
1303
- * Requires the `VIEW_AUDIT_LOG` permission.
1304
- *
1305
- * @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
1306
- */
1307
- getAuditLog: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
1308
- /**
1309
- * Gets an automod rule by its ID.
1310
- *
1311
- * @param guildId - The ID of the guild to get the rule of.
1312
- * @param ruleId - The ID of the rule to get.
1313
- * @returns An instance of {@link DiscordAutoModerationRule}.
1314
- *
1315
- * @remarks
1316
- * Requires the `MANAGE_GUILD` permission.
1317
- *
1318
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule}
1319
- */
1320
- getAutomodRule: (guildId: BigString, ruleId: BigString) => Promise<Camelize<DiscordAutoModerationRule>>;
1321
- /**
1322
- * Gets the list of automod rules for a guild.
1323
- *
1324
- * @param guildId - The ID of the guild to get the rules from.
1325
- * @returns A collection of {@link DiscordAutoModerationRule} objects assorted by rule ID.
1326
- *
1327
- * @remarks
1328
- * Requires the `MANAGE_GUILD` permission.
1329
- *
1330
- * @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
1331
- */
1332
- getAutomodRules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
1333
- /**
1334
- * Gets a ban by user ID.
1335
- *
1336
- * @param guildId - The ID of the guild to get the ban from.
1337
- * @param userId - The ID of the user to get the ban for.
1338
- * @returns An instance of {@link DiscordBan}.
1339
- *
1340
- * @remarks
1341
- * Requires the `BAN_MEMBERS` permission.
1342
- *
1343
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
1344
- */
1345
- getBan: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
1346
- /**
1347
- * Gets the list of bans for a guild.
1348
- *
1349
- * @param guildId - The ID of the guild to get the list of bans for.
1350
- * @param options - The parameters for the fetching of the list of bans.
1351
- * @returns A collection of {@link DiscordBan} objects assorted by user ID.
1352
- *
1353
- * @remarks
1354
- * Requires the `BAN_MEMBERS` permission.
1355
- *
1356
- * Users are ordered by their IDs in _ascending_ order.
1357
- *
1358
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
1359
- */
1360
- getBans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan[]>>;
1361
- /**
1362
- * Gets a channel by its ID.
1363
- *
1364
- * @param channelId - The ID of the channel to get.
1365
- * @returns An instance of {@link DiscordChannel}.
1366
- *
1367
- * @remarks
1368
- * If the channel is a thread, a {@link ThreadMember} object is included in the result.
1369
- *
1370
- * @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
1371
- */
1372
- getChannel: (channelId: BigString) => Promise<Camelize<DiscordChannel>>;
1373
- /**
1374
- * Gets the list of invites for a channel.
1375
- *
1376
- * @param channelId - The ID of the channel to get the invites of.
1377
- * @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
1378
- *
1379
- * @remarks
1380
- * Requires the `MANAGE_CHANNELS` permission.
1381
- *
1382
- * Only usable for guild channels.
1383
- *
1384
- * @see {@link https://discord.com/developers/docs/resources/channel#get-channel-invites}
1385
- */
1386
- getChannelInvites: (channelId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
1387
- /**
1388
- * Gets the list of channels for a guild.
1389
- *
1390
- * @param guildId - The ID of the guild to get the channels of.
1391
- * @returns A collection of {@link DiscordChannel} objects assorted by channel ID.
1392
- *
1393
- * @remarks
1394
- * Excludes threads.
1395
- *
1396
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
1397
- */
1398
- getChannels: (guildId: BigString) => Promise<Camelize<DiscordChannel[]>>;
1399
- /**
1400
- * Gets a list of webhooks for a channel.
1401
- *
1402
- * @param channelId - The ID of the channel which to get the webhooks of.
1403
- * @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
1404
- *
1405
- * @remarks
1406
- * Requires the `MANAGE_WEBHOOKS` permission.
1407
- *
1408
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-channel-webhooks}
1409
- */
1410
- getChannelWebhooks: (channelId: BigString) => Promise<Camelize<DiscordWebhook[]>>;
1411
- /**
1412
- * Gets or creates a DM channel with a user.
1413
- *
1414
- * @param userId - The ID of the user to create the DM channel with.
1415
- * @returns An instance of {@link DiscordChannel}.
1416
- *
1417
- * @see {@link https://discord.com/developers/docs/resources/user#create-dm}
1418
- */
1419
- getDmChannel: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
1420
- /**
1421
- * Gets an emoji by its ID.
1422
- *
1423
- * @param guildId - The ID of the guild from which to get the emoji.
1424
- * @param emojiId - The ID of the emoji to get.
1425
- * @returns An instance of {@link DiscordEmoji}.
1426
- *
1427
- * @see {@link https://discord.com/developers/docs/resources/emoji#get-guild-emoji}
1428
- */
1429
- getEmoji: (guildId: BigString, emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
1430
- /**
1431
- * Gets the list of emojis for a guild.
1432
- *
1433
- * @param guildId - The ID of the guild which to get the emojis of.
1434
- * @returns A collection of {@link DiscordEmoji} objects assorted by emoji ID.
1435
- *
1436
- * @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
1437
- */
1438
- getEmojis: (guildId: BigString) => Promise<Camelize<DiscordEmoji[]>>;
1439
- /**
1440
- * Gets a follow-up message to an interaction by the ID of the message.
1441
- *
1442
- * @param token - The interaction token to use, provided in the original interaction.
1443
- * @param messageId - The ID of the message to get.
1444
- * @returns An instance of {@link Message}.
1445
- *
1446
- * @remarks
1447
- * Unlike `getMessage()`, this endpoint allows the bot user to act without:
1448
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
1449
- * - Requiring the `MESSAGE_CONTENT` intent.
1450
- *
1451
- * Does not support ephemeral follow-up messages due to these being stateless.
1452
- *
1453
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message}
1454
- */
1455
- getFollowupMessage: (token: string, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
1456
- /** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
1457
- getGatewayBot: () => Promise<Camelize<DiscordGetGatewayBot>>;
1458
- /**
1459
- * Gets a global application command by its ID.
1460
- *
1461
- * @param commandId - The ID of the command to get.
1462
- * @returns An instance of {@link ApplicationCommand}.
1463
- *
1464
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-command}
1465
- */
1466
- getGlobalApplicationCommand: (commandId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
1467
- /**
1468
- * Gets the list of your bot's global application commands.
1469
- *
1470
- * @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
1471
- *
1472
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
1473
- */
1474
- getGlobalApplicationCommands: () => Promise<Camelize<DiscordApplicationCommand[]>>;
1475
- /**
1476
- * Gets a guild by its ID.
1477
- *
1478
- * @param guildId - The ID of the guild to get.
1479
- * @param options - The parameters for the fetching of the guild.
1480
- * @returns An instance of {@link Guild}.
1481
- *
1482
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
1483
- */
1484
- getGuild: (guildId: BigString, options?: {
1485
- counts?: boolean;
1486
- }) => Promise<Camelize<DiscordGuild>>;
1487
- /**
1488
- * Gets a guild application command by its ID.
1489
- *
1490
- * @param guildId - The ID of the guild the command is registered in.
1491
- * @param commandId - The ID of the command to get.
1492
- * @returns An instance of {@link ApplicationCommand}.
1493
- *
1494
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command}
1495
- */
1496
- getGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
1497
- /**
1498
- * Gets the list of application commands registered by your bot in a guild.
1499
- *
1500
- * @param guildId - The ID of the guild the commands are registered in.
1501
- * @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
1502
- *
1503
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
1504
- */
1505
- getGuildApplicationCommands: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommand[]>>;
1506
- /**
1507
- * Returns a sticker object for the given guild and sticker IDs.
1508
- *
1509
- * @param guildId The ID of the guild to get
1510
- * @param stickerId The ID of the sticker to get
1511
- * @return A {@link DiscordSticker}
1512
- *
1513
- * @remarks Includes the user field if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
1514
- *
1515
- * @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
1516
- */
1517
- getGuildSticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
1518
- /**
1519
- * Returns an array of sticker objects for the given guild.
1520
- *
1521
- * @param guildId The ID of the guild to get
1522
- * @returns A collection of {@link DiscordSticker} objects assorted by sticker ID.
1523
- *
1524
- * @remarks Includes user fields if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
1525
- *
1526
- * @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
1527
- */
1528
- getGuildStickers: (guildId: BigString) => Promise<Camelize<DiscordSticker[]>>;
1529
- /**
1530
- * Gets a template by its code.
1531
- *
1532
- * @param templateCode - The code of the template to get.
1533
- * @returns An instance of {@link Template}.
1534
- *
1535
- * @remarks
1536
- * Requires the `MANAGE_GUILD` permission.
1537
- *
1538
- * @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-template}
1539
- */
1540
- getGuildTemplate: (templateCode: string) => Promise<Camelize<DiscordTemplate>>;
1541
- /**
1542
- * Gets the list of templates for a guild.
1543
- *
1544
- * @param guildId - The ID of the guild to get the list of templates for.
1545
- * @returns A collection of {@link Template} objects assorted by template code.
1546
- *
1547
- * @remarks
1548
- * Requires the `MANAGE_GUILD` permission.
1549
- *
1550
- * @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
1551
- */
1552
- getGuildTemplates: (guildId: BigString) => Promise<Camelize<DiscordTemplate[]>>;
1553
- /**
1554
- * Gets the list of webhooks for a guild.
1555
- *
1556
- * @param guildId - The ID of the guild to get the list of webhooks for.
1557
- * @returns A collection of {@link DiscordWebhook} objects assorted by webhook ID.
1558
- *
1559
- * @remarks
1560
- * Requires the `MANAGE_WEBHOOKS` permission.
1561
- *
1562
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
1563
- */
1564
- getGuildWebhooks: (guildId: BigString) => Promise<Camelize<DiscordWebhook[]>>;
1565
- /**
1566
- * Gets the list of integrations attached to a guild.
1567
- *
1568
- * @param guildId - The ID of the guild to get the list of integrations from.
1569
- * @returns A collection of {@link Integration} objects assorted by integration ID.
1570
- *
1571
- * @remarks
1572
- * Requires the `MANAGE_GUILD` permission.
1573
- *
1574
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-integrations}
1575
- */
1576
- getIntegrations: (guildId: BigString) => Promise<Camelize<DiscordIntegration[]>>;
1577
- /**
1578
- * Gets an invite to a channel by its invite code.
1579
- *
1580
- * @param inviteCode - The invite code of the invite to get.
1581
- * @param options - The parameters for the fetching of the invite.
1582
- * @returns An instance of {@link DiscordInviteMetadata}.
1583
- *
1584
- * @see {@link https://discord.com/developers/docs/resources/invite#get-invite}
1585
- */
1586
- getInvite: (inviteCode: string, options?: GetInvite) => Promise<Camelize<DiscordInviteMetadata>>;
1587
- /**
1588
- * Gets the list of invites for a guild.
1589
- *
1590
- * @param guildId - The ID of the guild to get the invites from.
1591
- * @returns A collection of {@link InviteMetadata | Invite} objects assorted by invite code.
1592
- *
1593
- * @remarks
1594
- * Requires the `MANAGE_GUILD` permission.
1595
- *
1596
- * @see {@link https://discord.com/developers/docs/resources/invite#get-invites}
1597
- */
1598
- getInvites: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
1599
- /**
1600
- * Returns the list of sticker packs available to Nitro subscribers.
1601
- *
1602
- * @param bot The bot instance to use to make the request.
1603
- * @returns A collection of {@link StickerPack} objects assorted by sticker ID.
1604
- *
1605
- * @see {@link https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs}
1606
- */
1607
- getNitroStickerPacks: () => Promise<Camelize<DiscordStickerPack[]>>;
1608
- /**
1609
- * Gets the initial message response to an interaction.
1610
- *
1611
- * @param token - The interaction token to use, provided in the original interaction.
1612
- * @returns An instance of {@link Message}.
1613
- *
1614
- * @remarks
1615
- * Unlike `getMessage()`, this endpoint allows the bot user to act without:
1616
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
1617
- * - Requiring the `MESSAGE_CONTENT` intent.
1618
- *
1619
- * Does not support ephemeral follow-up messages due to these being stateless.
1620
- *
1621
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
1622
- */
1623
- getOriginalInteractionResponse: (token: string) => Promise<Camelize<DiscordMessage>>;
1624
- /**
1625
- * Gets the list of private archived threads for a channel.
1626
- *
1627
- * @param channelId - The ID of the channel to get the archived threads for.
1628
- * @param options - The parameters for the fetching of threads.
1629
- * @returns An instance of {@link DiscordArchivedThreads}.
1630
- *
1631
- * @remarks
1632
- * Requires the `READ_MESSAGE_HISTORY` permission.
1633
- * Requires the `MANAGE_THREADS` permission.
1634
- *
1635
- * Returns threads of type {@link ChannelTypes.GuildPrivateThread}.
1636
- *
1637
- * Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
1638
- *
1639
- * @see {@link https://discord.com/developers/docs/resources/channel#list-private-archived-threads}
1640
- */
1641
- getPrivateArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
1642
- /**
1643
- * Gets the list of private archived threads the bot is a member of for a channel.
1644
- *
1645
- * @param channelId - The ID of the channel to get the archived threads for.
1646
- * @param options - The parameters for the fetching of threads.
1647
- * @returns An instance of {@link DiscordArchivedThreads}.
1648
- *
1649
- * @remarks
1650
- * Requires the `READ_MESSAGE_HISTORY` permission.
1651
- *
1652
- * Returns threads of type {@link ChannelTypes.GuildPrivateThread}.
1653
- *
1654
- * Threads are ordered by the `id` property in descending order.
1655
- *
1656
- * @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
1657
- */
1658
- getPrivateJoinedArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
1659
- /**
1660
- * Gets the list of public archived threads for a channel.
1661
- *
1662
- * @param channelId - The ID of the channel to get the archived threads for.
1663
- * @param options - The parameters for the fetching of threads.
1664
- * @returns An instance of {@link ArchivedThreads}.
1665
- *
1666
- * @remarks
1667
- * Requires the `READ_MESSAGE_HISTORY` permission.
1668
- *
1669
- * If called on a channel of type {@link ChannelTypes.GuildText}, returns threads of type {@link ChannelTypes.GuildPublicThread}.
1670
- * If called on a channel of type {@link ChannelTypes.GuildNews}, returns threads of type {@link ChannelTypes.GuildNewsThread}.
1671
- *
1672
- * Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
1673
- *
1674
- * @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
1675
- */
1676
- getPublicArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordArchivedThreads>>;
1677
- /**
1678
- * Gets the list of roles for a guild.
1679
- *
1680
- * @param guildId - The ID of the guild to get the list of roles for.
1681
- * @returns A collection of {@link DisorcRole} objects assorted by role ID.
1682
- *
1683
- * @remarks
1684
- * ⚠️ This endpoint should be used sparingly due to {@link User} objects already being included in guild payloads.
1685
- *
1686
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-roles}
1687
- */
1688
- getRoles: (guildId: BigString) => Promise<Camelize<DiscordRole[]>>;
1689
- /**
1690
- * Gets a scheduled event by its ID.
1691
- *
1692
- * @param guildId - The ID of the guild to get the scheduled event from.
1693
- * @param eventId - The ID of the scheduled event to get.
1694
- * @param options - The parameters for the fetching of the scheduled event.
1695
- * @returns An instance of {@link ScheduledEvent}.
1696
- *
1697
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event}
1698
- */
1699
- getScheduledEvent: (guildId: BigString, eventId: BigString, options?: {
1700
- withUserCount?: boolean;
1701
- }) => Promise<Camelize<DiscordScheduledEvent>>;
1702
- /**
1703
- * Gets the list of scheduled events for a guild.
1704
- *
1705
- * @param guildId - The ID of the guild to get the scheduled events from.
1706
- * @param options - The parameters for the fetching of the scheduled events.
1707
- * @returns A collection of {@link ScheduledEvent} objects assorted by event ID.
1708
- *
1709
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild}
1710
- */
1711
- getScheduledEvents: (guildId: BigString, options?: GetScheduledEvents) => Promise<Camelize<DiscordScheduledEvent[]>>;
1712
- /**
1713
- * Gets the list of subscribers to a scheduled event from a guild.
1714
- *
1715
- * @param guildId - The ID of the guild to get the subscribers to the scheduled event from.
1716
- * @param eventId - The ID of the scheduled event to get the subscribers of.
1717
- * @param options - The parameters for the fetching of the subscribers.
1718
- * @returns A collection of {@link User} objects assorted by user ID.
1719
- *
1720
- * @remarks
1721
- * Requires the `MANAGE_EVENTS` permission.
1722
- *
1723
- * Users are ordered by their IDs in _ascending_ order.
1724
- *
1725
- * @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users}
1726
- */
1727
- getScheduledEventUsers: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => Promise<Array<{
1728
- user: Camelize<DiscordUser>;
1729
- member?: Camelize<DiscordMember>;
1730
- }>>;
1731
- /** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
1732
- getSessionInfo: () => Promise<Camelize<DiscordGetGatewayBot>>;
1733
- /**
1734
- * Gets the stage instance associated with a stage channel, if one exists.
1735
- *
1736
- * @param channelId - The ID of the stage channel the stage instance is associated with.
1737
- * @returns An instance of {@link DiscordStageInstance}.
1738
- *
1739
- * @see {@link https://discord.com/developers/docs/resources/stage-instance#get-stage-instance}
1740
- */
1741
- getStageInstance: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
1742
- /**
1743
- * Returns a sticker object for the given sticker ID.
1744
- *
1745
- * @param stickerId The ID of the sticker to get
1746
- * @returns A {@link DiscordSticker}
1747
- *
1748
- * @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
1749
- */
1750
- getSticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
1751
- /**
1752
- * Gets a thread member by their user ID.
1753
- *
1754
- * @param channelId - The ID of the thread to get the thread member of.
1755
- * @param userId - The user ID of the thread member to get.
1756
- * @returns An instance of {@link DiscordThreadMember}.
1757
- *
1758
- * @see {@link https://discord.com/developers/docs/resources/channel#get-thread-member}
1759
- */
1760
- getThreadMember: (channelId: BigString, userId: BigString) => Promise<Camelize<DiscordThreadMember>>;
1761
- /**
1762
- * Gets the list of thread members for a thread.
1763
- *
1764
- * @param channelId - The ID of the thread to get the thread members of.
1765
- * @returns A collection of {@link DiscordThreadMember} assorted by user ID.
1766
- *
1767
- * @remarks
1768
- * Requires the application to have the `GUILD_MEMBERS` privileged intent enabled.
1769
- *
1770
- * @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
1771
- */
1772
- getThreadMembers: (channelId: BigString) => Promise<Camelize<DiscordThreadMember[]>>;
1773
- /**
1774
- * Get a user's data from the api
1775
- *
1776
- * @param id The user's id
1777
- * @returns {Camelize<DiscordUser>}
1778
- */
1779
- getUser: (id: BigString) => Promise<Camelize<DiscordUser>>;
1780
- /**
1781
- * Gets information about the vanity url of a guild.
1782
- *
1783
- * @param guildId - The ID of the guild to get the vanity url information for.
1784
- * @returns An instance of {@link VanityUrl}.
1785
- *
1786
- * @remarks
1787
- * Requires the `MANAGE_GUILD` permission.
1788
- *
1789
- * The `code` property will be `null` if the guild does not have a set vanity url.
1790
- *
1791
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
1792
- */
1793
- getVanityUrl: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
1794
- /**
1795
- * Gets the list of voice regions for a guild.
1796
- *
1797
- * @param guildId - The ID of the guild to get the voice regions for.
1798
- * @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
1799
- *
1800
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
1801
- */
1802
- getVoiceRegions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion[]>>;
1803
- /**
1804
- * Gets a webhook by its ID.
1805
- *
1806
- * @param webhookId - The ID of the webhook to get.
1807
- * @returns An instance of {@link DiscordWebhook}.
1808
- *
1809
- * @remarks
1810
- * Requires the `MANAGE_WEBHOOKS` permission.
1811
- *
1812
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
1813
- */
1814
- getWebhook: (webhookId: BigString) => Promise<Camelize<DiscordWebhook>>;
1815
- /**
1816
- * Gets a webhook message by its ID.
1817
- *
1818
- * @param webhookId - The ID of the webhook to get a message of.
1819
- * @param token - The webhook token, used to get webhook messages.
1820
- * @param messageId - the ID of the webhook message to get.
1821
- * @param options - The parameters for the fetching of the message.
1822
- * @returns An instance of {@link DiscordMessage}.
1823
- *
1824
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-message}
1825
- */
1826
- getWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: GetWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
1827
- /**
1828
- * Gets a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
1829
- *
1830
- * @param webhookId - The ID of the webhook to get.
1831
- * @param token - The webhook token, used to get the webhook.
1832
- * @returns An instance of {@link DiscordWebhook}.
1833
- *
1834
- * @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
1835
- */
1836
- getWebhookWithToken: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
1837
- /**
1838
- * Adds the bot user to a thread.
1839
- *
1840
- * @param channelId - The ID of the thread to add the bot user to.
1841
- *
1842
- * @remarks
1843
- * Requires the thread not be archived.
1844
- *
1845
- * Fires a _Thread Members Update_ gateway event.
1846
- *
1847
- * @see {@link https://discord.com/developers/docs/resources/channel#join-thread}
1848
- */
1849
- joinThread: (channelId: BigString) => Promise<void>;
1850
- /**
1851
- * Removes the bot user from a thread.
1852
- *
1853
- * @param channelId - The ID of the thread to remove the bot user from.
1854
- *
1855
- * @remarks
1856
- * Requires the thread not be archived.
1857
- *
1858
- * Fires a _Thread Members Update_ gateway event.
1859
- *
1860
- * @see {@link https://discord.com/developers/docs/resources/channel#leave-thread}
1861
- */
1862
- leaveThread: (channelId: BigString) => Promise<void>;
1863
- /**
1864
- * Cross-posts a message posted in an announcement channel to subscribed channels.
1865
- *
1866
- * @param channelId - The ID of the announcement channel.
1867
- * @param messageId - The ID of the message to cross-post.
1868
- * @returns An instance of the cross-posted {@link Message}.
1869
- *
1870
- * @remarks
1871
- * Requires the `SEND_MESSAGES` permission.
1872
- *
1873
- * If not cross-posting own message:
1874
- * - Requires the `MANAGE_MESSAGES` permission.
1875
- *
1876
- * Fires a _Message Create_ event in the guilds the subscribed channels are in.
1877
- *
1878
- * @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
1879
- */
1880
- publishMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
1881
- /**
1882
- * Removes a role from a member.
1883
- *
1884
- * @param guildId - The ID of the guild the member to remove the role from is in.
1885
- * @param userId - The user ID of the member to remove the role from.
1886
- * @param roleId - The ID of the role to remove from the member.
1887
- *
1888
- * @remarks
1889
- * Requires the `MANAGE_ROLES` permission.
1890
- *
1891
- * Fires a _Guild Member Update_ gateway event.
1892
- *
1893
- * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member-role}
1894
- */
1895
- removeRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
1896
- /**
1897
- * Removes a member from a thread.
1898
- *
1899
- * @param channelId - The ID of the thread to remove the thread member of.
1900
- * @param userId - The user ID of the thread member to remove.
1901
- *
1902
- * @remarks
1903
- * If the thread is of type {@link ChannelTypes.GuildPrivateThread}, requires to be the creator of the thread.
1904
- * Otherwise, requires the `MANAGE_THREADS` permission.
1905
- *
1906
- * Requires the thread not be archived.
1907
- *
1908
- * Fires a _Thread Members Update_ gateway event.
1909
- *
1910
- * @see {@link https://discord.com/developers/docs/resources/channel#remove-thread-member}
1911
- */
1912
- removeThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
1913
- /**
1914
- * Sends a message to a channel.
1915
- *
1916
- * @param channelId - The ID of the channel to send the message in.
1917
- * @param options - The parameters for the creation of the message.
1918
- * @returns An instance of the created {@link DiscordMessage}.
1919
- *
1920
- * @remarks
1921
- * Requires that the bot user be able to see the contents of the channel the message is to be sent in.
1922
- *
1923
- * If sending a message to a guild channel:
1924
- * - Requires the `SEND_MESSAGES` permission.
1925
- *
1926
- * If sending a TTS message:
1927
- * - Requires the `SEND_TTS_MESSAGES` permission.
1928
- *
1929
- * If sending a message as a reply to another message:
1930
- * - Requires the `READ_MESSAGE_HISTORY` permission.
1931
- * - The message being replied to cannot be a system message.
1932
- *
1933
- * ⚠️ The maximum size of a request (accounting for any attachments and message content) for bot users is _8 MiB_.
1934
- *
1935
- * Fires a _Message Create_ gateway event.
1936
- *
1937
- * @see {@link https://discord.com/developers/docs/resources/channel#create-message}
1938
- */
1939
- sendMessage: (channelId: BigString, options: CreateMessageOptions) => Promise<Camelize<DiscordMessage>>;
1940
- /**
1941
- * Sends a follow-up message to an interaction.
1942
- *
1943
- * @param token - The interaction token to use, provided in the original interaction.
1944
- * @param options - The parameters for the creation of the message.
1945
- * @returns An instance of the created {@link Message}.
1946
- *
1947
- * @remarks
1948
- * ⚠️ Interaction tokens are only valid for _15 minutes_.
1949
- *
1950
- * By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
1951
- *
1952
- * Unlike `sendMessage()`, this endpoint allows the bot user to act without:
1953
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
1954
- * - Requiring the `MESSAGE_CONTENT` intent.
1955
- *
1956
- * Fires a _Message Create_ event.
1957
- *
1958
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message}
1959
- */
1960
- sendFollowupMessage: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
1961
- /**
1962
- * Sends a response to an interaction.
1963
- *
1964
- * @param interactionId - The ID of the interaction to respond to.
1965
- * @param token - The interaction token to use, provided in the original interaction.
1966
- * @param options - The parameters for the creation of the message.
1967
- * @returns An instance of the created {@link Message}.
1968
- *
1969
- * @remarks
1970
- * ⚠️ Interaction tokens are only valid for _15 minutes_.
1971
- *
1972
- * By default, mentions are suppressed. To enable mentions, pass a mention object with the callback data.
1973
- *
1974
- * Unlike `sendMessage()`, this endpoint allows the bot user to act without:
1975
- * - Needing to be able to see the contents of the channel that the message is in. (`READ_MESSAGES` permission.)
1976
- * - Requiring the `MESSAGE_CONTENT` intent.
1977
- *
1978
- * Fires a _Message Create_ event.
1979
- *
1980
- * @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
1981
- */
1982
- sendInteractionResponse: (interactionId: BigString, token: string, options: InteractionResponse) => Promise<void>;
1983
- /**
1984
- * Creates a thread, using an existing message as its point of origin.
1985
- *
1986
- * @param channelId - The ID of the channel in which to create the thread.
1987
- * @param messageId - The ID of the message to use as the thread's point of origin.
1988
- * @param options - The parameters to use for the creation of the thread.
1989
- * @returns An instance of the created {@link Channel | Thread}.
1990
- *
1991
- * @remarks
1992
- * If called on a channel of type {@link ChannelTypes.GuildText}, creates a {@link ChannelTypes.GuildPublicThread}.
1993
- * If called on a channel of type {@link ChannelTypes.GuildNews}, creates a {@link ChannelTypes.GuildNewsThread}.
1994
- * Does not work on channels of type {@link ChannelTypes.GuildForum}.
1995
- *
1996
- * The ID of the created thread will be the same as the ID of the source message.
1997
- *
1998
- * Fires a _Thread Create_ gateway event.
1999
- *
2000
- * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message}
2001
- */
2002
- startThreadWithMessage: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage) => Promise<Camelize<DiscordChannel>>;
2003
- /**
2004
- * Creates a thread without using a message as the thread's point of origin.
2005
- *
2006
- * @param channelId - The ID of the channel in which to create the thread.
2007
- * @param options - The parameters to use for the creation of the thread.
2008
- * @returns An instance of the created {@link DiscordChannel | Thread}.
2009
- *
2010
- * @remarks
2011
- * Creating a private thread requires the server to be boosted.
2012
- *
2013
- * Fires a _Thread Create_ gateway event.
2014
- *
2015
- * @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
2016
- */
2017
- startThreadWithoutMessage: (channelId: BigString, options: StartThreadWithoutMessage) => Promise<Camelize<DiscordChannel>>;
2018
- /**
2019
- * Synchronises a template with the current state of a guild.
2020
- *
2021
- * @param guildId - The ID of the guild to synchronise a template of.
2022
- * @returns An instance of the edited {@link Template}.
2023
- *
2024
- * @remarks
2025
- * Requires the `MANAGE_GUILD` permission.
2026
- *
2027
- * Fires a _Guild Update_ gateway event.
2028
- *
2029
- * @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
2030
- */
2031
- syncGuildTemplate: (guildId: BigString) => Promise<Camelize<DiscordTemplate>>;
2032
- /**
2033
- * Triggers a typing indicator for the bot user.
2034
- *
2035
- * @param channelId - The ID of the channel in which to trigger the typing indicator.
2036
- *
2037
- * @remarks
2038
- * Generally, bots should _not_ use this route.
2039
- *
2040
- * Fires a _Typing Start_ gateway event.
2041
- *
2042
- * @see {@link https://discord.com/developers/docs/resources/channel#trigger-typing-indicator}
2043
- */
2044
- triggerTypingIndicator: (channelId: BigString) => Promise<void>;
2045
- /**
2046
- * Re-registers the list of global application commands, overwriting the previous commands completely.
2047
- *
2048
- * @param commands - The list of commands to use to overwrite the previous list.
2049
- * @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
2050
- *
2051
- * @remarks
2052
- * ❗ Commands that are not present in the `commands` array will be __deleted__.
2053
- *
2054
- * ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
2055
- *
2056
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands}
2057
- */
2058
- upsertGlobalApplicationCommands: (commands: CreateApplicationCommand[]) => Promise<Camelize<DiscordApplicationCommand[]>>;
2059
- /**
2060
- * Re-registers the list of application commands registered in a guild, overwriting the previous commands completely.
2061
- *
2062
- * @param guildId - The ID of the guild whose list of commands to overwrite.
2063
- * @param commands - The list of commands to use to overwrite the previous list.
2064
- * @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
2065
- *
2066
- * @remarks
2067
- * ❗ Commands that are not present in the `commands` array will be __deleted__.
2068
- *
2069
- * ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
2070
- *
2071
- * @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands}
2072
- */
2073
- upsertGuildApplicationCommands: (guildId: BigString, commands: CreateApplicationCommand[]) => Promise<Camelize<DiscordApplicationCommand[]>>;
2074
- /**
2075
- * Bans a user from a guild.
2076
- *
2077
-
2078
- * @param guildId - The ID of the guild to ban the user from.
2079
- * @param userId - The ID of the user to ban from the guild.
2080
- * @param options - The parameters for the creation of the ban.
2081
- *
2082
- * @remarks
2083
- * Requires the `BAN_MEMBERS` permission.
2084
- *
2085
- * Fires a _Guild Ban Add_ gateway event.
2086
- *
2087
- * @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban}
2088
- */
2089
- banMember: (guildId: BigString, userId: BigString, options?: CreateGuildBan) => Promise<void>;
2090
- /**
2091
- * Edits the nickname of the bot user.
2092
- *
2093
- * @param guildId - The ID of the guild to edit the nickname of the bot user in.
2094
- * @param options - The parameters for the edit of the nickname.
2095
- * @returns An instance of the edited {@link DiscordMember}
2096
- *
2097
- * @remarks
2098
- * Fires a _Guild Member Update_ gateway event.
2099
- *
2100
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-current-member}
2101
- */
2102
- editBotMember: (guildId: BigString, options: EditBotMemberOptions) => Promise<Camelize<DiscordMember>>;
2103
- /**
2104
- * Edits a member's properties.
2105
- *
2106
- * @param guildId - The ID of the guild to edit the member of.
2107
- * @param userId - The user ID of the member to edit.
2108
- * @param options - The parameters for the edit of the user.
2109
- *
2110
- * @remarks
2111
- * This endpoint requires various permissions depending on what is edited about the member.
2112
- * To find out the required permission to enact a change, read the documentation of this endpoint's {@link ModifyGuildMember | parameters}.
2113
- *
2114
- * Fires a _Guild Member Update_ gateway event.
2115
- *
2116
- * @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-member}
2117
- */
2118
- editMember: (guildId: BigString, userId: BigString, options: ModifyGuildMember) => Promise<Camelize<DiscordMember>>;
2119
- /**
2120
- * Gets the member object by user ID.
2121
- *
2122
-
2123
- * @param guildId - The ID of the guild to get the member object for.
2124
- * @param userId - The ID of the user to get the member object for.
2125
- * @returns An instance of {@link DiscordMemberWithUser}.
2126
- *
2127
- * @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
2128
- */
2129
- getMember: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordMemberWithUser>>;
2130
- /**
2131
- * Gets the list of members for a guild.
2132
- *
2133
- * @param guildId - The ID of the guild to get the list of members for.
2134
- * @param options - The parameters for the fetching of the members.
2135
- * @returns A collection of {@link DiscordMemberWithUser} objects assorted by user ID.
2136
- *
2137
- * @remarks
2138
- * Requires the `GUILD_MEMBERS` intent.
2139
- *
2140
- * ⚠️ It is not recommended to use this endpoint with very large bots. Instead, opt to use `fetchMembers()`:
2141
- * REST communication only permits 50 requests to be made per second, while gateways allow for up to 120 requests
2142
- * per minute per shard. For more information, read {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}.
2143
- *
2144
- * @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
2145
- * @see {@link https://discord.com/developers/docs/topics/gateway#request-guild-members}
2146
- * @see {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}
2147
- */
2148
- getMembers: (guildId: BigString, options: ListGuildMembers) => Promise<Camelize<DiscordMemberWithUser[]>>;
2149
- /**
2150
- * Kicks a member from a guild.
2151
- *
2152
-
2153
- * @param guildId - The ID of the guild to kick the member from.
2154
- * @param userId - The user ID of the member to kick from the guild.
2155
- *
2156
- * @remarks
2157
- * Requires the `KICK_MEMBERS` permission.
2158
- *
2159
- * Fires a _Guild Member Remove_ gateway event.
2160
- *
2161
- * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-member}
2162
- */
2163
- kickMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
2164
- /**
2165
- * Initiates the process of pruning inactive members.
2166
- *
2167
-
2168
- * @param guildId - The ID of the guild to prune the members of.
2169
- * @param options - The parameters for the pruning of members.
2170
- * @returns A number indicating how many members were pruned.
2171
- *
2172
- * @remarks
2173
- * Requires the `KICK_MEMBERS` permission.
2174
- *
2175
- * ❗ 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.
2176
- *
2177
- * ⚠️ 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.
2178
- *
2179
- * Fires a _Guild Member Remove_ gateway event for every member kicked.
2180
- *
2181
- * @see {@link https://discord.com/developers/docs/resources/guild#begin-guild-prune}
2182
- */
2183
- pruneMembers: (guildId: BigString, options: BeginGuildPrune) => Promise<{
2184
- pruned: number | null;
2185
- }>;
2186
- /**
2187
- * Gets the list of members whose usernames or nicknames start with a provided string.
2188
- *
2189
-
2190
- * @param guildId - The ID of the guild to search in.
2191
- * @param query - The string to match usernames or nicknames against.
2192
- * @param options - The parameters for searching through the members.
2193
- * @returns A collection of {@link DiscordMember} objects assorted by user ID.
2194
- *
2195
- * @see {@link https://discord.com/developers/docs/resources/guild#search-guild-members}
2196
- */
2197
- searchMembers: (guildId: BigString, query: string, options?: Omit<SearchMembers, 'query'>) => Promise<Camelize<DiscordMemberWithUser[]>>;
2198
- /**
2199
- * Unbans a user from a guild.
2200
- *
2201
-
2202
- * @param guildId - The ID of the guild to unban the user in.
2203
- * @param userId - The ID of the user to unban.
2204
- *
2205
- * @remarks
2206
- * Requires the `BAN_MEMBERS` permission.
2207
- *
2208
- * Fires a _Guild Ban Remove_ gateway event.
2209
- *
2210
- * @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
2211
- */
2212
- unbanMember: (guildId: BigString, userId: BigString) => Promise<void>;
2213
- }
2214
- export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
2215
- export type ApiVersions = 9 | 10;
2216
- export interface CreateWebhook extends WithReason {
2217
- /** Name of the webhook (1-80 characters) */
2218
- name: string;
2219
- /** Image url for the default webhook avatar */
2220
- avatar?: string | null;
2221
- }
2222
- export interface CreateRequestBodyOptions {
2223
- headers?: Record<string, string>;
2224
- method: RequestMethods;
2225
- body?: Record<string, unknown>;
2226
- unauthorized?: boolean;
2227
- url?: string;
2228
- }
2229
- export interface RequestBody {
2230
- headers: Record<string, string>;
2231
- body: string | FormData;
2232
- method: RequestMethods;
2233
- }
2234
- export interface SendRequestOptions {
2235
- /** The url to send the request to. */
2236
- url: string;
2237
- /** The method to use when sending the request. */
2238
- method: RequestMethods;
2239
- /** The body to be sent in the request. */
2240
- body?: Record<string, any>;
2241
- /** The amount of times this request has been retried. */
2242
- retryCount: number;
2243
- /** Handler to retry a request should it be rate limited. */
2244
- retryRequest?: (options: SendRequestOptions) => Promise<void>;
2245
- /** Resolve handler when a request succeeds. */
2246
- resolve: (value: any | PromiseLike<any>) => void;
2247
- /** Reject handler when a request fails. */
2248
- reject: (reason?: any) => void;
2249
- /** If this request has a bucket id which it falls under for rate limit */
2250
- bucketId?: string;
2251
- /** Additional request options, used for things like overriding authorization header. */
2252
- options?: Record<string, any>;
2253
- }
2254
- export interface RestRateLimitedPath {
2255
- url: string;
2256
- resetTimestamp: number;
2257
- bucketId?: string;
2258
- }
2259
- export interface WebhookMessageEditor {
2260
- /**
2261
- * Edits a webhook message.
2262
- *
2263
- * @param webhookId - The ID of the webhook to edit the message of.
2264
- * @param token - The webhook token, used to edit the message.
2265
- * @param messageId - The ID of the message to edit.
2266
- * @param options - The parameters for the edit of the message.
2267
- * @returns An instance of the edited {@link DiscordMessage}.
2268
- *
2269
- * @remarks
2270
- * Fires a _Message Update_ gateway event.
2271
- *
2272
- * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
2273
- */
2274
- (webhookId: BigString, token: string, messageId: BigString, options: InteractionCallbackData & {
2275
- threadId?: BigString;
2276
- }): Promise<Camelize<DiscordMessage>>;
2277
- /**
2278
- * Edits the original webhook message.
2279
- *
2280
- * @param webhookId - The ID of the webhook to edit the original message of.
2281
- * @param token - The webhook token, used to edit the message.
2282
- * @param options - The parameters for the edit of the message.
2283
- * @returns An instance of the edited {@link DiscordMessage}.
2284
- *
2285
- * @remarks
2286
- * Fires a _Message Update_ gateway event.
2287
- *
2288
- * @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook-message}
2289
- */
2290
- original: (webhookId: BigString, token: string, options: InteractionCallbackData & {
2291
- threadId?: BigString;
2292
- }) => Promise<Camelize<DiscordMessage>>;
2293
- }
2294
- export interface CreateTemplate {
2295
- /** Name which the template should have */
2296
- name: string;
2297
- /** Description of the template */
2298
- description?: string;
2299
- }
2300
- /** https://discord.com/developers/docs/resources/template#modify-guild-template */
2301
- export interface ModifyGuildTemplate {
2302
- /** Name of the template (1-100 characters) */
2303
- name?: string;
2304
- /** Description of the template (0-120 characters) */
2305
- description?: string | null;
2306
- }
2307
- /** https://discord.com/developers/docs/resources/guild#create-guild-ban */
2308
- export interface CreateGuildBan extends WithReason {
2309
- /** Number of seconds to delete messages for, between 0 and 604800 (7 days) */
2310
- deleteMessageSeconds?: number;
2311
- }
2312
- export interface EditBotMemberOptions extends WithReason {
2313
- nick?: string | null;
2314
- }
2315
- /** https://discord.com/developers/docs/resources/guild#modify-guild-member */
2316
- export interface ModifyGuildMember {
2317
- /** Value to set users nickname to. Requires the `MANAGE_NICKNAMES` permission */
2318
- nick?: string | null;
2319
- /** Array of role ids the member is assigned. Requires the `MANAGE_ROLES` permission */
2320
- roles?: BigString[] | null;
2321
- /** Whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel. Requires the `MUTE_MEMBERS` permission */
2322
- mute?: boolean | null;
2323
- /** Whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel. Requires the `MOVE_MEMBERS` permission */
2324
- deaf?: boolean | null;
2325
- /** Id of channel to move user to (if they are connected to voice). Requires the `MOVE_MEMBERS` permission */
2326
- channelId?: BigString | null;
2327
- /** when the user's timeout will expire and the user will be able to communicate in the guild again (up to 28 days in the future), set to null to remove timeout. Requires the `MODERATE_MEMBERS` permission */
2328
- communicationDisabledUntil?: number | null;
2329
- }
2330
- /** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
2331
- export interface BeginGuildPrune {
2332
- /** Number of days to prune (1 or more), default: 7 */
2333
- days?: number;
2334
- /** Whether 'pruned' is returned, discouraged for large guilds, default: true */
2335
- computePruneCount?: boolean;
2336
- /** Role(s) ro include, default: none */
2337
- includeRoles?: string[];
2338
- }
2339
3
  //# sourceMappingURL=manager.d.ts.map