@discordeno/rest 22.0.0-beta.1 → 22.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/invalidBucket.d.ts.map +1 -1
- package/dist/invalidBucket.js +1 -1
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +309 -88
- package/dist/queue.d.ts +2 -2
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +45 -9
- package/dist/routes.d.ts +7 -1
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +241 -188
- package/dist/types.d.ts +461 -192
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/typings/routes.d.ts +19 -1
- package/dist/typings/routes.d.ts.map +1 -1
- package/dist/typings/routes.js +1 -1
- package/package.json +24 -27
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddDmRecipientOptions, AddGuildMemberOptions, AddLobbyMember, AtLeastOne, BeginGuildPrune, BigString, Camelize, CreateApplicationCommand, CreateApplicationEmoji, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGlobalApplicationCommandOptions, CreateGroupDmOptions, CreateGuildApplicationCommandOptions, CreateGuildBan, CreateGuildBulkBan, CreateGuildChannel, CreateGuildEmoji, CreateGuildRole, CreateGuildSoundboardSound, CreateGuildStickerOptions, CreateLobby, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, CreateTemplate, CreateTestEntitlement, CreateWebhook, DeleteWebhookMessageOptions, DiscordAccessTokenResponse, DiscordActivityInstance, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordApplicationRoleConnection, DiscordApplicationRoleConnectionMetadata, DiscordAuditLog, DiscordAutoModerationRule, DiscordBan, DiscordBulkBan, DiscordChannel, DiscordConnection, DiscordCurrentAuthorization, DiscordEmoji, DiscordEntitlement, DiscordFollowedChannel, DiscordGetAnswerVotesResponse, DiscordGetChannelPins, DiscordGetGatewayBot, DiscordGuild, DiscordGuildApplicationCommandPermissions, DiscordGuildOnboarding, DiscordGuildPreview, DiscordGuildWidget, DiscordGuildWidgetSettings, DiscordIncidentsData, DiscordIntegration, DiscordInteractionCallbackResponse, DiscordInvite, DiscordInviteMetadata, DiscordListActiveThreads, DiscordListArchivedThreads, DiscordLobby, DiscordLobbyMember, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordPrunedCount, DiscordRole, DiscordScheduledEvent, DiscordSku, DiscordSoundboardSound, DiscordStageInstance, DiscordSticker, DiscordStickerPack, DiscordSubscription, DiscordTemplate, DiscordThreadMember, DiscordTokenExchange, DiscordTokenRevocation, DiscordUser, DiscordVanityUrl, DiscordVoiceRegion, DiscordVoiceState, DiscordWebhook, DiscordWelcomeScreen, EditApplication, EditAutoModerationRuleOptions,
|
|
1
|
+
import type { AddDmRecipientOptions, AddGuildMemberOptions, AddLobbyMember, AtLeastOne, BeginGuildPrune, BigString, BulkUpdateLobbyMember, Camelize, CreateApplicationCommand, CreateApplicationEmoji, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGlobalApplicationCommandOptions, CreateGroupDmOptions, CreateGuildApplicationCommandOptions, CreateGuildBan, CreateGuildBulkBan, CreateGuildChannel, CreateGuildEmoji, CreateGuildRole, CreateGuildSoundboardSound, CreateGuildStickerOptions, CreateLobby, CreateMessageOptions, CreateOrJoinLobby, CreateScheduledEvent, CreateStageInstance, CreateTemplate, CreateTestEntitlement, CreateWebhook, DeleteWebhookMessageOptions, DiscordAccessTokenResponse, DiscordActivityInstance, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordApplicationRoleConnection, DiscordApplicationRoleConnectionMetadata, DiscordAuditLog, DiscordAutoModerationRule, DiscordBan, DiscordBulkBan, DiscordChannel, DiscordConnection, DiscordCurrentAuthorization, DiscordEmoji, DiscordEntitlement, DiscordFollowedChannel, DiscordGetAnswerVotesResponse, DiscordGetChannelPins, DiscordGetGatewayBot, DiscordGuild, DiscordGuildApplicationCommandPermissions, DiscordGuildOnboarding, DiscordGuildPreview, DiscordGuildWidget, DiscordGuildWidgetSettings, DiscordIncidentsData, DiscordIntegration, DiscordInteractionCallbackResponse, DiscordInvite, DiscordInviteMetadata, DiscordListActiveThreads, DiscordListArchivedThreads, DiscordLobby, DiscordLobbyInvite, DiscordLobbyMember, DiscordLobbyMessage, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordPrunedCount, DiscordRole, DiscordScheduledEvent, DiscordSearchGuildMessages, DiscordSearchGuildMessagesIndexing, DiscordSku, DiscordSoundboardSound, DiscordStageInstance, DiscordSticker, DiscordStickerPack, DiscordSubscription, DiscordTargetUsersJobStatus, DiscordTemplate, DiscordThreadMember, DiscordTokenExchange, DiscordTokenRevocation, DiscordUser, DiscordVanityUrl, DiscordVoiceRegion, DiscordVoiceState, DiscordWebhook, DiscordWelcomeScreen, EditApplication, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildOnboarding, EditGuildRole, EditGuildStickerOptions, EditMessage, EditOwnVoiceState, EditScheduledEvent, EditUserVoiceState, EditWebhookMessageOptions, ExecuteWebhook, FileContent, GetApplicationCommandPermissionOptions, GetBans, GetChannelPinsOptions, GetEntitlements, GetGlobalApplicationCommandsOptions, GetGuildApplicationCommandsOptions, GetGuildAuditLog, GetGuildPruneCountQuery, GetInvite, GetLobbyMessages, GetMessagesOptions, GetPollAnswerVotes, GetReactions, GetScheduledEvents, GetScheduledEventUsers, GetThreadMember, GetUserGuilds, GetWebhookMessageOptions, InteractionCallbackData, InteractionCallbackOptions, InteractionResponse, LinkChannelToLobby, ListArchivedThreads, ListGuildMembers, ListSkuSubscriptionsOptions, ListThreadMembers, ModifyApplicationEmoji, ModifyChannel, ModifyCurrentMember, ModifyGuild, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyGuildIncidentActions, ModifyGuildMember, ModifyGuildSoundboardSound, ModifyGuildTemplate, ModifyGuildWelcomeScreen, ModifyLobby, ModifyRolePositions, ModifyWebhook, SearchGuildMessagesOptions, SearchMembers, SendLobbyMessage, SendSoundboardSound, StartThreadWithMessage, StartThreadWithoutMessage, UpsertGlobalApplicationCommandOptions, UpsertGuildApplicationCommandOptions } from '@discordeno/types';
|
|
2
2
|
import type { logger } from '@discordeno/utils';
|
|
3
3
|
import type { InvalidRequestBucket } from './invalidBucket.js';
|
|
4
4
|
import type { Queue } from './queue.js';
|
|
@@ -15,7 +15,6 @@ export interface CreateRestManagerOptions {
|
|
|
15
15
|
proxy?: {
|
|
16
16
|
/**
|
|
17
17
|
* The base url to connect to. If you create a proxy rest, that url would go here.
|
|
18
|
-
* IT SHOULD NOT END WITH A /
|
|
19
18
|
* @default https://discord.com/api
|
|
20
19
|
*/
|
|
21
20
|
baseUrl: string;
|
|
@@ -40,6 +39,25 @@ export interface CreateRestManagerOptions {
|
|
|
40
39
|
* This value is actually required if you want to use `updateTokenQueues`
|
|
41
40
|
*/
|
|
42
41
|
updateBearerTokenEndpoint?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Whether an attempt that failed without producing a response should be re-sent to the proxy.
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* This covers both an attempt that hit {@link CreateRestManagerOptions.requestTimeout | requestTimeout} and one whose
|
|
47
|
+
* connection failed. Neither tells us whether the proxy got the request: the timeout only aborts our side of the
|
|
48
|
+
* connection while the proxy keeps processing (it may simply be queued behind a rate limit), and a socket that dies
|
|
49
|
+
* once the request is on the wire may still have delivered it. `fetch` gives no way to tell those apart from never
|
|
50
|
+
* having connected at all, so re-sending can execute non-idempotent requests twice (e.g. duplicate channel creates).
|
|
51
|
+
*
|
|
52
|
+
* Only enable this when re-sending a request to your proxy is safe, for example by attaching an idempotency
|
|
53
|
+
* key to each request that the proxy tracks in a store of your choosing (in memory, redis, ...) so a
|
|
54
|
+
* re-sent request is recognized and executed only once. Discordeno does not provide such a mechanism.
|
|
55
|
+
*
|
|
56
|
+
* Bounded by {@link RestManager.maxRetryCount} and {@link RestManager.maxProxyRetryCount}.
|
|
57
|
+
*
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
retryRequests?: boolean;
|
|
43
61
|
};
|
|
44
62
|
/**
|
|
45
63
|
* The api versions which can be used to make requests.
|
|
@@ -53,6 +71,28 @@ export interface CreateRestManagerOptions {
|
|
|
53
71
|
logger?: Pick<typeof logger, 'debug' | 'info' | 'warn' | 'error' | 'fatal'>;
|
|
54
72
|
/** Events for the rest manager */
|
|
55
73
|
events?: Partial<RestManagerEvents>;
|
|
74
|
+
/**
|
|
75
|
+
* The maximum time in milliseconds a single request attempt may take before it is aborted.
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* This is a total deadline for each attempt (it also covers reading the response body), not a per-chunk timeout.
|
|
79
|
+
* When talking to Discord directly, a timed-out attempt is retried through the queue up to
|
|
80
|
+
* {@link RestManager.maxRetryCount} times before failing. Without it, a connection that stalls after connecting
|
|
81
|
+
* could keep a queue from ever progressing.
|
|
82
|
+
*
|
|
83
|
+
* When a `proxy` is configured, a timed-out attempt is NOT retried: the proxy keeps processing the request after
|
|
84
|
+
* the timeout aborts our side of the connection (it may simply be queued behind a rate limit), so re-sending it
|
|
85
|
+
* could execute it twice. If re-sending against your proxy is safe, `proxy.retryRequests` opts back into it.
|
|
86
|
+
*
|
|
87
|
+
* Because it is a total deadline rather than a per-chunk one, a slow but healthy request (e.g. uploading a
|
|
88
|
+
* large attachment over a slow connection) can legitimately exceed it and be aborted/retried. Raise this value
|
|
89
|
+
* for upload-heavy bots if you see such requests timing out.
|
|
90
|
+
*
|
|
91
|
+
* Set to `0` to disable it and rely on the runtime's default fetch timeouts.
|
|
92
|
+
*
|
|
93
|
+
* @default 30000 // 30 seconds
|
|
94
|
+
*/
|
|
95
|
+
requestTimeout?: number;
|
|
56
96
|
}
|
|
57
97
|
export interface RestManager {
|
|
58
98
|
/** The bot token which will be used to make requests. */
|
|
@@ -79,8 +119,37 @@ export interface RestManager {
|
|
|
79
119
|
authorizationHeader: string;
|
|
80
120
|
/** The endpoint to use for `updateTokenQueues` when working with a rest proxy */
|
|
81
121
|
updateBearerTokenEndpoint?: string;
|
|
122
|
+
/** Whether a proxied attempt that failed without producing a response is re-sent to the proxy. Only safe when re-sending against the proxy is. Defaults to false. */
|
|
123
|
+
retryProxiedRequests: boolean;
|
|
82
124
|
/** The maximum amount of times a request should be retried. Defaults to Infinity */
|
|
83
125
|
maxRetryCount: number;
|
|
126
|
+
/**
|
|
127
|
+
* The maximum amount of times a proxied request should be re-sent. Defaults to 15.
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* This has its own limit because {@link RestManager.maxRetryCount} is Infinity by default, which would keep every request alive for as
|
|
131
|
+
* long as the proxy stays down.
|
|
132
|
+
*
|
|
133
|
+
* Each further attempt waits {@link RestManager.proxyRetryDelayStep} longer than the one before it, so the defaults span about 30 seconds
|
|
134
|
+
* in total, enough to sit out a proxy being restarted or redeployed.
|
|
135
|
+
*
|
|
136
|
+
* Whichever of the two is lower applies. Only used when {@link RestManager.retryProxiedRequests} is enabled.
|
|
137
|
+
*/
|
|
138
|
+
maxProxyRetryCount: number;
|
|
139
|
+
/**
|
|
140
|
+
* How much longer to wait before each further re-send to a proxy, in milliseconds. Defaults to 250.
|
|
141
|
+
*
|
|
142
|
+
* @remarks
|
|
143
|
+
* The nth attempt waits n times this (250ms, then 500ms, then 750ms, ...), so a proxy that is down isn't hammered in a tight loop while
|
|
144
|
+
* still being checked often enough to notice it coming back.
|
|
145
|
+
*
|
|
146
|
+
* An attempt that timed out already sat out {@link RestManager.requestTimeout}, so it is re-sent right away without this delay.
|
|
147
|
+
*
|
|
148
|
+
* Only used when {@link RestManager.retryProxiedRequests} is enabled.
|
|
149
|
+
*/
|
|
150
|
+
proxyRetryDelayStep: number;
|
|
151
|
+
/** The maximum time in milliseconds a single request attempt may take before it is aborted. Timed-out attempts are only retried when talking to Discord directly, or through a proxy when `retryProxiedRequests` is enabled. Defaults to 30000 (30 seconds). Set to 0 to disable. */
|
|
152
|
+
requestTimeout: number;
|
|
84
153
|
/** Whether or not the manager is rate limited globally across all requests. Defaults to false. */
|
|
85
154
|
globallyRateLimited: boolean;
|
|
86
155
|
/** Whether or not the rate limited paths are being processed to allow requests to be made once time is up. Defaults to false. */
|
|
@@ -110,6 +179,8 @@ export interface RestManager {
|
|
|
110
179
|
changeToDiscordFormat: (obj: any) => any;
|
|
111
180
|
/** Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord. */
|
|
112
181
|
createRequestBody: (method: RequestMethods, options?: CreateRequestBodyOptions) => RequestBody;
|
|
182
|
+
/** Fills in the message and the cause of the error that is given to the user when a request fails. The error itself is created by the caller because of how stack traces get calculated. */
|
|
183
|
+
createRequestError: (error: Error, reason: RestRequestRejection) => Error;
|
|
113
184
|
/** 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. */
|
|
114
185
|
processRateLimitedPaths: () => void;
|
|
115
186
|
/** Processes the rate limit headers and determines if it needs to be rate limited and returns the bucket id if available */
|
|
@@ -148,7 +219,7 @@ export interface RestManager {
|
|
|
148
219
|
*
|
|
149
220
|
* Fires a _Message Reaction Add_ gateway event.
|
|
150
221
|
*
|
|
151
|
-
* @see {@link https://discord.com/developers/
|
|
222
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#create-reaction}
|
|
152
223
|
*/
|
|
153
224
|
addReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
|
|
154
225
|
/**
|
|
@@ -183,7 +254,7 @@ export interface RestManager {
|
|
|
183
254
|
*
|
|
184
255
|
* Fires a _Guild Member Update_ gateway event.
|
|
185
256
|
*
|
|
186
|
-
* @see {@link https://discord.com/developers/
|
|
257
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#add-guild-member-role}
|
|
187
258
|
*/
|
|
188
259
|
addRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
|
|
189
260
|
/**
|
|
@@ -198,7 +269,7 @@ export interface RestManager {
|
|
|
198
269
|
*
|
|
199
270
|
* Fires a _Thread Members Update_ gateway event.
|
|
200
271
|
*
|
|
201
|
-
* @see {@link https://discord.com/developers/
|
|
272
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#add-thread-member}
|
|
202
273
|
*/
|
|
203
274
|
addThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
204
275
|
/**
|
|
@@ -211,7 +282,7 @@ export interface RestManager {
|
|
|
211
282
|
* @remarks
|
|
212
283
|
* Requires an OAuth2 access token with the `gdm.join` scope
|
|
213
284
|
*
|
|
214
|
-
* @see {@link https://discord.com/developers/
|
|
285
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#group-dm-add-recipient}
|
|
215
286
|
*/
|
|
216
287
|
addDmRecipient: (channelId: BigString, userId: BigString, options: AddDmRecipientOptions) => Promise<void>;
|
|
217
288
|
/**
|
|
@@ -227,7 +298,7 @@ export interface RestManager {
|
|
|
227
298
|
*
|
|
228
299
|
* Fires a _Guild Member Add_ gateway event.
|
|
229
300
|
*
|
|
230
|
-
* @see {@link https://discord.com/developers/
|
|
301
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#add-guild-member}
|
|
231
302
|
*/
|
|
232
303
|
addGuildMember: (guildId: BigString, userId: BigString, options: AddGuildMemberOptions) => Promise<void>;
|
|
233
304
|
/**
|
|
@@ -243,7 +314,7 @@ export interface RestManager {
|
|
|
243
314
|
*
|
|
244
315
|
* Fires an _Auto Moderation Rule Create_ gateway event.
|
|
245
316
|
*
|
|
246
|
-
* @see {@link https://discord.com/developers/
|
|
317
|
+
* @see {@link https://docs.discord.com/developers/resources/auto-moderation#create-auto-moderation-rule}
|
|
247
318
|
*/
|
|
248
319
|
createAutomodRule: (guildId: BigString, options: CreateAutoModerationRuleOptions, reason?: string) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
249
320
|
/**
|
|
@@ -263,7 +334,7 @@ export interface RestManager {
|
|
|
263
334
|
*
|
|
264
335
|
* Fires a _Channel Create_ gateway event.
|
|
265
336
|
*
|
|
266
|
-
* @see {@link https://discord.com/developers/
|
|
337
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#create-guild-channel}
|
|
267
338
|
*/
|
|
268
339
|
createChannel: (guildId: BigString, options: CreateGuildChannel, reason?: string) => Promise<Camelize<DiscordChannel>>;
|
|
269
340
|
/**
|
|
@@ -281,7 +352,7 @@ export interface RestManager {
|
|
|
281
352
|
*
|
|
282
353
|
* Fires a _Guild Emojis Update_ gateway event.
|
|
283
354
|
*
|
|
284
|
-
* @see {@link https://discord.com/developers/
|
|
355
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#create-guild-emoji}
|
|
285
356
|
*/
|
|
286
357
|
createEmoji: (guildId: BigString, options: CreateGuildEmoji, reason?: string) => Promise<Camelize<DiscordEmoji>>;
|
|
287
358
|
/**
|
|
@@ -290,7 +361,7 @@ export interface RestManager {
|
|
|
290
361
|
* @param options - The parameters for the creation of the emoji.
|
|
291
362
|
* @returns An instance of the created {@link DiscordEmoji}.
|
|
292
363
|
*
|
|
293
|
-
* @see {@link https://discord.com/developers/
|
|
364
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#create-application-emoji}
|
|
294
365
|
*/
|
|
295
366
|
createApplicationEmoji: (options: CreateApplicationEmoji) => Promise<Camelize<DiscordEmoji>>;
|
|
296
367
|
/**
|
|
@@ -307,7 +378,7 @@ export interface RestManager {
|
|
|
307
378
|
* Fires a _Thread Create_ gateway event.
|
|
308
379
|
* Fires a _Message Create_ gateway event.
|
|
309
380
|
*
|
|
310
|
-
* @see {@link https://discord.com/developers/
|
|
381
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#start-thread-in-forum-or-media-channel}
|
|
311
382
|
*/
|
|
312
383
|
createForumThread: (channelId: BigString, options: CreateForumPostWithMessage, reason?: string) => Promise<Camelize<DiscordChannel>>;
|
|
313
384
|
/**
|
|
@@ -325,7 +396,7 @@ export interface RestManager {
|
|
|
325
396
|
* When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
|
|
326
397
|
* You will be able to update only your own application commands
|
|
327
398
|
*
|
|
328
|
-
* @see {@link https://discord.com/developers/
|
|
399
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#create-global-application-command}
|
|
329
400
|
*/
|
|
330
401
|
createGlobalApplicationCommand: (command: CreateApplicationCommand, options?: CreateGlobalApplicationCommandOptions) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
331
402
|
/**
|
|
@@ -343,7 +414,7 @@ export interface RestManager {
|
|
|
343
414
|
* When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
|
|
344
415
|
* You will be able to update only your own application commands
|
|
345
416
|
*
|
|
346
|
-
* @see {@link https://discord.com/developers/
|
|
417
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#create-guild-application-command}
|
|
347
418
|
*/
|
|
348
419
|
createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString, options?: CreateGuildApplicationCommandOptions) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
349
420
|
/**
|
|
@@ -359,7 +430,7 @@ export interface RestManager {
|
|
|
359
430
|
* Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
|
|
360
431
|
* Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
|
|
361
432
|
*
|
|
362
|
-
* @see {@link https://discord.com/developers/
|
|
433
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#create-guild-sticker}
|
|
363
434
|
*/
|
|
364
435
|
createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions, reason?: string) => Promise<Camelize<DiscordSticker>>;
|
|
365
436
|
/**
|
|
@@ -374,7 +445,7 @@ export interface RestManager {
|
|
|
374
445
|
*
|
|
375
446
|
* Fires a _Guild Update_ gateway event.
|
|
376
447
|
*
|
|
377
|
-
* @see {@link https://discord.com/developers/
|
|
448
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#create-guild-template}
|
|
378
449
|
*/
|
|
379
450
|
createGuildTemplate: (guildId: BigString, options: CreateTemplate) => Promise<Camelize<DiscordTemplate>>;
|
|
380
451
|
/**
|
|
@@ -393,9 +464,19 @@ export interface RestManager {
|
|
|
393
464
|
* @privateRemarks
|
|
394
465
|
* The request body is not optional, and an empty JSON object must be sent regardless of whether any fields are being transmitted.
|
|
395
466
|
*
|
|
396
|
-
* @see {@link https://discord.com/developers/
|
|
467
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#create-channel-invite}
|
|
397
468
|
*/
|
|
398
469
|
createInvite: (channelId: BigString, options?: CreateChannelInvite, reason?: string) => Promise<Camelize<DiscordInvite>>;
|
|
470
|
+
/**
|
|
471
|
+
* Get guild role member counts
|
|
472
|
+
*
|
|
473
|
+
* Returns a map of role IDs to the number of members with the role. Does not include the \@everyone role.
|
|
474
|
+
*
|
|
475
|
+
* @param guildId - The ID of the guild to get role member counts for.
|
|
476
|
+
*
|
|
477
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role-member-counts}
|
|
478
|
+
*/
|
|
479
|
+
getGuildRoleMemberCounts: (guildId: BigString) => Promise<Record<string, number>>;
|
|
399
480
|
/**
|
|
400
481
|
* Creates a role in a guild.
|
|
401
482
|
*
|
|
@@ -409,7 +490,7 @@ export interface RestManager {
|
|
|
409
490
|
*
|
|
410
491
|
* Fires a _Guild Role Create_ gateway event.
|
|
411
492
|
*
|
|
412
|
-
* @see {@link https://discord.com/developers/
|
|
493
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#create-guild-role}
|
|
413
494
|
*/
|
|
414
495
|
createRole: (guildId: BigString, options: CreateGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
|
|
415
496
|
/**
|
|
@@ -427,7 +508,7 @@ export interface RestManager {
|
|
|
427
508
|
*
|
|
428
509
|
* Fires a _Guild Scheduled Event Create_ gateway event.
|
|
429
510
|
*
|
|
430
|
-
* @see {@link https://discord.com/developers/
|
|
511
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#create-guild-scheduled-event}
|
|
431
512
|
*/
|
|
432
513
|
createScheduledEvent: (guildId: BigString, options: CreateScheduledEvent, reason?: string) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
433
514
|
/**
|
|
@@ -442,7 +523,7 @@ export interface RestManager {
|
|
|
442
523
|
*
|
|
443
524
|
* Fires a _Stage Instance Create_ gateway event.
|
|
444
525
|
*
|
|
445
|
-
* @see {@link https://discord.com/developers/
|
|
526
|
+
* @see {@link https://docs.discord.com/developers/resources/stage-instance#create-stage-instance}
|
|
446
527
|
*/
|
|
447
528
|
createStageInstance: (options: CreateStageInstance, reason?: string) => Promise<Camelize<DiscordStageInstance>>;
|
|
448
529
|
/**
|
|
@@ -460,7 +541,7 @@ export interface RestManager {
|
|
|
460
541
|
*
|
|
461
542
|
* Fires a _Webhooks Update_ gateway event.
|
|
462
543
|
*
|
|
463
|
-
* @see {@link https://discord.com/developers/
|
|
544
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#create-webhook}
|
|
464
545
|
*/
|
|
465
546
|
createWebhook: (channelId: BigString, options: CreateWebhook, reason?: string) => Promise<Camelize<DiscordWebhook>>;
|
|
466
547
|
/**
|
|
@@ -475,7 +556,7 @@ export interface RestManager {
|
|
|
475
556
|
*
|
|
476
557
|
* Fires an _Auto Moderation Rule Delete_ gateway event.
|
|
477
558
|
*
|
|
478
|
-
* @see {@link https://discord.com/developers/
|
|
559
|
+
* @see {@link https://docs.discord.com/developers/resources/auto-moderation#delete-auto-moderation-rule}
|
|
479
560
|
*/
|
|
480
561
|
deleteAutomodRule: (guildId: BigString, ruleId: BigString, reason?: string) => Promise<void>;
|
|
481
562
|
/**
|
|
@@ -501,7 +582,7 @@ export interface RestManager {
|
|
|
501
582
|
*
|
|
502
583
|
* - Fires a _Channel Delete_ gateway event.
|
|
503
584
|
*
|
|
504
|
-
* @see {@link https://discord.com/developers/
|
|
585
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#deleteclose-channel}
|
|
505
586
|
*/
|
|
506
587
|
deleteChannel: (channelId: BigString, reason?: string) => Promise<void>;
|
|
507
588
|
/**
|
|
@@ -516,7 +597,7 @@ export interface RestManager {
|
|
|
516
597
|
*
|
|
517
598
|
* Fires a _Channel Update_ gateway event.
|
|
518
599
|
*
|
|
519
|
-
* @see {@link https://discord.com/developers/
|
|
600
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-channel-permission}
|
|
520
601
|
*/
|
|
521
602
|
deleteChannelPermissionOverride: (channelId: BigString, overwriteId: BigString, reason?: string) => Promise<void>;
|
|
522
603
|
/**
|
|
@@ -532,7 +613,7 @@ export interface RestManager {
|
|
|
532
613
|
*
|
|
533
614
|
* Fires a _Guild Emojis Update_ gateway event.
|
|
534
615
|
*
|
|
535
|
-
* @see {@link https://discord.com/developers/
|
|
616
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#delete-guild-emoji}
|
|
536
617
|
*/
|
|
537
618
|
deleteEmoji: (guildId: BigString, id: BigString, reason?: string) => Promise<void>;
|
|
538
619
|
/**
|
|
@@ -540,7 +621,7 @@ export interface RestManager {
|
|
|
540
621
|
*
|
|
541
622
|
* @param id - The ID of the emoji to delete.
|
|
542
623
|
*
|
|
543
|
-
* @see {@link https://discord.com/developers/
|
|
624
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#delete-application-emoji}
|
|
544
625
|
*/
|
|
545
626
|
deleteApplicationEmoji: (id: BigString) => Promise<void>;
|
|
546
627
|
/**
|
|
@@ -554,7 +635,7 @@ export interface RestManager {
|
|
|
554
635
|
*
|
|
555
636
|
* Fires a _Message Delete_ event.
|
|
556
637
|
*
|
|
557
|
-
* @see {@link https://discord.com/developers/
|
|
638
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#delete-followup-message}
|
|
558
639
|
*/
|
|
559
640
|
deleteFollowupMessage: (token: string, messageId: BigString) => Promise<void>;
|
|
560
641
|
/**
|
|
@@ -562,7 +643,7 @@ export interface RestManager {
|
|
|
562
643
|
*
|
|
563
644
|
* @param commandId - The ID of the command to delete.
|
|
564
645
|
*
|
|
565
|
-
* @see {@link https://discord.com/developers/
|
|
646
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#delete-global-application-command}
|
|
566
647
|
*/
|
|
567
648
|
deleteGlobalApplicationCommand: (commandId: BigString) => Promise<void>;
|
|
568
649
|
/**
|
|
@@ -571,7 +652,7 @@ export interface RestManager {
|
|
|
571
652
|
* @param guildId - The ID of the guild to delete the command from.
|
|
572
653
|
* @param commandId - The ID of the command to delete from the guild.
|
|
573
654
|
*
|
|
574
|
-
* @see {@link https://discord.com/developers/
|
|
655
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#delete-guild-application-command}
|
|
575
656
|
*/
|
|
576
657
|
deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<void>;
|
|
577
658
|
/**
|
|
@@ -588,7 +669,7 @@ export interface RestManager {
|
|
|
588
669
|
* Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
|
|
589
670
|
* Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
|
|
590
671
|
*
|
|
591
|
-
* @see {@link https://discord.com/developers/
|
|
672
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#delete-guild-sticker}
|
|
592
673
|
*/
|
|
593
674
|
deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
|
|
594
675
|
/**
|
|
@@ -602,7 +683,7 @@ export interface RestManager {
|
|
|
602
683
|
*
|
|
603
684
|
* Fires a _Guild Update_ gateway event.
|
|
604
685
|
*
|
|
605
|
-
* @see {@link https://discord.com/developers/
|
|
686
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#delete-guild-template}
|
|
606
687
|
*/
|
|
607
688
|
deleteGuildTemplate: (guildId: BigString, templateCode: string) => Promise<void>;
|
|
608
689
|
/**
|
|
@@ -620,7 +701,7 @@ export interface RestManager {
|
|
|
620
701
|
* Fires a _Guild Integrations Update_ gateway event.
|
|
621
702
|
* Fires a _Integration Delete_ gateway event.
|
|
622
703
|
*
|
|
623
|
-
* @see {@link https://discord.com/developers/
|
|
704
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#delete-guild-integration}
|
|
624
705
|
*/
|
|
625
706
|
deleteIntegration: (guildId: BigString, integrationId: BigString, reason?: string) => Promise<void>;
|
|
626
707
|
/**
|
|
@@ -634,9 +715,47 @@ export interface RestManager {
|
|
|
634
715
|
*
|
|
635
716
|
* Fires an _Invite Delete_ gateway event.
|
|
636
717
|
*
|
|
637
|
-
* @see {@link https://discord.com/developers/
|
|
718
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-channel-invite}
|
|
638
719
|
*/
|
|
639
720
|
deleteInvite: (inviteCode: string, reason?: string) => Promise<void>;
|
|
721
|
+
/**
|
|
722
|
+
* Gets the users allowed to see and accept this invite.
|
|
723
|
+
*
|
|
724
|
+
* @param inviteCode - The invite code of the invite to update.
|
|
725
|
+
* @returns CSV file containing the user IDs with the header `user_id` and each user ID from the original file
|
|
726
|
+
*
|
|
727
|
+
* @remarks
|
|
728
|
+
* Requires called to be the inviter, or have `MANAGE_GUILD` permission, or have `VIEW_AUDIT_LOG` permission.
|
|
729
|
+
*
|
|
730
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-target-users}
|
|
731
|
+
*/
|
|
732
|
+
getTargetUsers: (inviteCode: string) => Promise<string>;
|
|
733
|
+
/**
|
|
734
|
+
* Updates the users allowed to see and accept this invite.
|
|
735
|
+
*
|
|
736
|
+
* @param inviteCode - The invite code of the invite to update.
|
|
737
|
+
* @param targetUsersFile - A CSV file with a single column of user IDs for all the users able to accept this invite
|
|
738
|
+
*
|
|
739
|
+
* @remarks
|
|
740
|
+
* Requires the caller to be the inviter or have the `MANAGE_GUILD` permission.
|
|
741
|
+
*
|
|
742
|
+
* Uploading a file with invalid user IDs will result in a 400 with the invalid IDs described.
|
|
743
|
+
*
|
|
744
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#update-target-users}
|
|
745
|
+
*/
|
|
746
|
+
updateTargetUsers: (inviteCode: string, targetUsersFile: Blob) => Promise<void>;
|
|
747
|
+
/**
|
|
748
|
+
* Processing target users from a CSV when creating or updating an invite is done asynchronously. This endpoint allows you to check the status of that job.
|
|
749
|
+
*
|
|
750
|
+
* @param inviteCode - The invite code of the invite to check the target users job status for.
|
|
751
|
+
* @returns An object containing the status of the target users job.
|
|
752
|
+
*
|
|
753
|
+
* @remarks
|
|
754
|
+
* Requires the caller to be the inviter, or have `MANAGE_GUILD` permission, or have `VIEW_AUDIT_LOG` permission.
|
|
755
|
+
*
|
|
756
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-target-users-job-status}
|
|
757
|
+
*/
|
|
758
|
+
getTargetUsersJobStatus: (inviteCode: string) => Promise<Camelize<DiscordTargetUsersJobStatus>>;
|
|
640
759
|
/**
|
|
641
760
|
* Deletes a message from a channel.
|
|
642
761
|
*
|
|
@@ -650,7 +769,7 @@ export interface RestManager {
|
|
|
650
769
|
*
|
|
651
770
|
* Fires a _Message Delete_ gateway event.
|
|
652
771
|
*
|
|
653
|
-
* @see {@link https://discord.com/developers/
|
|
772
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-message}
|
|
654
773
|
*/
|
|
655
774
|
deleteMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
656
775
|
/**
|
|
@@ -667,7 +786,7 @@ export interface RestManager {
|
|
|
667
786
|
*
|
|
668
787
|
* Fires a _Message Delete Bulk_ gateway event.
|
|
669
788
|
*
|
|
670
|
-
* @see {@link https://discord.com/developers/
|
|
789
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#bulk-delete-messages}
|
|
671
790
|
*/
|
|
672
791
|
deleteMessages: (channelId: BigString, messageIds: BigString[], reason?: string) => Promise<void>;
|
|
673
792
|
/**
|
|
@@ -680,7 +799,7 @@ export interface RestManager {
|
|
|
680
799
|
*
|
|
681
800
|
* Fires a _Message Delete_ event.
|
|
682
801
|
*
|
|
683
|
-
* @see {@link https://discord.com/developers/
|
|
802
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#delete-original-interaction-response}
|
|
684
803
|
*/
|
|
685
804
|
deleteOriginalInteractionResponse: (token: string) => Promise<void>;
|
|
686
805
|
/**
|
|
@@ -695,7 +814,7 @@ export interface RestManager {
|
|
|
695
814
|
*
|
|
696
815
|
* Fires a _Message Reaction Remove_ gateway event.
|
|
697
816
|
*
|
|
698
|
-
* @see {@link https://discord.com/developers/
|
|
817
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-own-reaction}
|
|
699
818
|
*/
|
|
700
819
|
deleteOwnReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
|
|
701
820
|
/**
|
|
@@ -711,7 +830,7 @@ export interface RestManager {
|
|
|
711
830
|
*
|
|
712
831
|
* Fires a _Message Reaction Remove All_ gateway event.
|
|
713
832
|
*
|
|
714
|
-
* @see {@link https://discord.com/developers/
|
|
833
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-all-reactions}
|
|
715
834
|
*/
|
|
716
835
|
deleteReactionsAll: (channelId: BigString, messageId: BigString) => Promise<void>;
|
|
717
836
|
/**
|
|
@@ -728,7 +847,7 @@ export interface RestManager {
|
|
|
728
847
|
*
|
|
729
848
|
* Fires a _Message Reaction Remove Emoji_ gateway event.
|
|
730
849
|
*
|
|
731
|
-
* @see {@link https://discord.com/developers/
|
|
850
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-all-reactions-for-emoji}
|
|
732
851
|
*/
|
|
733
852
|
deleteReactionsEmoji: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
|
|
734
853
|
/**
|
|
@@ -743,7 +862,7 @@ export interface RestManager {
|
|
|
743
862
|
*
|
|
744
863
|
* Fires a _Guild Role Delete_ gateway event.
|
|
745
864
|
*
|
|
746
|
-
* @see {@link https://discord.com/developers/
|
|
865
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#delete-guild-role}
|
|
747
866
|
*/
|
|
748
867
|
deleteRole: (guildId: BigString, roleId: BigString, reason?: string) => Promise<void>;
|
|
749
868
|
/**
|
|
@@ -757,7 +876,7 @@ export interface RestManager {
|
|
|
757
876
|
*
|
|
758
877
|
* Fires a _Guild Scheduled Event Delete_ gateway event.
|
|
759
878
|
*
|
|
760
|
-
* @see {@link https://discord.com/developers/
|
|
879
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#delete-guild-scheduled-event}
|
|
761
880
|
*/
|
|
762
881
|
deleteScheduledEvent: (guildId: BigString, eventId: BigString) => Promise<void>;
|
|
763
882
|
/**
|
|
@@ -771,7 +890,7 @@ export interface RestManager {
|
|
|
771
890
|
*
|
|
772
891
|
* Fires a _Stage Instance Delete_ gateway event.
|
|
773
892
|
*
|
|
774
|
-
* @see {@link https://discord.com/developers/
|
|
893
|
+
* @see {@link https://docs.discord.com/developers/resources/stage-instance#delete-stage-instance}
|
|
775
894
|
*/
|
|
776
895
|
deleteStageInstance: (channelId: BigString, reason?: string) => Promise<void>;
|
|
777
896
|
/**
|
|
@@ -789,7 +908,7 @@ export interface RestManager {
|
|
|
789
908
|
*
|
|
790
909
|
* Fires a _Message Reaction Remove_ gateway event.
|
|
791
910
|
*
|
|
792
|
-
* @see {@link https://discord.com/developers/
|
|
911
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-user-reaction}
|
|
793
912
|
*/
|
|
794
913
|
deleteUserReaction: (channelId: BigString, messageId: BigString, userId: BigString, reaction: string) => Promise<void>;
|
|
795
914
|
/**
|
|
@@ -802,7 +921,7 @@ export interface RestManager {
|
|
|
802
921
|
*
|
|
803
922
|
* Fires a _Webhooks Update_ gateway event.
|
|
804
923
|
*
|
|
805
|
-
* @see {@link https://discord.com/developers/
|
|
924
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#delete-webhook}
|
|
806
925
|
*/
|
|
807
926
|
deleteWebhook: (webhookId: BigString, reason?: string) => Promise<void>;
|
|
808
927
|
/**
|
|
@@ -816,7 +935,7 @@ export interface RestManager {
|
|
|
816
935
|
* @remarks
|
|
817
936
|
* Fires a _Message Delete_ gateway event.
|
|
818
937
|
*
|
|
819
|
-
* @see {@link https://discord.com/developers/
|
|
938
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#delete-webhook}
|
|
820
939
|
*/
|
|
821
940
|
deleteWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: DeleteWebhookMessageOptions) => Promise<void>;
|
|
822
941
|
/**
|
|
@@ -828,7 +947,7 @@ export interface RestManager {
|
|
|
828
947
|
* @remarks
|
|
829
948
|
* Fires a _Message Delete_ gateway event.
|
|
830
949
|
*
|
|
831
|
-
* @see {@link https://discord.com/developers/
|
|
950
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#delete-webhook-with-token}
|
|
832
951
|
*/
|
|
833
952
|
deleteWebhookWithToken: (webhookId: BigString, token: string) => Promise<void>;
|
|
834
953
|
/**
|
|
@@ -843,7 +962,7 @@ export interface RestManager {
|
|
|
843
962
|
* @remarks
|
|
844
963
|
* 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.
|
|
845
964
|
*
|
|
846
|
-
* @see {@link https://discord.com/developers/
|
|
965
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#edit-application-command-permissions}
|
|
847
966
|
*/
|
|
848
967
|
editApplicationCommandPermissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: Camelize<DiscordApplicationCommandPermissions>[]) => Promise<Camelize<DiscordGuildApplicationCommandPermissions>>;
|
|
849
968
|
/**
|
|
@@ -860,17 +979,26 @@ export interface RestManager {
|
|
|
860
979
|
*
|
|
861
980
|
* Fires an _Auto Moderation Rule Update_ gateway event.
|
|
862
981
|
*
|
|
863
|
-
* @see {@link https://discord.com/developers/
|
|
982
|
+
* @see {@link https://docs.discord.com/developers/resources/auto-moderation#modify-auto-moderation-rule}
|
|
864
983
|
*/
|
|
865
984
|
editAutomodRule: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions>, reason?: string) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
866
985
|
/**
|
|
867
986
|
* Modifies the bot's username, avatar or banner.
|
|
868
|
-
*
|
|
987
|
+
*
|
|
988
|
+
* @param options - The parameters for the edit of the bot's profile.
|
|
989
|
+
* @returns An instance of the edited {@link DiscordUser}.
|
|
990
|
+
*
|
|
991
|
+
* @remarks
|
|
992
|
+
* Editing the `username` may cause the bot's discriminator to be randomized.
|
|
993
|
+
*
|
|
994
|
+
* `avatar` and `banner` must to be a Data URI scheme. {@link urlToBase64} from `@discordeno/utils` can be used to convert a URL to a Data URI scheme.
|
|
995
|
+
*
|
|
996
|
+
* @see {@link https://docs.discord.com/developers/resources/user#modify-current-user}
|
|
869
997
|
*/
|
|
870
998
|
editBotProfile: (options: {
|
|
871
999
|
username?: string;
|
|
872
|
-
|
|
873
|
-
|
|
1000
|
+
avatar?: string | null;
|
|
1001
|
+
banner?: string | null;
|
|
874
1002
|
}) => Promise<Camelize<DiscordUser>>;
|
|
875
1003
|
/**
|
|
876
1004
|
* Edits a channel's settings.
|
|
@@ -917,7 +1045,7 @@ export interface RestManager {
|
|
|
917
1045
|
*
|
|
918
1046
|
* Fires a _Channel Update_ gateway event.
|
|
919
1047
|
*
|
|
920
|
-
* @see {@link https://discord.com/developers/
|
|
1048
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#edit-channel-permissions}
|
|
921
1049
|
*/
|
|
922
1050
|
editChannelPermissionOverrides: (channelId: BigString, options: EditChannelPermissionOverridesOptions, reason?: string) => Promise<void>;
|
|
923
1051
|
/**
|
|
@@ -931,7 +1059,13 @@ export interface RestManager {
|
|
|
931
1059
|
*
|
|
932
1060
|
* Fires a _Channel Update_ gateway event for every channel impacted in this change.
|
|
933
1061
|
*
|
|
934
|
-
*
|
|
1062
|
+
* At most one entry per request may change `parent_id`. A request that changes `parent_id` for more than one channel fails with a 400 response and error code 40009.
|
|
1063
|
+
*
|
|
1064
|
+
* Permissions are checked per entry, based on what the entry changes:
|
|
1065
|
+
* - An entry that only changes `position` requires the `MANAGE_CHANNELS` permission at the guild level (or on the channel's current parent category). It does **not** require access to the individual channel, so a full reordering may include channels the current user cannot view.
|
|
1066
|
+
* - An entry that changes `parent_id` requires the `MANAGE_CHANNELS` permission on that channel and on the destination (the new parent category, or the guild when moving the channel out of a category), and the current user must be able to view the channel. Otherwise the request fails with a `403` response and error code 50001. Setting `lock_permissions` additionally requires `MANAGE_ROLES`.
|
|
1067
|
+
*
|
|
1068
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-channel-positions}
|
|
935
1069
|
*/
|
|
936
1070
|
editChannelPositions: (guildId: BigString, channelPositions: ModifyGuildChannelPositions[]) => Promise<void>;
|
|
937
1071
|
/**
|
|
@@ -949,7 +1083,7 @@ export interface RestManager {
|
|
|
949
1083
|
*
|
|
950
1084
|
* Fires a `Guild Emojis Update` gateway event.
|
|
951
1085
|
*
|
|
952
|
-
* @see {@link https://discord.com/developers/
|
|
1086
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#modify-guild-emoji}
|
|
953
1087
|
*/
|
|
954
1088
|
editEmoji: (guildId: BigString, id: BigString, options: ModifyGuildEmoji, reason?: string) => Promise<Camelize<DiscordEmoji>>;
|
|
955
1089
|
/**
|
|
@@ -959,7 +1093,7 @@ export interface RestManager {
|
|
|
959
1093
|
* @param options - The parameters for the edit of the emoji.
|
|
960
1094
|
* @returns An instance of the updated {@link DiscordEmoji}.
|
|
961
1095
|
*
|
|
962
|
-
* @see {@link https://discord.com/developers/
|
|
1096
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#modify-application-emoji}
|
|
963
1097
|
*/
|
|
964
1098
|
editApplicationEmoji: (id: BigString, options: ModifyApplicationEmoji) => Promise<Camelize<DiscordEmoji>>;
|
|
965
1099
|
/**
|
|
@@ -977,7 +1111,7 @@ export interface RestManager {
|
|
|
977
1111
|
*
|
|
978
1112
|
* Fires a _Message Update_ event.
|
|
979
1113
|
*
|
|
980
|
-
* @see {@link https://discord.com/developers/
|
|
1114
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#edit-followup-message}
|
|
981
1115
|
*/
|
|
982
1116
|
editFollowupMessage: (token: string, messageId: BigString, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
|
|
983
1117
|
/**
|
|
@@ -987,7 +1121,7 @@ export interface RestManager {
|
|
|
987
1121
|
* @param options - The parameters for the edit of the command.
|
|
988
1122
|
* @returns An instance of the edited {@link DiscordApplicationCommand}.
|
|
989
1123
|
*
|
|
990
|
-
* @see {@link https://discord.com/developers/
|
|
1124
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#edit-global-application-command}
|
|
991
1125
|
*/
|
|
992
1126
|
editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
993
1127
|
/**
|
|
@@ -1006,7 +1140,7 @@ export interface RestManager {
|
|
|
1006
1140
|
*
|
|
1007
1141
|
* Fires a _Guild Update_ gateway event.
|
|
1008
1142
|
*
|
|
1009
|
-
* @see {@link https://discord.com/developers/
|
|
1143
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild}
|
|
1010
1144
|
*/
|
|
1011
1145
|
editGuild: (guildId: BigString, options: ModifyGuild, reason?: string) => Promise<Camelize<DiscordGuild>>;
|
|
1012
1146
|
/**
|
|
@@ -1017,7 +1151,7 @@ export interface RestManager {
|
|
|
1017
1151
|
* @param options - The parameters for the edit of the command.
|
|
1018
1152
|
* @returns An instance of the edited {@link DiscordApplicationCommand}.
|
|
1019
1153
|
*
|
|
1020
|
-
* @see {@link https://discord.com/developers/
|
|
1154
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#edit-guild-application-command}
|
|
1021
1155
|
*/
|
|
1022
1156
|
editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1023
1157
|
/**
|
|
@@ -1032,7 +1166,7 @@ export interface RestManager {
|
|
|
1032
1166
|
* For other stickers, requires the `MANAGE_GUILD_EXPRESSIONS` permission.
|
|
1033
1167
|
* Fires a Guild Stickers Update Gateway event.
|
|
1034
1168
|
*
|
|
1035
|
-
* @see {@link https://discord.com/developers/
|
|
1169
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#modify-guild-sticker}
|
|
1036
1170
|
*/
|
|
1037
1171
|
editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>, reason?: string) => Promise<Camelize<DiscordSticker>>;
|
|
1038
1172
|
/**
|
|
@@ -1048,7 +1182,7 @@ export interface RestManager {
|
|
|
1048
1182
|
*
|
|
1049
1183
|
* Fires a _Guild Update_ gateway event.
|
|
1050
1184
|
*
|
|
1051
|
-
* @see {@link https://discord.com/developers/
|
|
1185
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#modify-guild-template}
|
|
1052
1186
|
*/
|
|
1053
1187
|
editGuildTemplate: (guildId: BigString, templateCode: string, options: ModifyGuildTemplate) => Promise<Camelize<DiscordTemplate>>;
|
|
1054
1188
|
/**
|
|
@@ -1066,7 +1200,7 @@ export interface RestManager {
|
|
|
1066
1200
|
*
|
|
1067
1201
|
* Fires a _Message Update_ gateway event.
|
|
1068
1202
|
*
|
|
1069
|
-
* @see {@link https://discord.com/developers/
|
|
1203
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#edit-message}
|
|
1070
1204
|
*/
|
|
1071
1205
|
editMessage: (channelId: BigString, messageId: BigString, options: EditMessage) => Promise<Camelize<DiscordMessage>>;
|
|
1072
1206
|
/**
|
|
@@ -1083,7 +1217,7 @@ export interface RestManager {
|
|
|
1083
1217
|
*
|
|
1084
1218
|
* Fires a _Message Update_ event.
|
|
1085
1219
|
*
|
|
1086
|
-
* @see {@link https://discord.com/developers/
|
|
1220
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#edit-original-interaction-response}
|
|
1087
1221
|
*/
|
|
1088
1222
|
editOriginalInteractionResponse: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
|
|
1089
1223
|
/**
|
|
@@ -1101,7 +1235,7 @@ export interface RestManager {
|
|
|
1101
1235
|
* If attempting to request to speak:
|
|
1102
1236
|
* - Requires the `REQUEST_TO_SPEAK` permission.
|
|
1103
1237
|
*
|
|
1104
|
-
* @see {@link https://discord.com/developers/
|
|
1238
|
+
* @see {@link https://docs.discord.com/developers/resources/voice#modify-current-user-voice-state}
|
|
1105
1239
|
*/
|
|
1106
1240
|
editOwnVoiceState: (guildId: BigString, options: EditOwnVoiceState) => Promise<void>;
|
|
1107
1241
|
/**
|
|
@@ -1118,7 +1252,7 @@ export interface RestManager {
|
|
|
1118
1252
|
*
|
|
1119
1253
|
* Fires a _Guild Role Update_ gateway event.
|
|
1120
1254
|
*
|
|
1121
|
-
* @see {@link https://discord.com/developers/
|
|
1255
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-role}
|
|
1122
1256
|
*/
|
|
1123
1257
|
editRole: (guildId: BigString, roleId: BigString, options: EditGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
|
|
1124
1258
|
/**
|
|
@@ -1134,7 +1268,7 @@ export interface RestManager {
|
|
|
1134
1268
|
*
|
|
1135
1269
|
* Fires a _Guild Role Update_ gateway event for every role impacted in this change.
|
|
1136
1270
|
*
|
|
1137
|
-
* @see {@link https://discord.com/developers/
|
|
1271
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-role-positions}
|
|
1138
1272
|
*/
|
|
1139
1273
|
editRolePositions: (guildId: BigString, options: ModifyRolePositions[], reason?: string) => Promise<Camelize<DiscordRole>[]>;
|
|
1140
1274
|
/**
|
|
@@ -1154,7 +1288,7 @@ export interface RestManager {
|
|
|
1154
1288
|
*
|
|
1155
1289
|
* Fires a _Guild Scheduled Event Update_ gateway event.
|
|
1156
1290
|
*
|
|
1157
|
-
* @see {@link https://discord.com/developers/
|
|
1291
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
|
1158
1292
|
*/
|
|
1159
1293
|
editScheduledEvent: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent>, reason?: string) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
1160
1294
|
/**
|
|
@@ -1170,7 +1304,7 @@ export interface RestManager {
|
|
|
1170
1304
|
*
|
|
1171
1305
|
* Fires a _Stage Instance Update_ event.
|
|
1172
1306
|
*
|
|
1173
|
-
* @see {@link https://discord.com/developers/
|
|
1307
|
+
* @see {@link https://docs.discord.com/developers/resources/stage-instance#modify-stage-instance}
|
|
1174
1308
|
*/
|
|
1175
1309
|
editStageInstance: (channelId: BigString, topic: string, reason?: string) => Promise<Camelize<DiscordStageInstance>>;
|
|
1176
1310
|
/**
|
|
@@ -1184,7 +1318,7 @@ export interface RestManager {
|
|
|
1184
1318
|
*
|
|
1185
1319
|
* Requires the `MUTE_MEMBERS` permission.
|
|
1186
1320
|
*
|
|
1187
|
-
* @see {@link https://discord.com/developers/
|
|
1321
|
+
* @see {@link https://docs.discord.com/developers/resources/voice#modify-user-voice-state}
|
|
1188
1322
|
*/
|
|
1189
1323
|
editUserVoiceState: (guildId: BigString, options: EditUserVoiceState) => Promise<void>;
|
|
1190
1324
|
/**
|
|
@@ -1198,9 +1332,21 @@ export interface RestManager {
|
|
|
1198
1332
|
* @remarks
|
|
1199
1333
|
* This requires the `role_connections.write` scope.
|
|
1200
1334
|
*
|
|
1201
|
-
* @see {@link https://discord.com/developers/
|
|
1335
|
+
* @see {@link https://docs.discord.com/developers/resources/user#update-user-application-role-connection}
|
|
1202
1336
|
*/
|
|
1203
1337
|
editUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString, options: Camelize<DiscordApplicationRoleConnection>) => Promise<Camelize<DiscordApplicationRoleConnection>>;
|
|
1338
|
+
/**
|
|
1339
|
+
* Deletes the application role connection for the user.
|
|
1340
|
+
*
|
|
1341
|
+
* @param bearerToken - The access token of the user
|
|
1342
|
+
* @param applicationId - The id of the application to delete the role connection
|
|
1343
|
+
*
|
|
1344
|
+
* @remarks
|
|
1345
|
+
* This requires the `role_connections.write` scope.
|
|
1346
|
+
*
|
|
1347
|
+
* @see {@link https://docs.discord.com/developers/resources/user#delete-current-user-application-role-connection}
|
|
1348
|
+
*/
|
|
1349
|
+
deleteCurrentUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString) => Promise<void>;
|
|
1204
1350
|
/**
|
|
1205
1351
|
* Edits a webhook.
|
|
1206
1352
|
*
|
|
@@ -1213,7 +1359,7 @@ export interface RestManager {
|
|
|
1213
1359
|
*
|
|
1214
1360
|
* Fires a _Webhooks Update_ gateway event.
|
|
1215
1361
|
*
|
|
1216
|
-
* @see {@link https://discord.com/developers/
|
|
1362
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#edit-webhook}
|
|
1217
1363
|
*/
|
|
1218
1364
|
editWebhook: (webhookId: BigString, options: ModifyWebhook, reason?: string) => Promise<Camelize<DiscordWebhook>>;
|
|
1219
1365
|
/**
|
|
@@ -1228,7 +1374,7 @@ export interface RestManager {
|
|
|
1228
1374
|
* @remarks
|
|
1229
1375
|
* Fires a _Message Update_ gateway event.
|
|
1230
1376
|
*
|
|
1231
|
-
* @see {@link https://discord.com/developers/
|
|
1377
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#edit-webhook-message}
|
|
1232
1378
|
*/
|
|
1233
1379
|
editWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options: EditWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
1234
1380
|
/**
|
|
@@ -1243,7 +1389,7 @@ export interface RestManager {
|
|
|
1243
1389
|
*
|
|
1244
1390
|
* Fires a _Webhooks Update_ gateway event.
|
|
1245
1391
|
*
|
|
1246
|
-
* @see {@link https://discord.com/developers/
|
|
1392
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#modify-webhook-with-token}
|
|
1247
1393
|
*/
|
|
1248
1394
|
editWebhookWithToken: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
|
|
1249
1395
|
/**
|
|
@@ -1259,7 +1405,7 @@ export interface RestManager {
|
|
|
1259
1405
|
*
|
|
1260
1406
|
* Fires a _Guild Update_ gateway event.
|
|
1261
1407
|
*
|
|
1262
|
-
* @see {@link https://discord.com/developers/
|
|
1408
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-welcome-screen}
|
|
1263
1409
|
*/
|
|
1264
1410
|
editWelcomeScreen: (guildId: BigString, options: ModifyGuildWelcomeScreen, reason?: string) => Promise<Camelize<DiscordWelcomeScreen>>;
|
|
1265
1411
|
/**
|
|
@@ -1274,7 +1420,7 @@ export interface RestManager {
|
|
|
1274
1420
|
*
|
|
1275
1421
|
* Fires a _Guild Update_ gateway event.
|
|
1276
1422
|
*
|
|
1277
|
-
* @see {@link https://discord.com/developers/
|
|
1423
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-widget}
|
|
1278
1424
|
*/
|
|
1279
1425
|
editWidgetSettings: (guildId: BigString, options: Camelize<DiscordGuildWidgetSettings>, reason?: string) => Promise<Camelize<DiscordGuildWidgetSettings>>;
|
|
1280
1426
|
/**
|
|
@@ -1288,7 +1434,7 @@ export interface RestManager {
|
|
|
1288
1434
|
* @remarks
|
|
1289
1435
|
* If the webhook channel is a forum channel, you must provide a value for either `threadId` or `threadName`.
|
|
1290
1436
|
*
|
|
1291
|
-
* @see {@link https://discord.com/developers/
|
|
1437
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#execute-webhook}
|
|
1292
1438
|
*/
|
|
1293
1439
|
executeWebhook: (webhookId: BigString, token: string, options: ExecuteWebhook) => Promise<Camelize<DiscordMessage> | undefined>;
|
|
1294
1440
|
/**
|
|
@@ -1304,7 +1450,7 @@ export interface RestManager {
|
|
|
1304
1450
|
*
|
|
1305
1451
|
* Fires a _Webhooks Update_ gateway event.
|
|
1306
1452
|
*
|
|
1307
|
-
* @see {@link https://discord.com/developers/
|
|
1453
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#follow-announcement-channel}
|
|
1308
1454
|
*/
|
|
1309
1455
|
followAnnouncement: (sourceChannelId: BigString, targetChannelId: BigString, reason?: string) => Promise<Camelize<DiscordFollowedChannel>>;
|
|
1310
1456
|
/**
|
|
@@ -1318,7 +1464,7 @@ export interface RestManager {
|
|
|
1318
1464
|
*
|
|
1319
1465
|
* Threads are ordered by the `id` property in descending order.
|
|
1320
1466
|
*
|
|
1321
|
-
* @see {@link https://discord.com/developers/
|
|
1467
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#list-active-guild-threads}
|
|
1322
1468
|
*/
|
|
1323
1469
|
getActiveThreads: (guildId: BigString) => Promise<Camelize<DiscordListActiveThreads>>;
|
|
1324
1470
|
/** Get the applications info */
|
|
@@ -1368,7 +1514,7 @@ export interface RestManager {
|
|
|
1368
1514
|
* @remarks
|
|
1369
1515
|
* Then specifying the options object the access token passed-in requires the OAuth2 scope `applications.commands.permissions.update`
|
|
1370
1516
|
*
|
|
1371
|
-
* @see {@link https://discord.com/developers/
|
|
1517
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-application-command-permissions}
|
|
1372
1518
|
*/
|
|
1373
1519
|
getApplicationCommandPermission: (guildId: BigString, commandId: BigString, options?: GetApplicationCommandPermissionOptions) => Promise<Camelize<DiscordGuildApplicationCommandPermissions>>;
|
|
1374
1520
|
/**
|
|
@@ -1381,7 +1527,7 @@ export interface RestManager {
|
|
|
1381
1527
|
* @remarks
|
|
1382
1528
|
* Then specifying the options object the access token passed-in requires the OAuth2 scope `applications.commands.permissions.update`
|
|
1383
1529
|
*
|
|
1384
|
-
* @see {@link https://discord.com/developers/
|
|
1530
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-guild-application-command-permissions}
|
|
1385
1531
|
*/
|
|
1386
1532
|
getApplicationCommandPermissions: (guildId: BigString, options?: GetApplicationCommandPermissionOptions) => Promise<Camelize<DiscordGuildApplicationCommandPermissions>[]>;
|
|
1387
1533
|
/**
|
|
@@ -1394,7 +1540,7 @@ export interface RestManager {
|
|
|
1394
1540
|
* @remarks
|
|
1395
1541
|
* Requires the `VIEW_AUDIT_LOG` permission.
|
|
1396
1542
|
*
|
|
1397
|
-
* @see {@link https://discord.com/developers/
|
|
1543
|
+
* @see {@link https://docs.discord.com/developers/resources/audit-log#get-guild-audit-log}
|
|
1398
1544
|
*/
|
|
1399
1545
|
getAuditLog: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
|
|
1400
1546
|
/**
|
|
@@ -1407,7 +1553,7 @@ export interface RestManager {
|
|
|
1407
1553
|
* @remarks
|
|
1408
1554
|
* Requires the `MANAGE_GUILD` permission.
|
|
1409
1555
|
*
|
|
1410
|
-
* @see {@link https://discord.com/developers/
|
|
1556
|
+
* @see {@link https://docs.discord.com/developers/resources/auto-moderation#get-auto-moderation-rule}
|
|
1411
1557
|
*/
|
|
1412
1558
|
getAutomodRule: (guildId: BigString, ruleId: BigString) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
1413
1559
|
/**
|
|
@@ -1419,7 +1565,7 @@ export interface RestManager {
|
|
|
1419
1565
|
* @remarks
|
|
1420
1566
|
* Requires the `MANAGE_GUILD` permission.
|
|
1421
1567
|
*
|
|
1422
|
-
* @see {@link https://discord.com/developers/
|
|
1568
|
+
* @see {@link https://docs.discord.com/developers/resources/auto-moderation#list-auto-moderation-rules-for-guild}
|
|
1423
1569
|
*/
|
|
1424
1570
|
getAutomodRules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule>[]>;
|
|
1425
1571
|
/**
|
|
@@ -1438,7 +1584,7 @@ export interface RestManager {
|
|
|
1438
1584
|
* @remarks
|
|
1439
1585
|
* Requires the `BAN_MEMBERS` permission.
|
|
1440
1586
|
*
|
|
1441
|
-
* @see {@link https://discord.com/developers/
|
|
1587
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-ban}
|
|
1442
1588
|
*/
|
|
1443
1589
|
getBan: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
|
|
1444
1590
|
/**
|
|
@@ -1453,7 +1599,7 @@ export interface RestManager {
|
|
|
1453
1599
|
*
|
|
1454
1600
|
* Users are ordered by their IDs in _ascending_ order.
|
|
1455
1601
|
*
|
|
1456
|
-
* @see {@link https://discord.com/developers/
|
|
1602
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-bans}
|
|
1457
1603
|
*/
|
|
1458
1604
|
getBans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan>[]>;
|
|
1459
1605
|
/**
|
|
@@ -1465,7 +1611,7 @@ export interface RestManager {
|
|
|
1465
1611
|
* @remarks
|
|
1466
1612
|
* If the channel is a thread, a {@link DiscordThreadMember} object is included in the result.
|
|
1467
1613
|
*
|
|
1468
|
-
* @see {@link https://discord.com/developers/
|
|
1614
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-channel}
|
|
1469
1615
|
*/
|
|
1470
1616
|
getChannel: (channelId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
1471
1617
|
/**
|
|
@@ -1479,7 +1625,7 @@ export interface RestManager {
|
|
|
1479
1625
|
*
|
|
1480
1626
|
* Only usable for guild channels.
|
|
1481
1627
|
*
|
|
1482
|
-
* @see {@link https://discord.com/developers/
|
|
1628
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-channel-invites}
|
|
1483
1629
|
*/
|
|
1484
1630
|
getChannelInvites: (channelId: BigString) => Promise<Camelize<DiscordInviteMetadata>[]>;
|
|
1485
1631
|
/**
|
|
@@ -1491,7 +1637,7 @@ export interface RestManager {
|
|
|
1491
1637
|
* @remarks
|
|
1492
1638
|
* Excludes threads.
|
|
1493
1639
|
*
|
|
1494
|
-
* @see {@link https://discord.com/developers/
|
|
1640
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-channels}
|
|
1495
1641
|
*/
|
|
1496
1642
|
getChannels: (guildId: BigString) => Promise<Camelize<DiscordChannel>[]>;
|
|
1497
1643
|
/**
|
|
@@ -1503,7 +1649,7 @@ export interface RestManager {
|
|
|
1503
1649
|
* @remarks
|
|
1504
1650
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1505
1651
|
*
|
|
1506
|
-
* @see {@link https://discord.com/developers/
|
|
1652
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#get-channel-webhooks}
|
|
1507
1653
|
*/
|
|
1508
1654
|
getChannelWebhooks: (channelId: BigString) => Promise<Camelize<DiscordWebhook>[]>;
|
|
1509
1655
|
/**
|
|
@@ -1512,7 +1658,7 @@ export interface RestManager {
|
|
|
1512
1658
|
* @param userId - The ID of the user to create the DM channel with.
|
|
1513
1659
|
* @returns An instance of {@link DiscordChannel}.
|
|
1514
1660
|
*
|
|
1515
|
-
* @see {@link https://discord.com/developers/
|
|
1661
|
+
* @see {@link https://docs.discord.com/developers/resources/user#create-dm}
|
|
1516
1662
|
*/
|
|
1517
1663
|
getDmChannel: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
1518
1664
|
/**
|
|
@@ -1528,7 +1674,7 @@ export interface RestManager {
|
|
|
1528
1674
|
*
|
|
1529
1675
|
* Fires a _Channel create_ gateway event.
|
|
1530
1676
|
*
|
|
1531
|
-
* @see {@link https://discord.com/developers/
|
|
1677
|
+
* @see {@link https://docs.discord.com/developers/resources/user#create-group-dm}
|
|
1532
1678
|
*/
|
|
1533
1679
|
getGroupDmChannel: (options: CreateGroupDmOptions) => Promise<Camelize<DiscordChannel>>;
|
|
1534
1680
|
/**
|
|
@@ -1540,9 +1686,9 @@ export interface RestManager {
|
|
|
1540
1686
|
*
|
|
1541
1687
|
* @remarks
|
|
1542
1688
|
* Includes the `user` field if the bot has the `MANAGE_GUILD_EXPRESSIONS` permission,
|
|
1543
|
-
* or if the bot created the emoji and has the
|
|
1689
|
+
* or if the bot created the emoji and has the `CREATE_GUILD_EXPRESSIONS` permission.
|
|
1544
1690
|
*
|
|
1545
|
-
* @see {@link https://discord.com/developers/
|
|
1691
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#get-guild-emoji}
|
|
1546
1692
|
*/
|
|
1547
1693
|
getEmoji: (guildId: BigString, emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
|
|
1548
1694
|
/**
|
|
@@ -1554,7 +1700,7 @@ export interface RestManager {
|
|
|
1554
1700
|
* @remarks
|
|
1555
1701
|
* Always includes the `user` object for the team member that uploaded the emoji from the app's settings, or for the bot user if uploaded using the API.
|
|
1556
1702
|
*
|
|
1557
|
-
* @see {@link https://discord.com/developers/
|
|
1703
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#get-application-emoji}
|
|
1558
1704
|
*/
|
|
1559
1705
|
getApplicationEmoji: (emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
|
|
1560
1706
|
/**
|
|
@@ -1566,7 +1712,7 @@ export interface RestManager {
|
|
|
1566
1712
|
* @remarks
|
|
1567
1713
|
* Includes `user` fields if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
|
|
1568
1714
|
*
|
|
1569
|
-
* @see {@link https://discord.com/developers/
|
|
1715
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#list-guild-emojis}
|
|
1570
1716
|
*/
|
|
1571
1717
|
getEmojis: (guildId: BigString) => Promise<Camelize<DiscordEmoji>[]>;
|
|
1572
1718
|
/**
|
|
@@ -1577,7 +1723,7 @@ export interface RestManager {
|
|
|
1577
1723
|
* @remarks
|
|
1578
1724
|
* Always includes the `user` object for the team member that uploaded the emoji from the app's settings, or for the bot user if uploaded using the API.
|
|
1579
1725
|
*
|
|
1580
|
-
* @see {@link https://discord.com/developers/
|
|
1726
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#list-application-emojis}
|
|
1581
1727
|
*/
|
|
1582
1728
|
getApplicationEmojis: () => Promise<{
|
|
1583
1729
|
items: Camelize<DiscordEmoji>[];
|
|
@@ -1596,7 +1742,7 @@ export interface RestManager {
|
|
|
1596
1742
|
*
|
|
1597
1743
|
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1598
1744
|
*
|
|
1599
|
-
* @see {@link https://discord.com/developers/
|
|
1745
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#get-followup-message}
|
|
1600
1746
|
*/
|
|
1601
1747
|
getFollowupMessage: (token: string, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
1602
1748
|
/** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
|
|
@@ -1607,7 +1753,7 @@ export interface RestManager {
|
|
|
1607
1753
|
* @param commandId - The ID of the command to get.
|
|
1608
1754
|
* @returns An instance of {@link DiscordApplicationCommand}.
|
|
1609
1755
|
*
|
|
1610
|
-
* @see {@link https://discord.com/developers/
|
|
1756
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-global-application-command}
|
|
1611
1757
|
*/
|
|
1612
1758
|
getGlobalApplicationCommand: (commandId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1613
1759
|
/**
|
|
@@ -1616,7 +1762,7 @@ export interface RestManager {
|
|
|
1616
1762
|
* @param options - The parameters for the fetching of global application commands
|
|
1617
1763
|
* @returns A collection of {@link DiscordApplicationCommand} objects assorted by command ID.
|
|
1618
1764
|
*
|
|
1619
|
-
* @see {@link https://discord.com/developers/
|
|
1765
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-global-application-commands}
|
|
1620
1766
|
*/
|
|
1621
1767
|
getGlobalApplicationCommands: (options?: GetGlobalApplicationCommandsOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
|
|
1622
1768
|
/**
|
|
@@ -1626,7 +1772,7 @@ export interface RestManager {
|
|
|
1626
1772
|
* @param options - The parameters for the fetching of the guild.
|
|
1627
1773
|
* @returns An instance of {@link DiscordGuild}.
|
|
1628
1774
|
*
|
|
1629
|
-
* @see {@link https://discord.com/developers/
|
|
1775
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild}
|
|
1630
1776
|
*/
|
|
1631
1777
|
getGuild: (guildId: BigString, options?: {
|
|
1632
1778
|
counts?: boolean;
|
|
@@ -1641,7 +1787,7 @@ export interface RestManager {
|
|
|
1641
1787
|
* @remarks
|
|
1642
1788
|
* If used with an access token, the token needs to have the `guilds` scope
|
|
1643
1789
|
*
|
|
1644
|
-
* @see {@link https://discord.com/developers/
|
|
1790
|
+
* @see {@link https://docs.discord.com/developers/resources/user#get-current-user-guilds}
|
|
1645
1791
|
*/
|
|
1646
1792
|
getGuilds: (bearerToken?: string, options?: GetUserGuilds) => Promise<Partial<Camelize<DiscordGuild>>[]>;
|
|
1647
1793
|
/**
|
|
@@ -1651,7 +1797,7 @@ export interface RestManager {
|
|
|
1651
1797
|
* @param commandId - The ID of the command to get.
|
|
1652
1798
|
* @returns An instance of {@link DiscordApplicationCommand}.
|
|
1653
1799
|
*
|
|
1654
|
-
* @see {@link https://discord.com/developers/
|
|
1800
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-guild-application-command}
|
|
1655
1801
|
*/
|
|
1656
1802
|
getGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1657
1803
|
/**
|
|
@@ -1661,7 +1807,7 @@ export interface RestManager {
|
|
|
1661
1807
|
* @param options - The parameters for the fetching of guild application commands
|
|
1662
1808
|
* @returns A collection of {@link DiscordApplicationCommand} objects assorted by command ID.
|
|
1663
1809
|
*
|
|
1664
|
-
* @see {@link https://discord.com/developers/
|
|
1810
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-global-application-commandss}
|
|
1665
1811
|
*/
|
|
1666
1812
|
getGuildApplicationCommands: (guildId: BigString, options?: GetGuildApplicationCommandsOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
|
|
1667
1813
|
/**
|
|
@@ -1673,7 +1819,7 @@ export interface RestManager {
|
|
|
1673
1819
|
* @remarks
|
|
1674
1820
|
* If the bot user is not in the guild, the guild must be discoverable.
|
|
1675
1821
|
*
|
|
1676
|
-
* @see {@link https://discord.com/developers/
|
|
1822
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-preview}
|
|
1677
1823
|
*/
|
|
1678
1824
|
getGuildPreview: (guildId: BigString) => Promise<Camelize<DiscordGuildPreview>>;
|
|
1679
1825
|
/**
|
|
@@ -1685,7 +1831,7 @@ export interface RestManager {
|
|
|
1685
1831
|
*
|
|
1686
1832
|
* @remarks Includes the user field if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
|
|
1687
1833
|
*
|
|
1688
|
-
* @see {@link https://discord.com/developers/
|
|
1834
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#get-guild-sticker}
|
|
1689
1835
|
*/
|
|
1690
1836
|
getGuildSticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
|
|
1691
1837
|
/**
|
|
@@ -1696,7 +1842,7 @@ export interface RestManager {
|
|
|
1696
1842
|
*
|
|
1697
1843
|
* @remarks Includes user fields if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
|
|
1698
1844
|
*
|
|
1699
|
-
* @see {@link https://discord.com/developers/
|
|
1845
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#list-guild-stickers}
|
|
1700
1846
|
*/
|
|
1701
1847
|
getGuildStickers: (guildId: BigString) => Promise<Camelize<DiscordSticker>[]>;
|
|
1702
1848
|
/**
|
|
@@ -1708,7 +1854,7 @@ export interface RestManager {
|
|
|
1708
1854
|
* @remarks
|
|
1709
1855
|
* Requires the `MANAGE_GUILD` permission.
|
|
1710
1856
|
*
|
|
1711
|
-
* @see {@link https://discord.com/developers/
|
|
1857
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#get-guild-template}
|
|
1712
1858
|
*/
|
|
1713
1859
|
getGuildTemplate: (templateCode: string) => Promise<Camelize<DiscordTemplate>>;
|
|
1714
1860
|
/**
|
|
@@ -1720,7 +1866,7 @@ export interface RestManager {
|
|
|
1720
1866
|
* @remarks
|
|
1721
1867
|
* Requires the `MANAGE_GUILD` permission.
|
|
1722
1868
|
*
|
|
1723
|
-
* @see {@link https://discord.com/developers/
|
|
1869
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#get-guild-templates}
|
|
1724
1870
|
*/
|
|
1725
1871
|
getGuildTemplates: (guildId: BigString) => Promise<Camelize<DiscordTemplate>[]>;
|
|
1726
1872
|
/**
|
|
@@ -1732,7 +1878,7 @@ export interface RestManager {
|
|
|
1732
1878
|
* @remarks
|
|
1733
1879
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1734
1880
|
*
|
|
1735
|
-
* @see {@link https://discord.com/developers/
|
|
1881
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#get-guild-webhooks}
|
|
1736
1882
|
*/
|
|
1737
1883
|
getGuildWebhooks: (guildId: BigString) => Promise<Camelize<DiscordWebhook>[]>;
|
|
1738
1884
|
/**
|
|
@@ -1744,7 +1890,7 @@ export interface RestManager {
|
|
|
1744
1890
|
* @remarks
|
|
1745
1891
|
* Requires the `MANAGE_GUILD` permission.
|
|
1746
1892
|
*
|
|
1747
|
-
* @see {@link https://discord.com/developers/
|
|
1893
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-integrations}
|
|
1748
1894
|
*/
|
|
1749
1895
|
getIntegrations: (guildId: BigString) => Promise<Camelize<DiscordIntegration>[]>;
|
|
1750
1896
|
/**
|
|
@@ -1754,7 +1900,7 @@ export interface RestManager {
|
|
|
1754
1900
|
* @param options - The parameters for the fetching of the invite.
|
|
1755
1901
|
* @returns An instance of {@link DiscordInviteMetadata}.
|
|
1756
1902
|
*
|
|
1757
|
-
* @see {@link https://discord.com/developers/
|
|
1903
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-invite}
|
|
1758
1904
|
*/
|
|
1759
1905
|
getInvite: (inviteCode: string, options?: GetInvite) => Promise<Camelize<DiscordInviteMetadata>>;
|
|
1760
1906
|
/**
|
|
@@ -1764,9 +1910,9 @@ export interface RestManager {
|
|
|
1764
1910
|
* @returns A collection of {@link DiscordInviteMetadata} objects assorted by invite code.
|
|
1765
1911
|
*
|
|
1766
1912
|
* @remarks
|
|
1767
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
1913
|
+
* Requires the `MANAGE_GUILD` or `VIEW_AUDIT_LOG` permission.
|
|
1768
1914
|
*
|
|
1769
|
-
* @see {@link https://discord.com/developers/
|
|
1915
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-invites}
|
|
1770
1916
|
*/
|
|
1771
1917
|
getInvites: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata>[]>;
|
|
1772
1918
|
/**
|
|
@@ -1782,7 +1928,7 @@ export interface RestManager {
|
|
|
1782
1928
|
* If getting a message from a guild channel:
|
|
1783
1929
|
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1784
1930
|
*
|
|
1785
|
-
* @see {@link https://discord.com/developers/
|
|
1931
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-channel-message}
|
|
1786
1932
|
*/
|
|
1787
1933
|
getMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
1788
1934
|
/**
|
|
@@ -1798,15 +1944,24 @@ export interface RestManager {
|
|
|
1798
1944
|
* If getting a messages from a guild channel:
|
|
1799
1945
|
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1800
1946
|
*
|
|
1801
|
-
* @see {@link https://discord.com/developers/
|
|
1947
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-channel-messages}
|
|
1802
1948
|
*/
|
|
1803
1949
|
getMessages: (channelId: BigString, options?: GetMessagesOptions) => Promise<Camelize<DiscordMessage>[]>;
|
|
1950
|
+
/**
|
|
1951
|
+
* Search messages in a guild.
|
|
1952
|
+
*
|
|
1953
|
+
* @remarks
|
|
1954
|
+
* Requires `READ_MESSAGE_HISTORY` and is restricted by the `MESSAGE_CONTENT` intent.
|
|
1955
|
+
*
|
|
1956
|
+
* @see {@link https://docs.discord.com/developers/resources/message#search-guild-messages}
|
|
1957
|
+
*/
|
|
1958
|
+
searchGuildMessages: (guildId: BigString, options?: SearchGuildMessagesOptions) => Promise<Camelize<DiscordSearchGuildMessages | DiscordSearchGuildMessagesIndexing>>;
|
|
1804
1959
|
/**
|
|
1805
1960
|
* Returns a sticker pack for the given ID.
|
|
1806
1961
|
*
|
|
1807
1962
|
* @returns A {@link DiscordStickerPack} object.
|
|
1808
1963
|
*
|
|
1809
|
-
* @see {@link https://discord.com/developers/
|
|
1964
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#get-sticker-pack}
|
|
1810
1965
|
*/
|
|
1811
1966
|
getStickerPack: (stickerPackId: BigString) => Promise<Camelize<DiscordStickerPack>>;
|
|
1812
1967
|
/**
|
|
@@ -1814,7 +1969,7 @@ export interface RestManager {
|
|
|
1814
1969
|
*
|
|
1815
1970
|
* @returns A collection of {@link DiscordStickerPack} objects assorted by sticker ID.
|
|
1816
1971
|
*
|
|
1817
|
-
* @see {@link https://discord.com/developers/
|
|
1972
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#list-sticker-packs}
|
|
1818
1973
|
*/
|
|
1819
1974
|
getStickerPacks: () => Promise<Camelize<DiscordStickerPack>[]>;
|
|
1820
1975
|
/**
|
|
@@ -1830,7 +1985,7 @@ export interface RestManager {
|
|
|
1830
1985
|
*
|
|
1831
1986
|
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1832
1987
|
*
|
|
1833
|
-
* @see {@link https://discord.com/developers/
|
|
1988
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#get-original-interaction-response}
|
|
1834
1989
|
*/
|
|
1835
1990
|
getOriginalInteractionResponse: (token: string) => Promise<Camelize<DiscordMessage>>;
|
|
1836
1991
|
/**
|
|
@@ -1845,7 +2000,7 @@ export interface RestManager {
|
|
|
1845
2000
|
*
|
|
1846
2001
|
* If the user is missing the `READ_MESSAGE_HISTORY` permission in the channel, then no pins will be returned.
|
|
1847
2002
|
*
|
|
1848
|
-
* @see {@link https://discord.com/developers/
|
|
2003
|
+
* @see {@link https://docs.discord.com/developers/resources/message#get-channel-pins}
|
|
1849
2004
|
*/
|
|
1850
2005
|
getChannelPins: (channelId: BigString, options?: GetChannelPinsOptions) => Promise<Camelize<DiscordGetChannelPins>>;
|
|
1851
2006
|
/**
|
|
@@ -1860,7 +2015,7 @@ export interface RestManager {
|
|
|
1860
2015
|
* If getting a message from a guild channel:
|
|
1861
2016
|
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1862
2017
|
*
|
|
1863
|
-
* @see {@link https://discord.com/developers/
|
|
2018
|
+
* @see {@link https://docs.discord.com/developers/resources/message#get-pinned-messages-deprecated}
|
|
1864
2019
|
* @deprecated Use {@link getChannelPins} instead.
|
|
1865
2020
|
*/
|
|
1866
2021
|
getPinnedMessages: (channelId: BigString) => Promise<Camelize<DiscordMessage>[]>;
|
|
@@ -1879,7 +2034,7 @@ export interface RestManager {
|
|
|
1879
2034
|
*
|
|
1880
2035
|
* Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
|
|
1881
2036
|
*
|
|
1882
|
-
* @see {@link https://discord.com/developers/
|
|
2037
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#list-private-archived-threads}
|
|
1883
2038
|
*/
|
|
1884
2039
|
getPrivateArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordListArchivedThreads>>;
|
|
1885
2040
|
/**
|
|
@@ -1887,7 +2042,7 @@ export interface RestManager {
|
|
|
1887
2042
|
*
|
|
1888
2043
|
* @param channelId - The ID of the channel to get the archived threads for.
|
|
1889
2044
|
* @param options - The parameters for the fetching of threads.
|
|
1890
|
-
* @returns An instance of {@link
|
|
2045
|
+
* @returns An instance of {@link DiscordListArchivedThreads}.
|
|
1891
2046
|
*
|
|
1892
2047
|
* @remarks
|
|
1893
2048
|
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
@@ -1896,7 +2051,7 @@ export interface RestManager {
|
|
|
1896
2051
|
*
|
|
1897
2052
|
* Threads are ordered by the `id` property in descending order.
|
|
1898
2053
|
*
|
|
1899
|
-
* @see {@link https://discord.com/developers/
|
|
2054
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#list-joined-private-archived-threads}
|
|
1900
2055
|
*/
|
|
1901
2056
|
getPrivateJoinedArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordListArchivedThreads>>;
|
|
1902
2057
|
/**
|
|
@@ -1909,7 +2064,7 @@ export interface RestManager {
|
|
|
1909
2064
|
* @remarks
|
|
1910
2065
|
* Requires the `MANAGE_GUILD` and `KICK_MEMBERS` permissions.
|
|
1911
2066
|
*
|
|
1912
|
-
* @see {@link https://discord.com/developers/
|
|
2067
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-prune-count}
|
|
1913
2068
|
*/
|
|
1914
2069
|
getPruneCount: (guildId: BigString, options?: GetGuildPruneCountQuery) => Promise<Camelize<DiscordPrunedCount>>;
|
|
1915
2070
|
/**
|
|
@@ -1917,7 +2072,7 @@ export interface RestManager {
|
|
|
1917
2072
|
*
|
|
1918
2073
|
* @param channelId - The ID of the channel to get the archived threads for.
|
|
1919
2074
|
* @param options - The parameters for the fetching of threads.
|
|
1920
|
-
* @returns An instance of {@link
|
|
2075
|
+
* @returns An instance of {@link DiscordListArchivedThreads}.
|
|
1921
2076
|
*
|
|
1922
2077
|
* @remarks
|
|
1923
2078
|
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
@@ -1927,7 +2082,7 @@ export interface RestManager {
|
|
|
1927
2082
|
*
|
|
1928
2083
|
* Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
|
|
1929
2084
|
*
|
|
1930
|
-
* @see {@link https://discord.com/developers/
|
|
2085
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#list-public-archived-threads}
|
|
1931
2086
|
*/
|
|
1932
2087
|
getPublicArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordListArchivedThreads>>;
|
|
1933
2088
|
/**
|
|
@@ -1939,7 +2094,7 @@ export interface RestManager {
|
|
|
1939
2094
|
* @remarks
|
|
1940
2095
|
* ⚠️ This endpoint should be used sparingly due to {@link DiscordRole} objects already being included in guild payloads.
|
|
1941
2096
|
*
|
|
1942
|
-
* @see {@link https://discord.com/developers/
|
|
2097
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-roles}
|
|
1943
2098
|
*/
|
|
1944
2099
|
getRoles: (guildId: BigString) => Promise<Camelize<DiscordRole>[]>;
|
|
1945
2100
|
/**
|
|
@@ -1949,7 +2104,7 @@ export interface RestManager {
|
|
|
1949
2104
|
* @param roleId - The ID of the role.
|
|
1950
2105
|
* @returns A {@link DiscordRole} object.
|
|
1951
2106
|
*
|
|
1952
|
-
* @see {@link https://discord.com/developers/
|
|
2107
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role}
|
|
1953
2108
|
*/
|
|
1954
2109
|
getRole: (guildId: BigString, roleId: BigString) => Promise<Camelize<DiscordRole>>;
|
|
1955
2110
|
/**
|
|
@@ -1960,7 +2115,7 @@ export interface RestManager {
|
|
|
1960
2115
|
* @param options - The parameters for the fetching of the scheduled event.
|
|
1961
2116
|
* @returns An instance of {@link DiscordScheduledEvent}.
|
|
1962
2117
|
*
|
|
1963
|
-
* @see {@link https://discord.com/developers/
|
|
2118
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#get-guild-scheduled-event}
|
|
1964
2119
|
*/
|
|
1965
2120
|
getScheduledEvent: (guildId: BigString, eventId: BigString, options?: {
|
|
1966
2121
|
withUserCount?: boolean;
|
|
@@ -1972,7 +2127,7 @@ export interface RestManager {
|
|
|
1972
2127
|
* @param options - The parameters for the fetching of the scheduled events.
|
|
1973
2128
|
* @returns A collection of {@link DiscordScheduledEvent} objects assorted by event ID.
|
|
1974
2129
|
*
|
|
1975
|
-
* @see {@link https://discord.com/developers/
|
|
2130
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#list-scheduled-events-for-guild}
|
|
1976
2131
|
*/
|
|
1977
2132
|
getScheduledEvents: (guildId: BigString, options?: GetScheduledEvents) => Promise<Camelize<DiscordScheduledEvent>[]>;
|
|
1978
2133
|
/**
|
|
@@ -1988,7 +2143,7 @@ export interface RestManager {
|
|
|
1988
2143
|
*
|
|
1989
2144
|
* Users are ordered by their IDs in _ascending_ order.
|
|
1990
2145
|
*
|
|
1991
|
-
* @see {@link https://discord.com/developers/
|
|
2146
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#get-guild-scheduled-event-users}
|
|
1992
2147
|
*/
|
|
1993
2148
|
getScheduledEventUsers: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => Promise<Array<{
|
|
1994
2149
|
user: Camelize<DiscordUser>;
|
|
@@ -2002,7 +2157,7 @@ export interface RestManager {
|
|
|
2002
2157
|
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
2003
2158
|
* @returns An instance of {@link DiscordStageInstance}.
|
|
2004
2159
|
*
|
|
2005
|
-
* @see {@link https://discord.com/developers/
|
|
2160
|
+
* @see {@link https://docs.discord.com/developers/resources/stage-instance#get-stage-instance}
|
|
2006
2161
|
*/
|
|
2007
2162
|
getStageInstance: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
|
|
2008
2163
|
/**
|
|
@@ -2011,7 +2166,7 @@ export interface RestManager {
|
|
|
2011
2166
|
* @param guildId - The ID of the guild to get the voice state from.
|
|
2012
2167
|
* @returns An instance of {@link DiscordVoiceState}.
|
|
2013
2168
|
*
|
|
2014
|
-
* @see {@link https://discord.com/developers/
|
|
2169
|
+
* @see {@link https://docs.discord.com/developers/resources/voice#get-current-user-voice-state}
|
|
2015
2170
|
*/
|
|
2016
2171
|
getOwnVoiceState: (guildId: BigString) => Promise<Camelize<DiscordVoiceState>>;
|
|
2017
2172
|
/**
|
|
@@ -2021,7 +2176,10 @@ export interface RestManager {
|
|
|
2021
2176
|
* @param userId - The ID of the user to get the voice state from
|
|
2022
2177
|
* @returns An instance of {@link DiscordVoiceState}.
|
|
2023
2178
|
*
|
|
2024
|
-
* @
|
|
2179
|
+
* @remarks
|
|
2180
|
+
* If the specified user is connected to a voice channel, the current user must have permission to connect to the channel.
|
|
2181
|
+
*
|
|
2182
|
+
* @see {@link https://docs.discord.com/developers/resources/voice#get-user-voice-state}
|
|
2025
2183
|
*/
|
|
2026
2184
|
getUserVoiceState: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordVoiceState>>;
|
|
2027
2185
|
/**
|
|
@@ -2030,7 +2188,7 @@ export interface RestManager {
|
|
|
2030
2188
|
* @param stickerId The ID of the sticker to get
|
|
2031
2189
|
* @returns A {@link DiscordSticker}
|
|
2032
2190
|
*
|
|
2033
|
-
* @see {@link https://discord.com/developers/
|
|
2191
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#get-sticker}
|
|
2034
2192
|
*/
|
|
2035
2193
|
getSticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
|
|
2036
2194
|
/**
|
|
@@ -2041,7 +2199,7 @@ export interface RestManager {
|
|
|
2041
2199
|
* @param options - The parameters for the fetching of the thread member.
|
|
2042
2200
|
* @returns An instance of {@link DiscordThreadMember}.
|
|
2043
2201
|
*
|
|
2044
|
-
* @see {@link https://discord.com/developers/
|
|
2202
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-thread-member}
|
|
2045
2203
|
*/
|
|
2046
2204
|
getThreadMember: (channelId: BigString, userId: BigString, options?: GetThreadMember) => Promise<Camelize<DiscordThreadMember>>;
|
|
2047
2205
|
/**
|
|
@@ -2054,7 +2212,7 @@ export interface RestManager {
|
|
|
2054
2212
|
* @remarks
|
|
2055
2213
|
* Requires the application to have the `GUILD_MEMBERS` privileged intent enabled.
|
|
2056
2214
|
*
|
|
2057
|
-
* @see {@link https://discord.com/developers/
|
|
2215
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#list-thread-members}
|
|
2058
2216
|
*/
|
|
2059
2217
|
getThreadMembers: (channelId: BigString, options?: ListThreadMembers) => Promise<Camelize<DiscordThreadMember>[]>;
|
|
2060
2218
|
/**
|
|
@@ -2066,7 +2224,7 @@ export interface RestManager {
|
|
|
2066
2224
|
* @param options - The parameters for the fetching of the users.
|
|
2067
2225
|
* @returns A collection of {@link DiscordUser} objects assorted by user ID.
|
|
2068
2226
|
*
|
|
2069
|
-
* @see {@link https://discord.com/developers/
|
|
2227
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-reactions}
|
|
2070
2228
|
*/
|
|
2071
2229
|
getReactions: (channelId: BigString, messageId: BigString, reaction: string, options?: GetReactions) => Promise<Camelize<DiscordUser>[]>;
|
|
2072
2230
|
/**
|
|
@@ -2108,7 +2266,7 @@ export interface RestManager {
|
|
|
2108
2266
|
* @remarks
|
|
2109
2267
|
* The access token requires the `role_connections.write` scope.
|
|
2110
2268
|
*
|
|
2111
|
-
* @see {@link https://discord.com/developers/
|
|
2269
|
+
* @see {@link https://docs.discord.com/developers/resources/user#get-user-application-role-connection}
|
|
2112
2270
|
*/
|
|
2113
2271
|
getUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString) => Promise<Camelize<DiscordApplicationRoleConnection>>;
|
|
2114
2272
|
/**
|
|
@@ -2122,7 +2280,7 @@ export interface RestManager {
|
|
|
2122
2280
|
*
|
|
2123
2281
|
* The `code` property will be `null` if the guild does not have a set vanity url.
|
|
2124
2282
|
*
|
|
2125
|
-
* @see {@link https://discord.com/developers/
|
|
2283
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-vanity-url}
|
|
2126
2284
|
*/
|
|
2127
2285
|
getVanityUrl: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
|
|
2128
2286
|
/**
|
|
@@ -2131,7 +2289,7 @@ export interface RestManager {
|
|
|
2131
2289
|
* @param guildId - The ID of the guild to get the voice regions for.
|
|
2132
2290
|
* @returns A collection of {@link DiscordVoiceRegion} objects assorted by voice region ID.
|
|
2133
2291
|
*
|
|
2134
|
-
* @see {@link https://discord.com/developers/
|
|
2292
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-voice-regions}
|
|
2135
2293
|
*/
|
|
2136
2294
|
getVoiceRegions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion>[]>;
|
|
2137
2295
|
/**
|
|
@@ -2143,7 +2301,7 @@ export interface RestManager {
|
|
|
2143
2301
|
* @remarks
|
|
2144
2302
|
* Requires the `MANAGE_WEBHOOKS` permission unless the application making the request owns the webhook.
|
|
2145
2303
|
*
|
|
2146
|
-
* @see {@link https://discord.com/developers/
|
|
2304
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#get-webhook}
|
|
2147
2305
|
*/
|
|
2148
2306
|
getWebhook: (webhookId: BigString) => Promise<Camelize<DiscordWebhook>>;
|
|
2149
2307
|
/**
|
|
@@ -2155,7 +2313,7 @@ export interface RestManager {
|
|
|
2155
2313
|
* @param options - The parameters for the fetching of the message.
|
|
2156
2314
|
* @returns An instance of {@link DiscordMessage}.
|
|
2157
2315
|
*
|
|
2158
|
-
* @see {@link https://discord.com/developers/
|
|
2316
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#get-webhook-message}
|
|
2159
2317
|
*/
|
|
2160
2318
|
getWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: GetWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
2161
2319
|
/**
|
|
@@ -2165,7 +2323,7 @@ export interface RestManager {
|
|
|
2165
2323
|
* @param token - The webhook token, used to get the webhook.
|
|
2166
2324
|
* @returns An instance of {@link DiscordWebhook}.
|
|
2167
2325
|
*
|
|
2168
|
-
* @see {@link https://discord.com/developers/
|
|
2326
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#get-webhook-with-token}
|
|
2169
2327
|
*/
|
|
2170
2328
|
getWebhookWithToken: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
|
|
2171
2329
|
/**
|
|
@@ -2178,7 +2336,7 @@ export interface RestManager {
|
|
|
2178
2336
|
* If the welcome screen is not enabled:
|
|
2179
2337
|
* - Requires the `MANAGE_GUILD` permission.
|
|
2180
2338
|
*
|
|
2181
|
-
* @see {@link https://discord.com/developers/
|
|
2339
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-welcome-screen}
|
|
2182
2340
|
*/
|
|
2183
2341
|
getWelcomeScreen: (guildId: BigString) => Promise<Camelize<DiscordWelcomeScreen>>;
|
|
2184
2342
|
/**
|
|
@@ -2190,7 +2348,7 @@ export interface RestManager {
|
|
|
2190
2348
|
* @remarks
|
|
2191
2349
|
* Fires an `INVITE_CREATED` Gateway event when an invite channel is defined and a new `Invite` is generated.
|
|
2192
2350
|
*
|
|
2193
|
-
* @see {@link https://discord.com/developers/
|
|
2351
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-widget}
|
|
2194
2352
|
*/
|
|
2195
2353
|
getWidget: (guildId: BigString) => Promise<Camelize<DiscordGuildWidget>>;
|
|
2196
2354
|
/**
|
|
@@ -2202,7 +2360,7 @@ export interface RestManager {
|
|
|
2202
2360
|
* @remarks
|
|
2203
2361
|
* Requires the `MANAGE_GUILD` permission.
|
|
2204
2362
|
*
|
|
2205
|
-
* @see {@link https://discord.com/developers/
|
|
2363
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-widget-settings}
|
|
2206
2364
|
*/
|
|
2207
2365
|
getWidgetSettings: (guildId: BigString) => Promise<Camelize<DiscordGuildWidgetSettings>>;
|
|
2208
2366
|
/**
|
|
@@ -2215,7 +2373,7 @@ export interface RestManager {
|
|
|
2215
2373
|
*
|
|
2216
2374
|
* Fires a _Thread Members Update_ gateway event.
|
|
2217
2375
|
*
|
|
2218
|
-
* @see {@link https://discord.com/developers/
|
|
2376
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#join-thread}
|
|
2219
2377
|
*/
|
|
2220
2378
|
joinThread: (channelId: BigString) => Promise<void>;
|
|
2221
2379
|
/**
|
|
@@ -2226,7 +2384,7 @@ export interface RestManager {
|
|
|
2226
2384
|
* @remarks
|
|
2227
2385
|
* Fires a _Guild Delete_ event.
|
|
2228
2386
|
*
|
|
2229
|
-
* @see {@link https://discord.com/developers/
|
|
2387
|
+
* @see {@link https://docs.discord.com/developers/resources/user#leave-guild}
|
|
2230
2388
|
*/
|
|
2231
2389
|
leaveGuild: (guildId: BigString) => Promise<void>;
|
|
2232
2390
|
/**
|
|
@@ -2239,7 +2397,7 @@ export interface RestManager {
|
|
|
2239
2397
|
*
|
|
2240
2398
|
* Fires a _Thread Members Update_ gateway event.
|
|
2241
2399
|
*
|
|
2242
|
-
* @see {@link https://discord.com/developers/
|
|
2400
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#leave-thread}
|
|
2243
2401
|
*/
|
|
2244
2402
|
leaveThread: (channelId: BigString) => Promise<void>;
|
|
2245
2403
|
/**
|
|
@@ -2257,7 +2415,7 @@ export interface RestManager {
|
|
|
2257
2415
|
*
|
|
2258
2416
|
* Fires a _Message Create_ event in the guilds the subscribed channels are in.
|
|
2259
2417
|
*
|
|
2260
|
-
* @see {@link https://discord.com/developers/
|
|
2418
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#crosspost-message}
|
|
2261
2419
|
*/
|
|
2262
2420
|
publishMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
2263
2421
|
/**
|
|
@@ -2273,7 +2431,7 @@ export interface RestManager {
|
|
|
2273
2431
|
*
|
|
2274
2432
|
* Fires a _Guild Member Update_ gateway event.
|
|
2275
2433
|
*
|
|
2276
|
-
* @see {@link https://discord.com/developers/
|
|
2434
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#remove-guild-member-role}
|
|
2277
2435
|
*/
|
|
2278
2436
|
removeRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
|
|
2279
2437
|
/**
|
|
@@ -2290,7 +2448,7 @@ export interface RestManager {
|
|
|
2290
2448
|
*
|
|
2291
2449
|
* Fires a _Thread Members Update_ gateway event.
|
|
2292
2450
|
*
|
|
2293
|
-
* @see {@link https://discord.com/developers/
|
|
2451
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#remove-thread-member}
|
|
2294
2452
|
*/
|
|
2295
2453
|
removeThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
2296
2454
|
/**
|
|
@@ -2299,7 +2457,7 @@ export interface RestManager {
|
|
|
2299
2457
|
* @param channelId - The ID of the channel to remove the recipient user of.
|
|
2300
2458
|
* @param userId - The user ID of the user to remove.
|
|
2301
2459
|
*
|
|
2302
|
-
* @see {@link https://discord.com/developers/
|
|
2460
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#group-dm-remove-recipient}
|
|
2303
2461
|
*/
|
|
2304
2462
|
removeDmRecipient: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
2305
2463
|
/**
|
|
@@ -2326,7 +2484,7 @@ export interface RestManager {
|
|
|
2326
2484
|
*
|
|
2327
2485
|
* Fires a _Message Create_ gateway event.
|
|
2328
2486
|
*
|
|
2329
|
-
* @see {@link https://discord.com/developers/
|
|
2487
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#create-message}
|
|
2330
2488
|
*/
|
|
2331
2489
|
sendMessage: (channelId: BigString, options: CreateMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
2332
2490
|
/**
|
|
@@ -2350,7 +2508,7 @@ export interface RestManager {
|
|
|
2350
2508
|
*
|
|
2351
2509
|
* Fires a _Message Create_ event.
|
|
2352
2510
|
*
|
|
2353
|
-
* @see {@link https://discord.com/developers/
|
|
2511
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#create-followup-message}
|
|
2354
2512
|
*/
|
|
2355
2513
|
sendFollowupMessage: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
|
|
2356
2514
|
/**
|
|
@@ -2373,7 +2531,7 @@ export interface RestManager {
|
|
|
2373
2531
|
*
|
|
2374
2532
|
* Fires a _Message Create_ event.
|
|
2375
2533
|
*
|
|
2376
|
-
* @see {@link https://discord.com/developers/
|
|
2534
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#create-interaction-response}
|
|
2377
2535
|
*/
|
|
2378
2536
|
sendInteractionResponse: (interactionId: BigString, token: string, options: InteractionResponse, params?: InteractionCallbackOptions) => Promise<void | Camelize<DiscordInteractionCallbackResponse>>;
|
|
2379
2537
|
/**
|
|
@@ -2394,7 +2552,7 @@ export interface RestManager {
|
|
|
2394
2552
|
*
|
|
2395
2553
|
* Fires a _Thread Create_ gateway event.
|
|
2396
2554
|
*
|
|
2397
|
-
* @see {@link https://discord.com/developers/
|
|
2555
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message}
|
|
2398
2556
|
*/
|
|
2399
2557
|
startThreadWithMessage: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage, reason?: string) => Promise<Camelize<DiscordChannel>>;
|
|
2400
2558
|
/**
|
|
@@ -2410,7 +2568,7 @@ export interface RestManager {
|
|
|
2410
2568
|
*
|
|
2411
2569
|
* Fires a _Thread Create_ gateway event.
|
|
2412
2570
|
*
|
|
2413
|
-
* @see {@link https://discord.com/developers/
|
|
2571
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message}
|
|
2414
2572
|
*/
|
|
2415
2573
|
startThreadWithoutMessage: (channelId: BigString, options: StartThreadWithoutMessage, reason?: string) => Promise<Camelize<DiscordChannel>>;
|
|
2416
2574
|
/**
|
|
@@ -2447,7 +2605,7 @@ export interface RestManager {
|
|
|
2447
2605
|
*
|
|
2448
2606
|
* Fires a _Guild Update_ gateway event.
|
|
2449
2607
|
*
|
|
2450
|
-
* @see {@link https://discord.com/developers/
|
|
2608
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#get-guild-templates}
|
|
2451
2609
|
*/
|
|
2452
2610
|
syncGuildTemplate: (guildId: BigString) => Promise<Camelize<DiscordTemplate>>;
|
|
2453
2611
|
/**
|
|
@@ -2462,7 +2620,7 @@ export interface RestManager {
|
|
|
2462
2620
|
*
|
|
2463
2621
|
* Fires a _Typing Start_ gateway event.
|
|
2464
2622
|
*
|
|
2465
|
-
* @see {@link https://discord.com/developers/
|
|
2623
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#trigger-typing-indicator}
|
|
2466
2624
|
*/
|
|
2467
2625
|
triggerTypingIndicator: (channelId: BigString) => Promise<void>;
|
|
2468
2626
|
/**
|
|
@@ -2480,7 +2638,7 @@ export interface RestManager {
|
|
|
2480
2638
|
* When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
|
|
2481
2639
|
* You will be able to update only your own application commands
|
|
2482
2640
|
*
|
|
2483
|
-
* @see {@link https://discord.com/developers/
|
|
2641
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#bulk-overwrite-global-application-commands}
|
|
2484
2642
|
*/
|
|
2485
2643
|
upsertGlobalApplicationCommands: (commands: CreateApplicationCommand[], options?: UpsertGlobalApplicationCommandOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
|
|
2486
2644
|
/**
|
|
@@ -2499,7 +2657,7 @@ export interface RestManager {
|
|
|
2499
2657
|
* When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
|
|
2500
2658
|
* You will be able to update only your own application commands
|
|
2501
2659
|
*
|
|
2502
|
-
* @see {@link https://discord.com/developers/
|
|
2660
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#bulk-overwrite-guild-application-commands}
|
|
2503
2661
|
*/
|
|
2504
2662
|
upsertGuildApplicationCommands: (guildId: BigString, commands: CreateApplicationCommand[], options?: UpsertGuildApplicationCommandOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
|
|
2505
2663
|
/**
|
|
@@ -2515,7 +2673,7 @@ export interface RestManager {
|
|
|
2515
2673
|
*
|
|
2516
2674
|
* Fires a _Guild Ban Add_ gateway event.
|
|
2517
2675
|
*
|
|
2518
|
-
* @see {@link https://discord.com/developers/
|
|
2676
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#create-guild-ban}
|
|
2519
2677
|
*/
|
|
2520
2678
|
banMember: (guildId: BigString, userId: BigString, options?: CreateGuildBan, reason?: string) => Promise<void>;
|
|
2521
2679
|
/**
|
|
@@ -2532,7 +2690,7 @@ export interface RestManager {
|
|
|
2532
2690
|
*
|
|
2533
2691
|
* Fires as many _Guild Ban Add_ gateway events as many user where banned.
|
|
2534
2692
|
*
|
|
2535
|
-
* @see {@link https://discord.com/developers/
|
|
2693
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#bulk-guild-ban}
|
|
2536
2694
|
*/
|
|
2537
2695
|
bulkBanMembers: (guildId: BigString, options: CreateGuildBulkBan, reason?: string) => Promise<Camelize<DiscordBulkBan>>;
|
|
2538
2696
|
/**
|
|
@@ -2546,9 +2704,9 @@ export interface RestManager {
|
|
|
2546
2704
|
* @remarks
|
|
2547
2705
|
* Fires a _Guild Member Update_ gateway event.
|
|
2548
2706
|
*
|
|
2549
|
-
* @see {@link https://discord.com/developers/
|
|
2707
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-current-member}
|
|
2550
2708
|
*/
|
|
2551
|
-
|
|
2709
|
+
editCurrentMember: (guildId: BigString, options: ModifyCurrentMember, reason?: string) => Promise<Camelize<DiscordMember>>;
|
|
2552
2710
|
/**
|
|
2553
2711
|
* Edits a member's properties.
|
|
2554
2712
|
*
|
|
@@ -2563,20 +2721,9 @@ export interface RestManager {
|
|
|
2563
2721
|
*
|
|
2564
2722
|
* Fires a _Guild Member Update_ gateway event.
|
|
2565
2723
|
*
|
|
2566
|
-
* @see {@link https://discord.com/developers/
|
|
2724
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-member}
|
|
2567
2725
|
*/
|
|
2568
2726
|
editMember: (guildId: BigString, userId: BigString, options: ModifyGuildMember, reason?: string) => Promise<Camelize<DiscordMember>>;
|
|
2569
|
-
/**
|
|
2570
|
-
* Gets the member object by user ID.
|
|
2571
|
-
*
|
|
2572
|
-
|
|
2573
|
-
* @param guildId - The ID of the guild to get the member object for.
|
|
2574
|
-
* @param userId - The ID of the user to get the member object for.
|
|
2575
|
-
* @returns An instance of {@link DiscordMemberWithUser}.
|
|
2576
|
-
*
|
|
2577
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
|
|
2578
|
-
*/
|
|
2579
|
-
getMember: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordMemberWithUser>>;
|
|
2580
2727
|
/**
|
|
2581
2728
|
* Gets the current member object.
|
|
2582
2729
|
*
|
|
@@ -2587,9 +2734,20 @@ export interface RestManager {
|
|
|
2587
2734
|
* @remarks
|
|
2588
2735
|
* The access tokens needs the `guilds.members.read` scope
|
|
2589
2736
|
*
|
|
2590
|
-
* @see {@link https://discord.com/developers/
|
|
2737
|
+
* @see {@link https://docs.discord.com/developers/resources/user#get-current-user-guild-member}
|
|
2591
2738
|
*/
|
|
2592
2739
|
getCurrentMember: (guildId: BigString, bearerToken: string) => Promise<Camelize<DiscordMemberWithUser>>;
|
|
2740
|
+
/**
|
|
2741
|
+
* Gets the member object by user ID.
|
|
2742
|
+
*
|
|
2743
|
+
|
|
2744
|
+
* @param guildId - The ID of the guild to get the member object for.
|
|
2745
|
+
* @param userId - The ID of the user to get the member object for.
|
|
2746
|
+
* @returns An instance of {@link DiscordMemberWithUser}.
|
|
2747
|
+
*
|
|
2748
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-member}
|
|
2749
|
+
*/
|
|
2750
|
+
getMember: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordMemberWithUser>>;
|
|
2593
2751
|
/**
|
|
2594
2752
|
* Gets the list of members for a guild.
|
|
2595
2753
|
*
|
|
@@ -2602,11 +2760,11 @@ export interface RestManager {
|
|
|
2602
2760
|
*
|
|
2603
2761
|
* ⚠️ It is not recommended to use this endpoint with very large bots. Instead, opt to use `fetchMembers()`:
|
|
2604
2762
|
* REST communication only permits 50 requests to be made per second, while gateways allow for up to 120 requests
|
|
2605
|
-
* per minute per shard. For more information, read {@link https://discord.com/developers/
|
|
2763
|
+
* per minute per shard. For more information, read {@link https://docs.discord.com/developers/topics/rate-limits#rate-limits}.
|
|
2606
2764
|
*
|
|
2607
|
-
* @see {@link https://discord.com/developers/
|
|
2608
|
-
* @see {@link https://discord.com/developers/
|
|
2609
|
-
* @see {@link https://discord.com/developers/
|
|
2765
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#list-guild-members}
|
|
2766
|
+
* @see {@link https://docs.discord.com/developers/events/gateway-events#request-guild-members}
|
|
2767
|
+
* @see {@link https://docs.discord.com/developers/topics/rate-limits#rate-limits}
|
|
2610
2768
|
*/
|
|
2611
2769
|
getMembers: (guildId: BigString, options: ListGuildMembers) => Promise<Camelize<DiscordMemberWithUser>[]>;
|
|
2612
2770
|
/**
|
|
@@ -2629,7 +2787,7 @@ export interface RestManager {
|
|
|
2629
2787
|
*
|
|
2630
2788
|
* Fires a _Guild Member Remove_ gateway event.
|
|
2631
2789
|
*
|
|
2632
|
-
* @see {@link https://discord.com/developers/
|
|
2790
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#remove-guild-member}
|
|
2633
2791
|
*/
|
|
2634
2792
|
kickMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
|
|
2635
2793
|
/**
|
|
@@ -2640,11 +2798,11 @@ export interface RestManager {
|
|
|
2640
2798
|
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2641
2799
|
*
|
|
2642
2800
|
* @remarks
|
|
2643
|
-
* Requires the `
|
|
2801
|
+
* Requires the `PIN_MESSAGES` permission.
|
|
2644
2802
|
*
|
|
2645
2803
|
* Fires a _Channel Pins Update_ event.
|
|
2646
2804
|
*
|
|
2647
|
-
* @see {@link https://discord.com/developers/
|
|
2805
|
+
* @see {@link https://docs.discord.com/developers/resources/message#pin-message}
|
|
2648
2806
|
*/
|
|
2649
2807
|
pinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
2650
2808
|
/**
|
|
@@ -2665,7 +2823,7 @@ export interface RestManager {
|
|
|
2665
2823
|
*
|
|
2666
2824
|
* Fires a _Guild Member Remove_ gateway event for every member kicked.
|
|
2667
2825
|
*
|
|
2668
|
-
* @see {@link https://discord.com/developers/
|
|
2826
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#begin-guild-prune}
|
|
2669
2827
|
*/
|
|
2670
2828
|
pruneMembers: (guildId: BigString, options: BeginGuildPrune, reason?: string) => Promise<{
|
|
2671
2829
|
pruned: number | null;
|
|
@@ -2679,7 +2837,7 @@ export interface RestManager {
|
|
|
2679
2837
|
* @param options - The parameters for searching through the members.
|
|
2680
2838
|
* @returns A collection of {@link DiscordMember} objects assorted by user ID.
|
|
2681
2839
|
*
|
|
2682
|
-
* @see {@link https://discord.com/developers/
|
|
2840
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#search-guild-members}
|
|
2683
2841
|
*/
|
|
2684
2842
|
searchMembers: (guildId: BigString, query: string, options?: Omit<SearchMembers, 'query'>) => Promise<Camelize<DiscordMemberWithUser>[]>;
|
|
2685
2843
|
/**
|
|
@@ -2695,7 +2853,7 @@ export interface RestManager {
|
|
|
2695
2853
|
*
|
|
2696
2854
|
* Fires a _Guild Ban Remove_ gateway event.
|
|
2697
2855
|
*
|
|
2698
|
-
* @see {@link https://discord.com/developers/
|
|
2856
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#remove-guild-ban}
|
|
2699
2857
|
*/
|
|
2700
2858
|
unbanMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
|
|
2701
2859
|
/**
|
|
@@ -2706,11 +2864,11 @@ export interface RestManager {
|
|
|
2706
2864
|
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2707
2865
|
*
|
|
2708
2866
|
* @remarks
|
|
2709
|
-
* Requires the `
|
|
2867
|
+
* Requires the `PIN_MESSAGES` permission.
|
|
2710
2868
|
*
|
|
2711
2869
|
* Fires a _Channel Pins Update_ event.
|
|
2712
2870
|
*
|
|
2713
|
-
* @see {@link https://discord.com/developers/
|
|
2871
|
+
* @see {@link https://docs.discord.com/developers/resources/message#unpin-message}
|
|
2714
2872
|
*/
|
|
2715
2873
|
unpinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
2716
2874
|
/**
|
|
@@ -2904,6 +3062,18 @@ export interface RestManager {
|
|
|
2904
3062
|
* @returns The created lobby
|
|
2905
3063
|
*/
|
|
2906
3064
|
createLobby: (options: CreateLobby) => Promise<Camelize<DiscordLobby>>;
|
|
3065
|
+
/**
|
|
3066
|
+
* Creates a new lobby for the application identified by a `secret`, or joins the calling user to the existing lobby with that secret if one already exists.
|
|
3067
|
+
*
|
|
3068
|
+
* Updates lobby metadata and the calling member's metadata on join.
|
|
3069
|
+
*
|
|
3070
|
+
* @param options - The options to create or join the lobby
|
|
3071
|
+
* @returns - The created or joined lobby
|
|
3072
|
+
*
|
|
3073
|
+
* @remarks
|
|
3074
|
+
* Uses `Bearer` token for authorization with the `sdk.social_layer` scope.
|
|
3075
|
+
*/
|
|
3076
|
+
createOrJoinLobby: (options: CreateOrJoinLobby) => Promise<Camelize<DiscordLobby>>;
|
|
2907
3077
|
/**
|
|
2908
3078
|
* Returns a lobby object for the specified lobby id, if it exists.
|
|
2909
3079
|
*
|
|
@@ -2937,6 +3107,22 @@ export interface RestManager {
|
|
|
2937
3107
|
* @returns The lobby member object
|
|
2938
3108
|
*/
|
|
2939
3109
|
addMemberToLobby: (lobbyId: BigString, userId: BigString, options: AddLobbyMember) => Promise<Camelize<DiscordLobbyMember>>;
|
|
3110
|
+
/**
|
|
3111
|
+
* Adds, updates, or removes up to 25 members from the specified lobby in a single request.
|
|
3112
|
+
*
|
|
3113
|
+
* @param lobbyId - The ID of the lobby to add, update, or remove members from
|
|
3114
|
+
* @param options - The options to add, update, or remove members from the lobby
|
|
3115
|
+
* @returns Returns an array of lobby member objects for the upserted members. Removed members are not included in the response.
|
|
3116
|
+
*
|
|
3117
|
+
* @remarks
|
|
3118
|
+
* Members with `remove_member: false` (the default) are upserted — added if not present, or updated with the provided metadata and flags if already a member. Members with `remove_member: true` are removed.
|
|
3119
|
+
*
|
|
3120
|
+
* Users unknown to Discord will return a 404 UNKNOWN_USER error.
|
|
3121
|
+
* Users that fail permission checks or who have already reached the maximum number of lobbies per application (and are not already a member of this lobby) are silently dropped from the upsert set.
|
|
3122
|
+
*
|
|
3123
|
+
* @see {@link https://docs.discord.com/developers/resources/lobby#bulk-update-lobby-members}
|
|
3124
|
+
*/
|
|
3125
|
+
bulkUpdateLobbyMembers: (lobbyId: BigString, options: BulkUpdateLobbyMember[]) => Promise<Camelize<DiscordLobbyMember>[]>;
|
|
2940
3126
|
/**
|
|
2941
3127
|
* Removes the provided user from the specified lobby. It is safe to call this even if the user is no longer a member of the lobby, but will fail if the lobby does not exist.
|
|
2942
3128
|
*
|
|
@@ -2979,6 +3165,77 @@ export interface RestManager {
|
|
|
2979
3165
|
* Uses bearer token for authorization and the user must be a lobby member with the CanLinkLobby lobby member flag.
|
|
2980
3166
|
*/
|
|
2981
3167
|
unlinkChannelToLobby: (lobbyId: BigString, bearerToken: string) => Promise<Camelize<DiscordLobby>>;
|
|
3168
|
+
/**
|
|
3169
|
+
* Sets the moderation metadata for a lobby message. The metadata is app-scoped and delivered to active game clients via the Social SDK as a realtime message update.
|
|
3170
|
+
*
|
|
3171
|
+
* @param lobbyId - The ID of the lobby to set the moderation metadata
|
|
3172
|
+
* @param messageId - The ID of the message to set the moderation metadata
|
|
3173
|
+
* @param options - The moderation metadata to set
|
|
3174
|
+
*
|
|
3175
|
+
* @remarks
|
|
3176
|
+
* Uses `Bot` token for authorization.
|
|
3177
|
+
*
|
|
3178
|
+
* For the options: Free-form key–value pairs describing the moderation decision. Up to 5 keys; key length <= 1024 characters; value length <= 2000 characters
|
|
3179
|
+
*
|
|
3180
|
+
* @see {@link https://discord.com/developers/docs/game-sdk/social-sdk/chat-moderation#server-side-chat-moderation} for the full moderation flow.
|
|
3181
|
+
*/
|
|
3182
|
+
updateLobbyMessageModerationMetadata: (lobbyId: BigString, messageId: BigString, options: Record<string, string>) => Promise<void>;
|
|
3183
|
+
/**
|
|
3184
|
+
* Sends a message to the specified lobby. The calling user must be a member of the lobby.
|
|
3185
|
+
*
|
|
3186
|
+
* @param bearerToken - The access token of the user
|
|
3187
|
+
* @param lobbyId - The ID of the lobby to send the message to
|
|
3188
|
+
* @param options - The options to send the message
|
|
3189
|
+
* @returns Returns the created lobby message object.
|
|
3190
|
+
*
|
|
3191
|
+
* @remarks
|
|
3192
|
+
* Uses `Bearer` token for authorization with the `sdk.social_layer` scope.
|
|
3193
|
+
*
|
|
3194
|
+
* If the lobby has a linked channel, the message is also forwarded to that channel.
|
|
3195
|
+
* If forwarding fails (for example, due to AutoMod), the lobby message is still delivered to other lobby members.
|
|
3196
|
+
*/
|
|
3197
|
+
sendLobbyMessage: (bearerToken: string, lobbyId: BigString, options: SendLobbyMessage) => Promise<Camelize<DiscordLobbyMessage>>;
|
|
3198
|
+
/**
|
|
3199
|
+
* Returns the most recent messages in the specified lobby. The calling user must be a member of the lobby.
|
|
3200
|
+
*
|
|
3201
|
+
* @param bearerToken - The access token of the user
|
|
3202
|
+
* @param lobbyId - The ID of the lobby to get the messages from
|
|
3203
|
+
* @param options - The options to get the messages
|
|
3204
|
+
* @returns Returns an array of lobby message objects
|
|
3205
|
+
*
|
|
3206
|
+
* @remarks
|
|
3207
|
+
* Uses `Bearer` token for authorization with the `sdk.social_layer` scope.
|
|
3208
|
+
*/
|
|
3209
|
+
getLobbyMessages: (bearerToken: string, lobbyId: BigString, options?: GetLobbyMessages) => Promise<Camelize<DiscordLobbyMessage>[]>;
|
|
3210
|
+
/**
|
|
3211
|
+
* Creates a single-use guild invite to the lobby's linked channel, targeted at the calling user.
|
|
3212
|
+
*
|
|
3213
|
+
*
|
|
3214
|
+
* @param bearerToken - The access token of the user
|
|
3215
|
+
* @param lobbyId - The ID of the lobby to create the invite for
|
|
3216
|
+
* @returns The created invite object
|
|
3217
|
+
*
|
|
3218
|
+
* @remarks
|
|
3219
|
+
* Uses `Bearer` token for authorization with the `sdk.social_layer` scope.
|
|
3220
|
+
*
|
|
3221
|
+
* The lobby must have a linked channel and the caller must be a member of the lobby.
|
|
3222
|
+
* The invite expires after one hour.
|
|
3223
|
+
*/
|
|
3224
|
+
createLobbyChannelInviteForSelf: (bearerToken: string, lobbyId: BigString) => Promise<Camelize<DiscordLobbyInvite>>;
|
|
3225
|
+
/**
|
|
3226
|
+
* Creates a single-use guild invite to the lobby's linked channel on behalf of an application, targeted at the specified user.
|
|
3227
|
+
*
|
|
3228
|
+
* @param lobbyId - The ID of the lobby to create the invite for
|
|
3229
|
+
* @param userId - The ID of the user to create the invite for
|
|
3230
|
+
* @returns The created invite object
|
|
3231
|
+
*
|
|
3232
|
+
* @remarks
|
|
3233
|
+
* Uses `Bot` token for authorization
|
|
3234
|
+
*
|
|
3235
|
+
* The lobby must have a linked channel.
|
|
3236
|
+
* The invite expires after one hour.
|
|
3237
|
+
*/
|
|
3238
|
+
createLobbyChannelInviteForUser: (lobbyId: BigString, userId: BigString) => Promise<Camelize<DiscordLobbyInvite>>;
|
|
2982
3239
|
}
|
|
2983
3240
|
export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
|
|
2984
3241
|
export type ApiVersions = 9 | 10;
|
|
@@ -2988,6 +3245,17 @@ export interface CreateRequestBodyOptions {
|
|
|
2988
3245
|
unauthorized?: boolean;
|
|
2989
3246
|
reason?: string;
|
|
2990
3247
|
files?: FileContent[];
|
|
3248
|
+
/**
|
|
3249
|
+
* An `AbortSignal` to cancel the request.
|
|
3250
|
+
*
|
|
3251
|
+
* @remarks
|
|
3252
|
+
* Aborting rejects a request that is still waiting in the queue right away and guarantees it is never sent.
|
|
3253
|
+
* An attempt that is already in flight gets its connection cancelled as well, though that cannot recall it:
|
|
3254
|
+
* Discord (or the proxy) may have received it and may still process it, only the response is discarded.
|
|
3255
|
+
* This lets a rest proxy drop requests that nobody is waiting on anymore (client disconnect, deadline)
|
|
3256
|
+
* instead of leaving them in the queue.
|
|
3257
|
+
*/
|
|
3258
|
+
signal?: AbortSignal;
|
|
2991
3259
|
}
|
|
2992
3260
|
export type MakeRequestOptions = Omit<CreateRequestBodyOptions, 'method'> & Pick<SendRequestOptions, 'runThroughQueue'>;
|
|
2993
3261
|
export interface RequestBody {
|
|
@@ -3037,6 +3305,7 @@ export interface RestRequestRejection {
|
|
|
3037
3305
|
/** The returned body parsed if it was JSON, otherwise it will be the raw body as a string */
|
|
3038
3306
|
body?: string | object;
|
|
3039
3307
|
error?: string;
|
|
3308
|
+
errorObject?: Error;
|
|
3040
3309
|
}
|
|
3041
3310
|
export interface RestManagerEvents {
|
|
3042
3311
|
/**
|