@discordeno/rest 19.0.0-next.aba7de6 → 19.0.0-next.abfa0bb
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/invalidBucket.d.ts +6 -7
- package/dist/invalidBucket.d.ts.map +1 -1
- package/dist/invalidBucket.js +23 -25
- package/dist/invalidBucket.js.map +1 -1
- package/dist/manager.d.ts +9 -0
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +274 -739
- package/dist/manager.js.map +1 -1
- package/dist/queue.js +1 -1
- package/dist/queue.js.map +1 -1
- package/dist/routes.d.ts +3 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +487 -0
- package/dist/routes.js.map +1 -0
- package/dist/types.d.ts +111 -54
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typings/routes.d.ts +0 -2
- package/dist/typings/routes.d.ts.map +1 -1
- package/dist/typings/routes.js.map +1 -1
- package/package.json +4 -5
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ApplicationCommandPermissions, AtLeastOne, BeginGuildPrune, BigString, Camelize, CamelizedDiscordActiveThreads, CamelizedDiscordApplication, CamelizedDiscordApplicationCommand,
|
|
1
|
+
import type { ApplicationCommandPermissions, AtLeastOne, BeginGuildPrune, BigString, Camelize, CamelizedDiscordActiveThreads, CamelizedDiscordApplication, CamelizedDiscordApplicationCommand, CamelizedDiscordArchivedThreads, CamelizedDiscordAuditLog, CamelizedDiscordAutoModerationRule, CamelizedDiscordBan, CamelizedDiscordChannel, CamelizedDiscordEmoji, CamelizedDiscordFollowedChannel, CamelizedDiscordGetGatewayBot, CamelizedDiscordGuild, CamelizedDiscordGuildApplicationCommandPermissions, CamelizedDiscordGuildPreview, CamelizedDiscordGuildWidget, CamelizedDiscordGuildWidgetSettings, CamelizedDiscordIntegration, CamelizedDiscordInvite, CamelizedDiscordInviteMetadata, CamelizedDiscordMember, CamelizedDiscordMemberWithUser, CamelizedDiscordMessage, CamelizedDiscordModifyGuildWelcomeScreen, CamelizedDiscordPrunedCount, CamelizedDiscordRole, CamelizedDiscordScheduledEvent, CamelizedDiscordStageInstance, CamelizedDiscordSticker, CamelizedDiscordStickerPack, CamelizedDiscordTemplate, CamelizedDiscordThreadMember, CamelizedDiscordUser, CamelizedDiscordVanityUrl, CamelizedDiscordVoiceRegion, CamelizedDiscordWebhook, CamelizedDiscordWelcomeScreen, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuild, CreateGuildBan, CreateGuildChannel, CreateGuildEmoji, CreateGuildFromTemplate, CreateGuildRole, CreateGuildStickerOptions, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, CreateTemplate, DeleteWebhookMessageOptions, EditAutoModerationRuleOptions, EditBotMemberOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditGuildStickerOptions, EditMessage, EditOwnVoiceState, EditScheduledEvent, EditUserVoiceState, ExecuteWebhook, FileContent, GetBans, GetGuildAuditLog, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetReactions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, MfaLevels, ModifyChannel, ModifyGuild, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyGuildMember, ModifyGuildTemplate, ModifyRolePositions, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage } from '@discordeno/types';
|
|
2
2
|
import type { InvalidRequestBucket } from './invalidBucket.js';
|
|
3
3
|
import type { Queue } from './queue.js';
|
|
4
4
|
import type { RestRoutes } from './typings/routes.js';
|
|
5
5
|
export interface CreateRestManagerOptions {
|
|
6
6
|
/** The bot token which will be used to make requests. */
|
|
7
|
-
token
|
|
7
|
+
token?: string;
|
|
8
8
|
/**
|
|
9
9
|
* For old bots that have a different bot id and application id.
|
|
10
10
|
* @default bot id from token
|
|
@@ -29,7 +29,7 @@ export interface CreateRestManagerOptions {
|
|
|
29
29
|
}
|
|
30
30
|
export interface RestManager {
|
|
31
31
|
/** The bot token which will be used to make requests. */
|
|
32
|
-
token
|
|
32
|
+
token?: string;
|
|
33
33
|
/** 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. */
|
|
34
34
|
applicationId: bigint;
|
|
35
35
|
/** The api version to use when making requests. Only the latest supported version will be tested. */
|
|
@@ -40,6 +40,12 @@ export interface RestManager {
|
|
|
40
40
|
* @default https://discord.com/api
|
|
41
41
|
*/
|
|
42
42
|
baseUrl: string;
|
|
43
|
+
/**
|
|
44
|
+
* `true` if the `baseUrl` does not start with `https://discord.com/api`.
|
|
45
|
+
*
|
|
46
|
+
* Mostly used only for intern functions.
|
|
47
|
+
*/
|
|
48
|
+
isProxied: boolean;
|
|
43
49
|
/** The authorization header to attach when sending requests to the proxy. */
|
|
44
50
|
authorization?: string;
|
|
45
51
|
/** The maximum amount of times a request should be retried. Defaults to Infinity */
|
|
@@ -63,7 +69,7 @@ export interface RestManager {
|
|
|
63
69
|
/** Reshapes and modifies the obj as needed to make it ready for discords api. */
|
|
64
70
|
changeToDiscordFormat: (obj: any) => any;
|
|
65
71
|
/** Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord. */
|
|
66
|
-
|
|
72
|
+
createRequestBody: (method: RequestMethods, options?: CreateRequestBodyOptions) => RequestBody;
|
|
67
73
|
/** 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. */
|
|
68
74
|
processRateLimitedPaths: () => void;
|
|
69
75
|
/** Processes the rate limit headers and determines if it needs to be rate limited and returns the bucket id if available */
|
|
@@ -73,19 +79,19 @@ export interface RestManager {
|
|
|
73
79
|
/** Split a url to separate rate limit buckets based on major/minor parameters. */
|
|
74
80
|
simplifyUrl: (url: string, method: RequestMethods) => string;
|
|
75
81
|
/** Make a request to be sent to the api. */
|
|
76
|
-
makeRequest: <T = unknown>(method: RequestMethods, url: string, options?:
|
|
82
|
+
makeRequest: <T = unknown>(method: RequestMethods, url: string, options?: MakeRequestOptions) => Promise<T>;
|
|
77
83
|
/** Takes a request and processes it into a queue. */
|
|
78
|
-
processRequest: (request: SendRequestOptions) => void
|
|
84
|
+
processRequest: (request: SendRequestOptions) => Promise<void>;
|
|
79
85
|
/** Make a get request to the api */
|
|
80
|
-
get: <T = void>(url: string, options?: Omit<
|
|
86
|
+
get: <T = void>(url: string, options?: Omit<MakeRequestOptions, 'body'>) => Promise<Camelize<T>>;
|
|
81
87
|
/** Make a post request to the api. */
|
|
82
|
-
post: <T = void>(url: string, options?:
|
|
88
|
+
post: <T = void>(url: string, options?: MakeRequestOptions) => Promise<Camelize<T>>;
|
|
83
89
|
/** Make a put request to the api. */
|
|
84
|
-
put: <T = void>(url: string, options?:
|
|
90
|
+
put: <T = void>(url: string, options?: MakeRequestOptions) => Promise<Camelize<T>>;
|
|
85
91
|
/** Make a delete request to the api. */
|
|
86
|
-
delete: (url: string, options?: Omit<
|
|
92
|
+
delete: (url: string, options?: Omit<MakeRequestOptions, 'body'>) => Promise<void>;
|
|
87
93
|
/** Make a patch request to the api. */
|
|
88
|
-
patch: <T = void>(url: string, options?:
|
|
94
|
+
patch: <T = void>(url: string, options?: MakeRequestOptions) => Promise<Camelize<T>>;
|
|
89
95
|
/**
|
|
90
96
|
* Adds a reaction to a message.
|
|
91
97
|
*
|
|
@@ -130,6 +136,7 @@ export interface RestManager {
|
|
|
130
136
|
* @param guildId - The ID of the guild the member to add the role to is in.
|
|
131
137
|
* @param userId - The user ID of the member to add the role to.
|
|
132
138
|
* @param roleId - The ID of the role to add to the member.
|
|
139
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
133
140
|
*
|
|
134
141
|
* @remarks
|
|
135
142
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -159,6 +166,7 @@ export interface RestManager {
|
|
|
159
166
|
*
|
|
160
167
|
* @param guildId - The ID of the guild to create the rule in.
|
|
161
168
|
* @param options - The parameters for the creation of the rule.
|
|
169
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
162
170
|
* @returns An instance of the created {@link CamelizedDiscordAutoModerationRule}.
|
|
163
171
|
*
|
|
164
172
|
* @remarks
|
|
@@ -168,12 +176,13 @@ export interface RestManager {
|
|
|
168
176
|
*
|
|
169
177
|
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule}
|
|
170
178
|
*/
|
|
171
|
-
createAutomodRule: (guildId: BigString, options: CreateAutoModerationRuleOptions) => Promise<CamelizedDiscordAutoModerationRule>;
|
|
179
|
+
createAutomodRule: (guildId: BigString, options: CreateAutoModerationRuleOptions, reason?: string) => Promise<CamelizedDiscordAutoModerationRule>;
|
|
172
180
|
/**
|
|
173
181
|
* Creates a channel within a guild.
|
|
174
182
|
*
|
|
175
183
|
* @param guildId - The ID of the guild to create the channel within.
|
|
176
184
|
* @param options - The parameters for the creation of the channel.
|
|
185
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
177
186
|
* @returns An instance of the created {@link CamelizedDiscordChannel}.
|
|
178
187
|
*
|
|
179
188
|
* @remarks
|
|
@@ -187,12 +196,13 @@ export interface RestManager {
|
|
|
187
196
|
*
|
|
188
197
|
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
|
|
189
198
|
*/
|
|
190
|
-
createChannel: (guildId: BigString, options: CreateGuildChannel) => Promise<CamelizedDiscordChannel>;
|
|
199
|
+
createChannel: (guildId: BigString, options: CreateGuildChannel, reason?: string) => Promise<CamelizedDiscordChannel>;
|
|
191
200
|
/**
|
|
192
201
|
* Creates an emoji in a guild.
|
|
193
202
|
*
|
|
194
203
|
* @param guildId - The ID of the guild in which to create the emoji.
|
|
195
204
|
* @param options - The parameters for the creation of the emoji.
|
|
205
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
196
206
|
* @returns An instance of the created {@link CamelizedDiscordEmoji}.
|
|
197
207
|
*
|
|
198
208
|
* @remarks
|
|
@@ -204,12 +214,13 @@ export interface RestManager {
|
|
|
204
214
|
*
|
|
205
215
|
* @see {@link https://discord.com/developers/docs/resources/emoji#create-guild-emoji}
|
|
206
216
|
*/
|
|
207
|
-
createEmoji: (guildId: BigString, options: CreateGuildEmoji) => Promise<CamelizedDiscordEmoji>;
|
|
217
|
+
createEmoji: (guildId: BigString, options: CreateGuildEmoji, reason?: string) => Promise<CamelizedDiscordEmoji>;
|
|
208
218
|
/**
|
|
209
219
|
* Creates a new thread in a forum channel, and sends a message within the created thread.
|
|
210
220
|
*
|
|
211
221
|
* @param channelId - The ID of the forum channel to create the thread within.
|
|
212
222
|
* @param options - The parameters for the creation of the thread.
|
|
223
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
213
224
|
* @returns An instance of {@link CamelizedDiscordChannel} with a nested {@link Message} object.
|
|
214
225
|
*
|
|
215
226
|
* @remarks
|
|
@@ -222,7 +233,7 @@ export interface RestManager {
|
|
|
222
233
|
*
|
|
223
234
|
* @experimental
|
|
224
235
|
*/
|
|
225
|
-
createForumThread: (channelId: BigString, options: CreateForumPostWithMessage) => Promise<CamelizedDiscordChannel>;
|
|
236
|
+
createForumThread: (channelId: BigString, options: CreateForumPostWithMessage, reason?: string) => Promise<CamelizedDiscordChannel>;
|
|
226
237
|
/**
|
|
227
238
|
* Creates an application command accessible globally; across different guilds and channels.
|
|
228
239
|
*
|
|
@@ -284,6 +295,7 @@ export interface RestManager {
|
|
|
284
295
|
* Create a new sticker for the guild.
|
|
285
296
|
*
|
|
286
297
|
* @param guildId The ID of the guild to get
|
|
298
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
287
299
|
* @return A {@link CamelizedDiscordSticker}
|
|
288
300
|
*
|
|
289
301
|
* @remarks
|
|
@@ -294,7 +306,7 @@ export interface RestManager {
|
|
|
294
306
|
*
|
|
295
307
|
* @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
|
|
296
308
|
*/
|
|
297
|
-
createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions) => Promise<CamelizedDiscordSticker>;
|
|
309
|
+
createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions, reason?: string) => Promise<CamelizedDiscordSticker>;
|
|
298
310
|
/**
|
|
299
311
|
* Creates a template from a guild.
|
|
300
312
|
*
|
|
@@ -315,6 +327,7 @@ export interface RestManager {
|
|
|
315
327
|
*
|
|
316
328
|
* @param channelId - The ID of the channel to create the invite to.
|
|
317
329
|
* @param options - The parameters for the creation of the invite.
|
|
330
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
318
331
|
* @returns An instance of the created {@link CamelizedDiscordInvite}.
|
|
319
332
|
*
|
|
320
333
|
* @remarks
|
|
@@ -327,12 +340,13 @@ export interface RestManager {
|
|
|
327
340
|
*
|
|
328
341
|
* @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
|
|
329
342
|
*/
|
|
330
|
-
createInvite: (channelId: BigString, options?: CreateChannelInvite) => Promise<CamelizedDiscordInvite>;
|
|
343
|
+
createInvite: (channelId: BigString, options?: CreateChannelInvite, reason?: string) => Promise<CamelizedDiscordInvite>;
|
|
331
344
|
/**
|
|
332
345
|
* Creates a role in a guild.
|
|
333
346
|
*
|
|
334
347
|
* @param guildId - The ID of the guild to create the role in.
|
|
335
348
|
* @param options - The parameters for the creation of the role.
|
|
349
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
336
350
|
* @returns An instance of the created {@link CamelizedDiscordRole}.
|
|
337
351
|
*
|
|
338
352
|
* @remarks
|
|
@@ -348,6 +362,7 @@ export interface RestManager {
|
|
|
348
362
|
*
|
|
349
363
|
* @param guildId - The ID of the guild to create the scheduled event in.
|
|
350
364
|
* @param options - The parameters for the creation of the scheduled event.
|
|
365
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
351
366
|
* @returns An instance of the created {@link ScheduledEvent}.
|
|
352
367
|
*
|
|
353
368
|
* @remarks
|
|
@@ -359,11 +374,12 @@ export interface RestManager {
|
|
|
359
374
|
*
|
|
360
375
|
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event}
|
|
361
376
|
*/
|
|
362
|
-
createScheduledEvent: (guildId: BigString, options: CreateScheduledEvent) => Promise<CamelizedDiscordScheduledEvent>;
|
|
377
|
+
createScheduledEvent: (guildId: BigString, options: CreateScheduledEvent, reason?: string) => Promise<CamelizedDiscordScheduledEvent>;
|
|
363
378
|
/**
|
|
364
379
|
* Creates a stage instance associated with a stage channel.
|
|
365
380
|
*
|
|
366
381
|
* @param options - The parameters for the creation of the stage instance.
|
|
382
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
367
383
|
* @returns An instance of the created {@link CamelizedDiscordStageInstance}.
|
|
368
384
|
*
|
|
369
385
|
* @remarks
|
|
@@ -373,18 +389,19 @@ export interface RestManager {
|
|
|
373
389
|
*
|
|
374
390
|
* @see {@link https://discord.com/developers/docs/resources/stage-instance#create-stage-instance}
|
|
375
391
|
*/
|
|
376
|
-
createStageInstance: (options: CreateStageInstance) => Promise<CamelizedDiscordStageInstance>;
|
|
392
|
+
createStageInstance: (options: CreateStageInstance, reason?: string) => Promise<CamelizedDiscordStageInstance>;
|
|
377
393
|
/**
|
|
378
394
|
* Creates a webhook.
|
|
379
395
|
*
|
|
380
396
|
* @param channelId - The ID of the channel to create the webhook in.
|
|
381
397
|
* @param options - The parameters for the creation of the webhook.
|
|
398
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
382
399
|
* @returns An instance of the created {@link CamelizedDiscordWebhook}.
|
|
383
400
|
*
|
|
384
401
|
* @remarks
|
|
385
402
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
386
403
|
*
|
|
387
|
-
* ⚠️ The webhook name must not contain the
|
|
404
|
+
* ⚠️ The webhook name must not contain the substrings 'clyde', or 'discord' (case-insensitive).
|
|
388
405
|
*
|
|
389
406
|
* Fires a _Webhooks Update_ gateway event.
|
|
390
407
|
*
|
|
@@ -396,6 +413,7 @@ export interface RestManager {
|
|
|
396
413
|
*
|
|
397
414
|
* @param guildId - The ID of the guild to delete the rule from.
|
|
398
415
|
* @param ruleId - The ID of the automod rule to delete.
|
|
416
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
399
417
|
*
|
|
400
418
|
* @remarks
|
|
401
419
|
* Requires the `MANAGE_GUILD` permission.
|
|
@@ -409,6 +427,7 @@ export interface RestManager {
|
|
|
409
427
|
* Deletes a channel from within a guild.
|
|
410
428
|
*
|
|
411
429
|
* @param channelId - The ID of the channel to delete.
|
|
430
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
412
431
|
* @returns An instance of the deleted {@link Channel}.
|
|
413
432
|
*
|
|
414
433
|
* @remarks
|
|
@@ -435,6 +454,7 @@ export interface RestManager {
|
|
|
435
454
|
*
|
|
436
455
|
* @param channelId - The ID of the channel to delete the permission override of.
|
|
437
456
|
* @param overwriteId - The ID of the permission override to delete.
|
|
457
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
438
458
|
*
|
|
439
459
|
* @remarks
|
|
440
460
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -449,6 +469,7 @@ export interface RestManager {
|
|
|
449
469
|
*
|
|
450
470
|
* @param guildId - The ID of the guild from which to delete the emoji.
|
|
451
471
|
* @param id - The ID of the emoji to delete.
|
|
472
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
452
473
|
*
|
|
453
474
|
* @remarks
|
|
454
475
|
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
@@ -506,6 +527,7 @@ export interface RestManager {
|
|
|
506
527
|
* Delete a new sticker for the guild.
|
|
507
528
|
*
|
|
508
529
|
* @param guildId The ID of the guild to get
|
|
530
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
509
531
|
* @return A {@link CamelizedDiscordSticker}
|
|
510
532
|
*
|
|
511
533
|
* @remarks
|
|
@@ -536,6 +558,7 @@ export interface RestManager {
|
|
|
536
558
|
*
|
|
537
559
|
* @param guildId - The ID of the guild from which to delete the integration.
|
|
538
560
|
* @param integrationId - The ID of the integration to delete from the guild.
|
|
561
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
539
562
|
*
|
|
540
563
|
* @remarks
|
|
541
564
|
* Requires the `MANAGE_GUILD` permission.
|
|
@@ -547,11 +570,12 @@ export interface RestManager {
|
|
|
547
570
|
*
|
|
548
571
|
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-integration}
|
|
549
572
|
*/
|
|
550
|
-
deleteIntegration: (guildId: BigString, integrationId: BigString) => Promise<void>;
|
|
573
|
+
deleteIntegration: (guildId: BigString, integrationId: BigString, reason?: string) => Promise<void>;
|
|
551
574
|
/**
|
|
552
575
|
* Deletes an invite to a channel.
|
|
553
576
|
*
|
|
554
577
|
* @param inviteCode - The invite code of the invite to delete.
|
|
578
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
555
579
|
*
|
|
556
580
|
* @remarks
|
|
557
581
|
* Requires the `MANAGE_CHANNELS` permission.
|
|
@@ -566,6 +590,7 @@ export interface RestManager {
|
|
|
566
590
|
*
|
|
567
591
|
* @param channelId - The ID of the channel to delete the message from.
|
|
568
592
|
* @param messageId - The ID of the message to delete from the channel.
|
|
593
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
569
594
|
*
|
|
570
595
|
* @remarks
|
|
571
596
|
* If not deleting own message:
|
|
@@ -581,6 +606,7 @@ export interface RestManager {
|
|
|
581
606
|
*
|
|
582
607
|
* @param channelId - The ID of the channel to delete the messages from.
|
|
583
608
|
* @param messageIds - The IDs of the messages to delete from the channel.
|
|
609
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
584
610
|
*
|
|
585
611
|
* @remarks
|
|
586
612
|
* Requires the `MANAGE_MESSAGES` permission.
|
|
@@ -658,6 +684,7 @@ export interface RestManager {
|
|
|
658
684
|
*
|
|
659
685
|
* @param guildId - The ID of the guild to delete the role from.
|
|
660
686
|
* @param roleId - The ID of the role to delete.
|
|
687
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
661
688
|
*
|
|
662
689
|
* @remarks
|
|
663
690
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -666,7 +693,7 @@ export interface RestManager {
|
|
|
666
693
|
*
|
|
667
694
|
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-role}
|
|
668
695
|
*/
|
|
669
|
-
deleteRole: (guildId: BigString, roleId: BigString) => Promise<void>;
|
|
696
|
+
deleteRole: (guildId: BigString, roleId: BigString, reason?: string) => Promise<void>;
|
|
670
697
|
/**
|
|
671
698
|
* Deletes a scheduled event from a guild.
|
|
672
699
|
*
|
|
@@ -685,6 +712,7 @@ export interface RestManager {
|
|
|
685
712
|
* Deletes the stage instance associated with a stage channel, if one exists.
|
|
686
713
|
*
|
|
687
714
|
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
715
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
688
716
|
*
|
|
689
717
|
* @remarks
|
|
690
718
|
* Requires the user to be a moderator of the stage channel.
|
|
@@ -765,13 +793,14 @@ export interface RestManager {
|
|
|
765
793
|
*
|
|
766
794
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
|
|
767
795
|
*/
|
|
768
|
-
editApplicationCommandPermissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: ApplicationCommandPermissions[]) => Promise<
|
|
796
|
+
editApplicationCommandPermissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: ApplicationCommandPermissions[]) => Promise<CamelizedDiscordGuildApplicationCommandPermissions>;
|
|
769
797
|
/**
|
|
770
798
|
* Edits an automod rule.
|
|
771
799
|
*
|
|
772
800
|
* @param guildId - The ID of the guild to edit the rule in.
|
|
773
801
|
* @param ruleId - The ID of the rule to edit.
|
|
774
802
|
* @param options - The parameters for the edit of the rule.
|
|
803
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
775
804
|
* @returns An instance of the edited {@link CamelizedDiscordAutoModerationRule}.
|
|
776
805
|
*
|
|
777
806
|
* @remarks
|
|
@@ -781,7 +810,7 @@ export interface RestManager {
|
|
|
781
810
|
*
|
|
782
811
|
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule}
|
|
783
812
|
*/
|
|
784
|
-
editAutomodRule: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions
|
|
813
|
+
editAutomodRule: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions>, reason?: string) => Promise<CamelizedDiscordAutoModerationRule>;
|
|
785
814
|
/**
|
|
786
815
|
* Modifies the bot's username or avatar.
|
|
787
816
|
* NOTE: username: if changed may cause the bot's discriminator to be randomized.
|
|
@@ -795,6 +824,7 @@ export interface RestManager {
|
|
|
795
824
|
*
|
|
796
825
|
* @param channelId - The ID of the channel to edit.
|
|
797
826
|
* @param options - The parameters for the edit of the channel.
|
|
827
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
798
828
|
* @returns An instance of the edited {@link CamelizedDiscordChannel}.
|
|
799
829
|
*
|
|
800
830
|
* @remarks
|
|
@@ -819,12 +849,13 @@ export interface RestManager {
|
|
|
819
849
|
* - Otherwise:
|
|
820
850
|
* - Fires a _Channel Update_ gateway event.
|
|
821
851
|
*/
|
|
822
|
-
editChannel: (channelId: BigString, options: ModifyChannel) => Promise<CamelizedDiscordChannel>;
|
|
852
|
+
editChannel: (channelId: BigString, options: ModifyChannel, reason?: string) => Promise<CamelizedDiscordChannel>;
|
|
823
853
|
/**
|
|
824
854
|
* Edits the permission overrides for a user or role in a channel.
|
|
825
855
|
*
|
|
826
856
|
* @param channelId - The ID of the channel to edit the permission overrides of.
|
|
827
857
|
* @param options - The permission override.
|
|
858
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
828
859
|
*
|
|
829
860
|
* @remarks
|
|
830
861
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -835,7 +866,7 @@ export interface RestManager {
|
|
|
835
866
|
*
|
|
836
867
|
* @see {@link https://discord.com/developers/docs/resources/channel#edit-channel-permissions}
|
|
837
868
|
*/
|
|
838
|
-
editChannelPermissionOverrides: (channelId: BigString, options: EditChannelPermissionOverridesOptions) => Promise<void>;
|
|
869
|
+
editChannelPermissionOverrides: (channelId: BigString, options: EditChannelPermissionOverridesOptions, reason?: string) => Promise<void>;
|
|
839
870
|
/**
|
|
840
871
|
* Edits the positions of a set of channels in a guild.
|
|
841
872
|
*
|
|
@@ -856,6 +887,7 @@ export interface RestManager {
|
|
|
856
887
|
* @param guildId - The ID of the guild in which to edit the emoji.
|
|
857
888
|
* @param id - The ID of the emoji to edit.
|
|
858
889
|
* @param options - The parameters for the edit of the emoji.
|
|
890
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
859
891
|
* @returns An instance of the updated {@link CamelizedDiscordEmoji}.
|
|
860
892
|
*
|
|
861
893
|
* @remarks
|
|
@@ -865,7 +897,7 @@ export interface RestManager {
|
|
|
865
897
|
*
|
|
866
898
|
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-guild-emoji}
|
|
867
899
|
*/
|
|
868
|
-
editEmoji: (guildId: BigString, id: BigString, options: ModifyGuildEmoji) => Promise<CamelizedDiscordEmoji>;
|
|
900
|
+
editEmoji: (guildId: BigString, id: BigString, options: ModifyGuildEmoji, reason?: string) => Promise<CamelizedDiscordEmoji>;
|
|
869
901
|
/**
|
|
870
902
|
* Edits a follow-up message to an interaction.
|
|
871
903
|
*
|
|
@@ -900,6 +932,7 @@ export interface RestManager {
|
|
|
900
932
|
* @param guildId - The ID of the guild to edit.
|
|
901
933
|
* @param shardId - The ID of the shard the guild is in.
|
|
902
934
|
* @param options - The parameters for the edit of the guild.
|
|
935
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
903
936
|
* @returns An instance of the edited {@link Guild}.
|
|
904
937
|
*
|
|
905
938
|
* @remarks
|
|
@@ -912,7 +945,7 @@ export interface RestManager {
|
|
|
912
945
|
*
|
|
913
946
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
|
|
914
947
|
*/
|
|
915
|
-
editGuild: (guildId: BigString, options: ModifyGuild) => Promise<CamelizedDiscordGuild>;
|
|
948
|
+
editGuild: (guildId: BigString, options: ModifyGuild, reason?: string) => Promise<CamelizedDiscordGuild>;
|
|
916
949
|
/**
|
|
917
950
|
* Edits an application command registered in a guild.
|
|
918
951
|
*
|
|
@@ -924,12 +957,15 @@ export interface RestManager {
|
|
|
924
957
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
|
|
925
958
|
*/
|
|
926
959
|
editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<CamelizedDiscordApplicationCommand>;
|
|
927
|
-
/** Modify a guild's MFA level. Requires guild ownership.
|
|
960
|
+
/** Modify a guild's MFA level. Requires guild ownership.
|
|
961
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
962
|
+
*/
|
|
928
963
|
editGuildMfaLevel: (guildId: BigString, mfaLevel: MfaLevels, reason?: string) => Promise<void>;
|
|
929
964
|
/**
|
|
930
965
|
* Edit the given sticker.
|
|
931
966
|
*
|
|
932
967
|
* @param guildId The ID of the guild to get
|
|
968
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
933
969
|
* @return A {@link CamelizedDiscordSticker}
|
|
934
970
|
*
|
|
935
971
|
* @remarks
|
|
@@ -938,7 +974,7 @@ export interface RestManager {
|
|
|
938
974
|
*
|
|
939
975
|
* @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
|
|
940
976
|
*/
|
|
941
|
-
editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions
|
|
977
|
+
editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>, reason?: string) => Promise<CamelizedDiscordSticker>;
|
|
942
978
|
/**
|
|
943
979
|
* Edits a template's settings.
|
|
944
980
|
*
|
|
@@ -989,7 +1025,7 @@ export interface RestManager {
|
|
|
989
1025
|
*
|
|
990
1026
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response}
|
|
991
1027
|
*/
|
|
992
|
-
editOriginalInteractionResponse: (token: string, options: InteractionCallbackData) => Promise<CamelizedDiscordMessage
|
|
1028
|
+
editOriginalInteractionResponse: (token: string, options: InteractionCallbackData) => Promise<CamelizedDiscordMessage>;
|
|
993
1029
|
/**
|
|
994
1030
|
* Edits the original webhook message.
|
|
995
1031
|
*
|
|
@@ -1030,6 +1066,7 @@ export interface RestManager {
|
|
|
1030
1066
|
* @param guildId - The ID of the guild to edit the role in.
|
|
1031
1067
|
* @param roleId - The ID of the role to edit.
|
|
1032
1068
|
* @param options - The parameters for the edit of the role.
|
|
1069
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1033
1070
|
* @returns An instance of the edited {@link CamelizedDiscordRole}.
|
|
1034
1071
|
*
|
|
1035
1072
|
* @remarks
|
|
@@ -1039,12 +1076,13 @@ export interface RestManager {
|
|
|
1039
1076
|
*
|
|
1040
1077
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role}
|
|
1041
1078
|
*/
|
|
1042
|
-
editRole: (guildId: BigString, roleId: BigString, options: EditGuildRole) => Promise<CamelizedDiscordRole>;
|
|
1079
|
+
editRole: (guildId: BigString, roleId: BigString, options: EditGuildRole, reason?: string) => Promise<CamelizedDiscordRole>;
|
|
1043
1080
|
/**
|
|
1044
1081
|
* Edits the positions of a set of roles.
|
|
1045
1082
|
*
|
|
1046
1083
|
* @param guildId - The ID of the guild to edit the role positions in.
|
|
1047
1084
|
* @param options - The parameters for the edit of the role positions.
|
|
1085
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1048
1086
|
* @returns A collection of {@link CamelizedDiscordRole} objects assorted by role ID.
|
|
1049
1087
|
*
|
|
1050
1088
|
* @remarks
|
|
@@ -1054,12 +1092,13 @@ export interface RestManager {
|
|
|
1054
1092
|
*
|
|
1055
1093
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role-positions}
|
|
1056
1094
|
*/
|
|
1057
|
-
editRolePositions: (guildId: BigString, options: ModifyRolePositions[]) => Promise<CamelizedDiscordRole[]>;
|
|
1095
|
+
editRolePositions: (guildId: BigString, options: ModifyRolePositions[], reason?: string) => Promise<CamelizedDiscordRole[]>;
|
|
1058
1096
|
/**
|
|
1059
1097
|
* Edits a scheduled event.
|
|
1060
1098
|
*
|
|
1061
1099
|
* @param guildId - The ID of the guild to edit the scheduled event in.
|
|
1062
1100
|
* @param eventId - The ID of the scheduled event to edit.
|
|
1101
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1063
1102
|
* @returns An instance of the edited {@link ScheduledEvent}.
|
|
1064
1103
|
*
|
|
1065
1104
|
* @remarks
|
|
@@ -1073,12 +1112,13 @@ export interface RestManager {
|
|
|
1073
1112
|
*
|
|
1074
1113
|
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
|
1075
1114
|
*/
|
|
1076
|
-
editScheduledEvent: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent
|
|
1115
|
+
editScheduledEvent: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent>, reason?: string) => Promise<CamelizedDiscordScheduledEvent>;
|
|
1077
1116
|
/**
|
|
1078
1117
|
* Edits a stage instance.
|
|
1079
1118
|
*
|
|
1080
1119
|
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
1081
1120
|
* @param topic - Topic of the Stage instance (1-120 characters).
|
|
1121
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1082
1122
|
* @returns An instance of the updated {@link CamelizedDiscordStageInstance}.
|
|
1083
1123
|
*
|
|
1084
1124
|
* @remarks
|
|
@@ -1107,6 +1147,7 @@ export interface RestManager {
|
|
|
1107
1147
|
* Edits a webhook.
|
|
1108
1148
|
*
|
|
1109
1149
|
* @param webhookId - The ID of the webhook to edit.
|
|
1150
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1110
1151
|
* @returns An instance of the edited {@link CamelizedDiscordWebhook}.
|
|
1111
1152
|
*
|
|
1112
1153
|
* @remarks
|
|
@@ -1116,7 +1157,7 @@ export interface RestManager {
|
|
|
1116
1157
|
*
|
|
1117
1158
|
* @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook}
|
|
1118
1159
|
*/
|
|
1119
|
-
editWebhook: (webhookId: BigString, options: ModifyWebhook) => Promise<CamelizedDiscordWebhook>;
|
|
1160
|
+
editWebhook: (webhookId: BigString, options: ModifyWebhook, reason?: string) => Promise<CamelizedDiscordWebhook>;
|
|
1120
1161
|
/**
|
|
1121
1162
|
* Edits a webhook message.
|
|
1122
1163
|
*
|
|
@@ -1154,6 +1195,7 @@ export interface RestManager {
|
|
|
1154
1195
|
*
|
|
1155
1196
|
* @param guildId - The ID of the guild to edit the welcome screen of.
|
|
1156
1197
|
* @param options - The parameters for the edit of the welcome screen.
|
|
1198
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1157
1199
|
* @returns An instance of the edited {@link WelcomeScreen}.
|
|
1158
1200
|
*
|
|
1159
1201
|
* @remarks
|
|
@@ -1163,11 +1205,12 @@ export interface RestManager {
|
|
|
1163
1205
|
*
|
|
1164
1206
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen}
|
|
1165
1207
|
*/
|
|
1166
|
-
editWelcomeScreen: (guildId: BigString, options: CamelizedDiscordModifyGuildWelcomeScreen) => Promise<CamelizedDiscordWelcomeScreen>;
|
|
1208
|
+
editWelcomeScreen: (guildId: BigString, options: CamelizedDiscordModifyGuildWelcomeScreen, reason?: string) => Promise<CamelizedDiscordWelcomeScreen>;
|
|
1167
1209
|
/**
|
|
1168
1210
|
* Edits the settings of a guild's widget.
|
|
1169
1211
|
*
|
|
1170
1212
|
* @param guildId - The ID of the guild to edit the settings of the widget of.
|
|
1213
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1171
1214
|
* @returns An instance of the edited {@link GuildWidgetSettings}.
|
|
1172
1215
|
*
|
|
1173
1216
|
* @remarks
|
|
@@ -1177,7 +1220,7 @@ export interface RestManager {
|
|
|
1177
1220
|
*
|
|
1178
1221
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-widget}
|
|
1179
1222
|
*/
|
|
1180
|
-
editWidgetSettings: (guildId: BigString, options: CamelizedDiscordGuildWidgetSettings) => Promise<CamelizedDiscordGuildWidgetSettings>;
|
|
1223
|
+
editWidgetSettings: (guildId: BigString, options: CamelizedDiscordGuildWidgetSettings, reason?: string) => Promise<CamelizedDiscordGuildWidgetSettings>;
|
|
1181
1224
|
/**
|
|
1182
1225
|
* Executes a webhook, causing a message to be posted in the channel configured for the webhook.
|
|
1183
1226
|
*
|
|
@@ -1232,7 +1275,7 @@ export interface RestManager {
|
|
|
1232
1275
|
*
|
|
1233
1276
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
|
|
1234
1277
|
*/
|
|
1235
|
-
getApplicationCommandPermission: (guildId: BigString, commandId: BigString) => Promise<
|
|
1278
|
+
getApplicationCommandPermission: (guildId: BigString, commandId: BigString) => Promise<CamelizedDiscordGuildApplicationCommandPermissions>;
|
|
1236
1279
|
/**
|
|
1237
1280
|
* Gets the permissions of all application commands registered in a guild by the ID of the guild.
|
|
1238
1281
|
*
|
|
@@ -1241,7 +1284,7 @@ export interface RestManager {
|
|
|
1241
1284
|
*
|
|
1242
1285
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
|
|
1243
1286
|
*/
|
|
1244
|
-
getApplicationCommandPermissions: (guildId: BigString) => Promise<
|
|
1287
|
+
getApplicationCommandPermissions: (guildId: BigString) => Promise<CamelizedDiscordGuildApplicationCommandPermissions[]>;
|
|
1245
1288
|
/**
|
|
1246
1289
|
* Gets a guild's audit log.
|
|
1247
1290
|
*
|
|
@@ -1968,6 +2011,7 @@ export interface RestManager {
|
|
|
1968
2011
|
* @param guildId - The ID of the guild the member to remove the role from is in.
|
|
1969
2012
|
* @param userId - The user ID of the member to remove the role from.
|
|
1970
2013
|
* @param roleId - The ID of the role to remove from the member.
|
|
2014
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1971
2015
|
*
|
|
1972
2016
|
* @remarks
|
|
1973
2017
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -2070,6 +2114,7 @@ export interface RestManager {
|
|
|
2070
2114
|
* @param channelId - The ID of the channel in which to create the thread.
|
|
2071
2115
|
* @param messageId - The ID of the message to use as the thread's point of origin.
|
|
2072
2116
|
* @param options - The parameters to use for the creation of the thread.
|
|
2117
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2073
2118
|
* @returns An instance of the created {@link Channel | Thread}.
|
|
2074
2119
|
*
|
|
2075
2120
|
* @remarks
|
|
@@ -2083,12 +2128,13 @@ export interface RestManager {
|
|
|
2083
2128
|
*
|
|
2084
2129
|
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message}
|
|
2085
2130
|
*/
|
|
2086
|
-
startThreadWithMessage: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage) => Promise<CamelizedDiscordChannel>;
|
|
2131
|
+
startThreadWithMessage: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage, reason?: string) => Promise<CamelizedDiscordChannel>;
|
|
2087
2132
|
/**
|
|
2088
2133
|
* Creates a thread without using a message as the thread's point of origin.
|
|
2089
2134
|
*
|
|
2090
2135
|
* @param channelId - The ID of the channel in which to create the thread.
|
|
2091
2136
|
* @param options - The parameters to use for the creation of the thread.
|
|
2137
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2092
2138
|
* @returns An instance of the created {@link CamelizedDiscordChannel | Thread}.
|
|
2093
2139
|
*
|
|
2094
2140
|
* @remarks
|
|
@@ -2098,7 +2144,7 @@ export interface RestManager {
|
|
|
2098
2144
|
*
|
|
2099
2145
|
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
|
|
2100
2146
|
*/
|
|
2101
|
-
startThreadWithoutMessage: (channelId: BigString, options: StartThreadWithoutMessage) => Promise<CamelizedDiscordChannel>;
|
|
2147
|
+
startThreadWithoutMessage: (channelId: BigString, options: StartThreadWithoutMessage, reason?: string) => Promise<CamelizedDiscordChannel>;
|
|
2102
2148
|
/**
|
|
2103
2149
|
* Synchronises a template with the current state of a guild.
|
|
2104
2150
|
*
|
|
@@ -2158,9 +2204,9 @@ export interface RestManager {
|
|
|
2158
2204
|
/**
|
|
2159
2205
|
* Bans a user from a guild.
|
|
2160
2206
|
*
|
|
2161
|
-
|
|
2162
2207
|
* @param guildId - The ID of the guild to ban the user from.
|
|
2163
2208
|
* @param userId - The ID of the user to ban from the guild.
|
|
2209
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2164
2210
|
* @param options - The parameters for the creation of the ban.
|
|
2165
2211
|
*
|
|
2166
2212
|
* @remarks
|
|
@@ -2170,12 +2216,13 @@ export interface RestManager {
|
|
|
2170
2216
|
*
|
|
2171
2217
|
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban}
|
|
2172
2218
|
*/
|
|
2173
|
-
banMember: (guildId: BigString, userId: BigString, options?: CreateGuildBan) => Promise<void>;
|
|
2219
|
+
banMember: (guildId: BigString, userId: BigString, options?: CreateGuildBan, reason?: string) => Promise<void>;
|
|
2174
2220
|
/**
|
|
2175
2221
|
* Edits the nickname of the bot user.
|
|
2176
2222
|
*
|
|
2177
2223
|
* @param guildId - The ID of the guild to edit the nickname of the bot user in.
|
|
2178
2224
|
* @param options - The parameters for the edit of the nickname.
|
|
2225
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2179
2226
|
* @returns An instance of the edited {@link CamelizedDiscordMember}
|
|
2180
2227
|
*
|
|
2181
2228
|
* @remarks
|
|
@@ -2183,12 +2230,13 @@ export interface RestManager {
|
|
|
2183
2230
|
*
|
|
2184
2231
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-current-member}
|
|
2185
2232
|
*/
|
|
2186
|
-
editBotMember: (guildId: BigString, options: EditBotMemberOptions) => Promise<CamelizedDiscordMember>;
|
|
2233
|
+
editBotMember: (guildId: BigString, options: EditBotMemberOptions, reason?: string) => Promise<CamelizedDiscordMember>;
|
|
2187
2234
|
/**
|
|
2188
2235
|
* Edits a member's properties.
|
|
2189
2236
|
*
|
|
2190
2237
|
* @param guildId - The ID of the guild to edit the member of.
|
|
2191
2238
|
* @param userId - The user ID of the member to edit.
|
|
2239
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2192
2240
|
* @param options - The parameters for the edit of the user.
|
|
2193
2241
|
*
|
|
2194
2242
|
* @remarks
|
|
@@ -2199,7 +2247,7 @@ export interface RestManager {
|
|
|
2199
2247
|
*
|
|
2200
2248
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-member}
|
|
2201
2249
|
*/
|
|
2202
|
-
editMember: (guildId: BigString, userId: BigString, options: ModifyGuildMember) => Promise<CamelizedDiscordMember>;
|
|
2250
|
+
editMember: (guildId: BigString, userId: BigString, options: ModifyGuildMember, reason?: string) => Promise<CamelizedDiscordMember>;
|
|
2203
2251
|
/**
|
|
2204
2252
|
* Gets the member object by user ID.
|
|
2205
2253
|
*
|
|
@@ -2236,6 +2284,7 @@ export interface RestManager {
|
|
|
2236
2284
|
|
|
2237
2285
|
* @param guildId - The ID of the guild to kick the member from.
|
|
2238
2286
|
* @param userId - The user ID of the member to kick from the guild.
|
|
2287
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2239
2288
|
*
|
|
2240
2289
|
* @remarks
|
|
2241
2290
|
* Requires the `KICK_MEMBERS` permission.
|
|
@@ -2250,6 +2299,7 @@ export interface RestManager {
|
|
|
2250
2299
|
*
|
|
2251
2300
|
* @param channelId - The ID of the channel where the message is to be pinned.
|
|
2252
2301
|
* @param messageId - The ID of the message to pin.
|
|
2302
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2253
2303
|
*
|
|
2254
2304
|
* @remarks
|
|
2255
2305
|
* Requires that the bot user be able to see the contents of the channel in which the messages were posted.
|
|
@@ -2269,6 +2319,7 @@ export interface RestManager {
|
|
|
2269
2319
|
|
|
2270
2320
|
* @param guildId - The ID of the guild to prune the members of.
|
|
2271
2321
|
* @param options - The parameters for the pruning of members.
|
|
2322
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2272
2323
|
* @returns A number indicating how many members were pruned.
|
|
2273
2324
|
*
|
|
2274
2325
|
* @remarks
|
|
@@ -2282,7 +2333,7 @@ export interface RestManager {
|
|
|
2282
2333
|
*
|
|
2283
2334
|
* @see {@link https://discord.com/developers/docs/resources/guild#begin-guild-prune}
|
|
2284
2335
|
*/
|
|
2285
|
-
pruneMembers: (guildId: BigString, options: BeginGuildPrune) => Promise<{
|
|
2336
|
+
pruneMembers: (guildId: BigString, options: BeginGuildPrune, reason?: string) => Promise<{
|
|
2286
2337
|
pruned: number | null;
|
|
2287
2338
|
}>;
|
|
2288
2339
|
/**
|
|
@@ -2303,6 +2354,7 @@ export interface RestManager {
|
|
|
2303
2354
|
|
|
2304
2355
|
* @param guildId - The ID of the guild to unban the user in.
|
|
2305
2356
|
* @param userId - The ID of the user to unban.
|
|
2357
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2306
2358
|
*
|
|
2307
2359
|
* @remarks
|
|
2308
2360
|
* Requires the `BAN_MEMBERS` permission.
|
|
@@ -2311,12 +2363,13 @@ export interface RestManager {
|
|
|
2311
2363
|
*
|
|
2312
2364
|
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
|
|
2313
2365
|
*/
|
|
2314
|
-
unbanMember: (guildId: BigString, userId: BigString) => Promise<void>;
|
|
2366
|
+
unbanMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
|
|
2315
2367
|
/**
|
|
2316
2368
|
* Unpins a pinned message in a channel.
|
|
2317
2369
|
*
|
|
2318
2370
|
* @param channelId - The ID of the channel where the message is pinned.
|
|
2319
2371
|
* @param messageId - The ID of the message to unpin.
|
|
2372
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2320
2373
|
*
|
|
2321
2374
|
* @remarks
|
|
2322
2375
|
* Requires that the bot user be able to see the contents of the channel in which the messages were posted.
|
|
@@ -2339,22 +2392,21 @@ export interface CreateWebhook {
|
|
|
2339
2392
|
}
|
|
2340
2393
|
export interface CreateRequestBodyOptions {
|
|
2341
2394
|
headers?: Record<string, string>;
|
|
2342
|
-
method: RequestMethods;
|
|
2343
2395
|
body?: any;
|
|
2344
2396
|
unauthorized?: boolean;
|
|
2345
|
-
url?: string;
|
|
2346
2397
|
reason?: string;
|
|
2347
|
-
|
|
2398
|
+
files?: FileContent[];
|
|
2348
2399
|
}
|
|
2400
|
+
export type MakeRequestOptions = Omit<CreateRequestBodyOptions, 'method'> & Pick<SendRequestOptions, 'runThroughQueue'>;
|
|
2349
2401
|
export interface RequestBody {
|
|
2350
2402
|
headers: Record<string, string>;
|
|
2351
2403
|
body?: string | FormData;
|
|
2352
2404
|
method: RequestMethods;
|
|
2353
2405
|
}
|
|
2354
2406
|
export interface SendRequestOptions {
|
|
2355
|
-
/** The
|
|
2356
|
-
|
|
2357
|
-
/** The method to use
|
|
2407
|
+
/** The route to send the request to. */
|
|
2408
|
+
route: string;
|
|
2409
|
+
/** The method to use for sending the request. */
|
|
2358
2410
|
method: RequestMethods;
|
|
2359
2411
|
/** The amount of times this request has been retried. */
|
|
2360
2412
|
retryCount: number;
|
|
@@ -2367,7 +2419,12 @@ export interface SendRequestOptions {
|
|
|
2367
2419
|
/** If this request has a bucket id which it falls under for rate limit */
|
|
2368
2420
|
bucketId?: string;
|
|
2369
2421
|
/** Additional request options, used for things like overriding authorization header. */
|
|
2370
|
-
|
|
2422
|
+
requestBodyOptions?: CreateRequestBodyOptions;
|
|
2423
|
+
/**
|
|
2424
|
+
* Whether the request should be run through the queue.
|
|
2425
|
+
* Useful for routes which do not have any rate limits.
|
|
2426
|
+
*/
|
|
2427
|
+
runThroughQueue?: boolean;
|
|
2371
2428
|
}
|
|
2372
2429
|
export interface RestRateLimitedPath {
|
|
2373
2430
|
url: string;
|