@discordeno/rest 22.0.1-next.f2e8d7e → 22.0.1-next.f4e424f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +279 -82
- package/dist/queue.d.ts +2 -2
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +32 -4
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +34 -2
- package/dist/types.d.ts +415 -195
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/typings/routes.d.ts +13 -1
- package/dist/typings/routes.d.ts.map +1 -1
- package/dist/typings/routes.js +1 -1
- package/package.json +16 -17
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, DiscordTargetUsersJobStatus, 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,7 +464,7 @@ 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>>;
|
|
399
470
|
/**
|
|
@@ -403,7 +474,7 @@ export interface RestManager {
|
|
|
403
474
|
*
|
|
404
475
|
* @param guildId - The ID of the guild to get role member counts for.
|
|
405
476
|
*
|
|
406
|
-
* @see {@link https://discord.com/developers/
|
|
477
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role-member-counts}
|
|
407
478
|
*/
|
|
408
479
|
getGuildRoleMemberCounts: (guildId: BigString) => Promise<Record<string, number>>;
|
|
409
480
|
/**
|
|
@@ -419,7 +490,7 @@ export interface RestManager {
|
|
|
419
490
|
*
|
|
420
491
|
* Fires a _Guild Role Create_ gateway event.
|
|
421
492
|
*
|
|
422
|
-
* @see {@link https://discord.com/developers/
|
|
493
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#create-guild-role}
|
|
423
494
|
*/
|
|
424
495
|
createRole: (guildId: BigString, options: CreateGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
|
|
425
496
|
/**
|
|
@@ -437,7 +508,7 @@ export interface RestManager {
|
|
|
437
508
|
*
|
|
438
509
|
* Fires a _Guild Scheduled Event Create_ gateway event.
|
|
439
510
|
*
|
|
440
|
-
* @see {@link https://discord.com/developers/
|
|
511
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#create-guild-scheduled-event}
|
|
441
512
|
*/
|
|
442
513
|
createScheduledEvent: (guildId: BigString, options: CreateScheduledEvent, reason?: string) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
443
514
|
/**
|
|
@@ -452,7 +523,7 @@ export interface RestManager {
|
|
|
452
523
|
*
|
|
453
524
|
* Fires a _Stage Instance Create_ gateway event.
|
|
454
525
|
*
|
|
455
|
-
* @see {@link https://discord.com/developers/
|
|
526
|
+
* @see {@link https://docs.discord.com/developers/resources/stage-instance#create-stage-instance}
|
|
456
527
|
*/
|
|
457
528
|
createStageInstance: (options: CreateStageInstance, reason?: string) => Promise<Camelize<DiscordStageInstance>>;
|
|
458
529
|
/**
|
|
@@ -470,7 +541,7 @@ export interface RestManager {
|
|
|
470
541
|
*
|
|
471
542
|
* Fires a _Webhooks Update_ gateway event.
|
|
472
543
|
*
|
|
473
|
-
* @see {@link https://discord.com/developers/
|
|
544
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#create-webhook}
|
|
474
545
|
*/
|
|
475
546
|
createWebhook: (channelId: BigString, options: CreateWebhook, reason?: string) => Promise<Camelize<DiscordWebhook>>;
|
|
476
547
|
/**
|
|
@@ -485,7 +556,7 @@ export interface RestManager {
|
|
|
485
556
|
*
|
|
486
557
|
* Fires an _Auto Moderation Rule Delete_ gateway event.
|
|
487
558
|
*
|
|
488
|
-
* @see {@link https://discord.com/developers/
|
|
559
|
+
* @see {@link https://docs.discord.com/developers/resources/auto-moderation#delete-auto-moderation-rule}
|
|
489
560
|
*/
|
|
490
561
|
deleteAutomodRule: (guildId: BigString, ruleId: BigString, reason?: string) => Promise<void>;
|
|
491
562
|
/**
|
|
@@ -511,7 +582,7 @@ export interface RestManager {
|
|
|
511
582
|
*
|
|
512
583
|
* - Fires a _Channel Delete_ gateway event.
|
|
513
584
|
*
|
|
514
|
-
* @see {@link https://discord.com/developers/
|
|
585
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#deleteclose-channel}
|
|
515
586
|
*/
|
|
516
587
|
deleteChannel: (channelId: BigString, reason?: string) => Promise<void>;
|
|
517
588
|
/**
|
|
@@ -526,7 +597,7 @@ export interface RestManager {
|
|
|
526
597
|
*
|
|
527
598
|
* Fires a _Channel Update_ gateway event.
|
|
528
599
|
*
|
|
529
|
-
* @see {@link https://discord.com/developers/
|
|
600
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-channel-permission}
|
|
530
601
|
*/
|
|
531
602
|
deleteChannelPermissionOverride: (channelId: BigString, overwriteId: BigString, reason?: string) => Promise<void>;
|
|
532
603
|
/**
|
|
@@ -542,7 +613,7 @@ export interface RestManager {
|
|
|
542
613
|
*
|
|
543
614
|
* Fires a _Guild Emojis Update_ gateway event.
|
|
544
615
|
*
|
|
545
|
-
* @see {@link https://discord.com/developers/
|
|
616
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#delete-guild-emoji}
|
|
546
617
|
*/
|
|
547
618
|
deleteEmoji: (guildId: BigString, id: BigString, reason?: string) => Promise<void>;
|
|
548
619
|
/**
|
|
@@ -550,7 +621,7 @@ export interface RestManager {
|
|
|
550
621
|
*
|
|
551
622
|
* @param id - The ID of the emoji to delete.
|
|
552
623
|
*
|
|
553
|
-
* @see {@link https://discord.com/developers/
|
|
624
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#delete-application-emoji}
|
|
554
625
|
*/
|
|
555
626
|
deleteApplicationEmoji: (id: BigString) => Promise<void>;
|
|
556
627
|
/**
|
|
@@ -564,7 +635,7 @@ export interface RestManager {
|
|
|
564
635
|
*
|
|
565
636
|
* Fires a _Message Delete_ event.
|
|
566
637
|
*
|
|
567
|
-
* @see {@link https://discord.com/developers/
|
|
638
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#delete-followup-message}
|
|
568
639
|
*/
|
|
569
640
|
deleteFollowupMessage: (token: string, messageId: BigString) => Promise<void>;
|
|
570
641
|
/**
|
|
@@ -572,7 +643,7 @@ export interface RestManager {
|
|
|
572
643
|
*
|
|
573
644
|
* @param commandId - The ID of the command to delete.
|
|
574
645
|
*
|
|
575
|
-
* @see {@link https://discord.com/developers/
|
|
646
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#delete-global-application-command}
|
|
576
647
|
*/
|
|
577
648
|
deleteGlobalApplicationCommand: (commandId: BigString) => Promise<void>;
|
|
578
649
|
/**
|
|
@@ -581,7 +652,7 @@ export interface RestManager {
|
|
|
581
652
|
* @param guildId - The ID of the guild to delete the command from.
|
|
582
653
|
* @param commandId - The ID of the command to delete from the guild.
|
|
583
654
|
*
|
|
584
|
-
* @see {@link https://discord.com/developers/
|
|
655
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#delete-guild-application-command}
|
|
585
656
|
*/
|
|
586
657
|
deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<void>;
|
|
587
658
|
/**
|
|
@@ -598,7 +669,7 @@ export interface RestManager {
|
|
|
598
669
|
* Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
|
|
599
670
|
* Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
|
|
600
671
|
*
|
|
601
|
-
* @see {@link https://discord.com/developers/
|
|
672
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#delete-guild-sticker}
|
|
602
673
|
*/
|
|
603
674
|
deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
|
|
604
675
|
/**
|
|
@@ -612,7 +683,7 @@ export interface RestManager {
|
|
|
612
683
|
*
|
|
613
684
|
* Fires a _Guild Update_ gateway event.
|
|
614
685
|
*
|
|
615
|
-
* @see {@link https://discord.com/developers/
|
|
686
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#delete-guild-template}
|
|
616
687
|
*/
|
|
617
688
|
deleteGuildTemplate: (guildId: BigString, templateCode: string) => Promise<void>;
|
|
618
689
|
/**
|
|
@@ -630,7 +701,7 @@ export interface RestManager {
|
|
|
630
701
|
* Fires a _Guild Integrations Update_ gateway event.
|
|
631
702
|
* Fires a _Integration Delete_ gateway event.
|
|
632
703
|
*
|
|
633
|
-
* @see {@link https://discord.com/developers/
|
|
704
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#delete-guild-integration}
|
|
634
705
|
*/
|
|
635
706
|
deleteIntegration: (guildId: BigString, integrationId: BigString, reason?: string) => Promise<void>;
|
|
636
707
|
/**
|
|
@@ -644,19 +715,19 @@ export interface RestManager {
|
|
|
644
715
|
*
|
|
645
716
|
* Fires an _Invite Delete_ gateway event.
|
|
646
717
|
*
|
|
647
|
-
* @see {@link https://discord.com/developers/
|
|
718
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-channel-invite}
|
|
648
719
|
*/
|
|
649
720
|
deleteInvite: (inviteCode: string, reason?: string) => Promise<void>;
|
|
650
721
|
/**
|
|
651
722
|
* Gets the users allowed to see and accept this invite.
|
|
652
723
|
*
|
|
653
724
|
* @param inviteCode - The invite code of the invite to update.
|
|
654
|
-
* @returns CSV file with
|
|
725
|
+
* @returns CSV file containing the user IDs with the header `user_id` and each user ID from the original file
|
|
655
726
|
*
|
|
656
727
|
* @remarks
|
|
657
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
728
|
+
* Requires called to be the inviter, or have `MANAGE_GUILD` permission, or have `VIEW_AUDIT_LOG` permission.
|
|
658
729
|
*
|
|
659
|
-
* @see {@link https://discord.com/developers/
|
|
730
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-target-users}
|
|
660
731
|
*/
|
|
661
732
|
getTargetUsers: (inviteCode: string) => Promise<string>;
|
|
662
733
|
/**
|
|
@@ -666,11 +737,11 @@ export interface RestManager {
|
|
|
666
737
|
* @param targetUsersFile - A CSV file with a single column of user IDs for all the users able to accept this invite
|
|
667
738
|
*
|
|
668
739
|
* @remarks
|
|
669
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
740
|
+
* Requires the caller to be the inviter or have the `MANAGE_GUILD` permission.
|
|
670
741
|
*
|
|
671
742
|
* Uploading a file with invalid user IDs will result in a 400 with the invalid IDs described.
|
|
672
743
|
*
|
|
673
|
-
* @see {@link https://discord.com/developers/
|
|
744
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#update-target-users}
|
|
674
745
|
*/
|
|
675
746
|
updateTargetUsers: (inviteCode: string, targetUsersFile: Blob) => Promise<void>;
|
|
676
747
|
/**
|
|
@@ -680,9 +751,9 @@ export interface RestManager {
|
|
|
680
751
|
* @returns An object containing the status of the target users job.
|
|
681
752
|
*
|
|
682
753
|
* @remarks
|
|
683
|
-
* Requires the `MANAGE_GUILD` permission.
|
|
754
|
+
* Requires the caller to be the inviter, or have `MANAGE_GUILD` permission, or have `VIEW_AUDIT_LOG` permission.
|
|
684
755
|
*
|
|
685
|
-
* @see {@link https://discord.com/developers/
|
|
756
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-target-users-job-status}
|
|
686
757
|
*/
|
|
687
758
|
getTargetUsersJobStatus: (inviteCode: string) => Promise<Camelize<DiscordTargetUsersJobStatus>>;
|
|
688
759
|
/**
|
|
@@ -698,7 +769,7 @@ export interface RestManager {
|
|
|
698
769
|
*
|
|
699
770
|
* Fires a _Message Delete_ gateway event.
|
|
700
771
|
*
|
|
701
|
-
* @see {@link https://discord.com/developers/
|
|
772
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-message}
|
|
702
773
|
*/
|
|
703
774
|
deleteMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
704
775
|
/**
|
|
@@ -715,7 +786,7 @@ export interface RestManager {
|
|
|
715
786
|
*
|
|
716
787
|
* Fires a _Message Delete Bulk_ gateway event.
|
|
717
788
|
*
|
|
718
|
-
* @see {@link https://discord.com/developers/
|
|
789
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#bulk-delete-messages}
|
|
719
790
|
*/
|
|
720
791
|
deleteMessages: (channelId: BigString, messageIds: BigString[], reason?: string) => Promise<void>;
|
|
721
792
|
/**
|
|
@@ -728,7 +799,7 @@ export interface RestManager {
|
|
|
728
799
|
*
|
|
729
800
|
* Fires a _Message Delete_ event.
|
|
730
801
|
*
|
|
731
|
-
* @see {@link https://discord.com/developers/
|
|
802
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#delete-original-interaction-response}
|
|
732
803
|
*/
|
|
733
804
|
deleteOriginalInteractionResponse: (token: string) => Promise<void>;
|
|
734
805
|
/**
|
|
@@ -743,7 +814,7 @@ export interface RestManager {
|
|
|
743
814
|
*
|
|
744
815
|
* Fires a _Message Reaction Remove_ gateway event.
|
|
745
816
|
*
|
|
746
|
-
* @see {@link https://discord.com/developers/
|
|
817
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-own-reaction}
|
|
747
818
|
*/
|
|
748
819
|
deleteOwnReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
|
|
749
820
|
/**
|
|
@@ -759,7 +830,7 @@ export interface RestManager {
|
|
|
759
830
|
*
|
|
760
831
|
* Fires a _Message Reaction Remove All_ gateway event.
|
|
761
832
|
*
|
|
762
|
-
* @see {@link https://discord.com/developers/
|
|
833
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-all-reactions}
|
|
763
834
|
*/
|
|
764
835
|
deleteReactionsAll: (channelId: BigString, messageId: BigString) => Promise<void>;
|
|
765
836
|
/**
|
|
@@ -776,7 +847,7 @@ export interface RestManager {
|
|
|
776
847
|
*
|
|
777
848
|
* Fires a _Message Reaction Remove Emoji_ gateway event.
|
|
778
849
|
*
|
|
779
|
-
* @see {@link https://discord.com/developers/
|
|
850
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-all-reactions-for-emoji}
|
|
780
851
|
*/
|
|
781
852
|
deleteReactionsEmoji: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
|
|
782
853
|
/**
|
|
@@ -791,7 +862,7 @@ export interface RestManager {
|
|
|
791
862
|
*
|
|
792
863
|
* Fires a _Guild Role Delete_ gateway event.
|
|
793
864
|
*
|
|
794
|
-
* @see {@link https://discord.com/developers/
|
|
865
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#delete-guild-role}
|
|
795
866
|
*/
|
|
796
867
|
deleteRole: (guildId: BigString, roleId: BigString, reason?: string) => Promise<void>;
|
|
797
868
|
/**
|
|
@@ -805,7 +876,7 @@ export interface RestManager {
|
|
|
805
876
|
*
|
|
806
877
|
* Fires a _Guild Scheduled Event Delete_ gateway event.
|
|
807
878
|
*
|
|
808
|
-
* @see {@link https://discord.com/developers/
|
|
879
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#delete-guild-scheduled-event}
|
|
809
880
|
*/
|
|
810
881
|
deleteScheduledEvent: (guildId: BigString, eventId: BigString) => Promise<void>;
|
|
811
882
|
/**
|
|
@@ -819,7 +890,7 @@ export interface RestManager {
|
|
|
819
890
|
*
|
|
820
891
|
* Fires a _Stage Instance Delete_ gateway event.
|
|
821
892
|
*
|
|
822
|
-
* @see {@link https://discord.com/developers/
|
|
893
|
+
* @see {@link https://docs.discord.com/developers/resources/stage-instance#delete-stage-instance}
|
|
823
894
|
*/
|
|
824
895
|
deleteStageInstance: (channelId: BigString, reason?: string) => Promise<void>;
|
|
825
896
|
/**
|
|
@@ -837,7 +908,7 @@ export interface RestManager {
|
|
|
837
908
|
*
|
|
838
909
|
* Fires a _Message Reaction Remove_ gateway event.
|
|
839
910
|
*
|
|
840
|
-
* @see {@link https://discord.com/developers/
|
|
911
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#delete-user-reaction}
|
|
841
912
|
*/
|
|
842
913
|
deleteUserReaction: (channelId: BigString, messageId: BigString, userId: BigString, reaction: string) => Promise<void>;
|
|
843
914
|
/**
|
|
@@ -850,7 +921,7 @@ export interface RestManager {
|
|
|
850
921
|
*
|
|
851
922
|
* Fires a _Webhooks Update_ gateway event.
|
|
852
923
|
*
|
|
853
|
-
* @see {@link https://discord.com/developers/
|
|
924
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#delete-webhook}
|
|
854
925
|
*/
|
|
855
926
|
deleteWebhook: (webhookId: BigString, reason?: string) => Promise<void>;
|
|
856
927
|
/**
|
|
@@ -864,7 +935,7 @@ export interface RestManager {
|
|
|
864
935
|
* @remarks
|
|
865
936
|
* Fires a _Message Delete_ gateway event.
|
|
866
937
|
*
|
|
867
|
-
* @see {@link https://discord.com/developers/
|
|
938
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#delete-webhook}
|
|
868
939
|
*/
|
|
869
940
|
deleteWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: DeleteWebhookMessageOptions) => Promise<void>;
|
|
870
941
|
/**
|
|
@@ -876,7 +947,7 @@ export interface RestManager {
|
|
|
876
947
|
* @remarks
|
|
877
948
|
* Fires a _Message Delete_ gateway event.
|
|
878
949
|
*
|
|
879
|
-
* @see {@link https://discord.com/developers/
|
|
950
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#delete-webhook-with-token}
|
|
880
951
|
*/
|
|
881
952
|
deleteWebhookWithToken: (webhookId: BigString, token: string) => Promise<void>;
|
|
882
953
|
/**
|
|
@@ -891,7 +962,7 @@ export interface RestManager {
|
|
|
891
962
|
* @remarks
|
|
892
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.
|
|
893
964
|
*
|
|
894
|
-
* @see {@link https://discord.com/developers/
|
|
965
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#edit-application-command-permissions}
|
|
895
966
|
*/
|
|
896
967
|
editApplicationCommandPermissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: Camelize<DiscordApplicationCommandPermissions>[]) => Promise<Camelize<DiscordGuildApplicationCommandPermissions>>;
|
|
897
968
|
/**
|
|
@@ -908,17 +979,26 @@ export interface RestManager {
|
|
|
908
979
|
*
|
|
909
980
|
* Fires an _Auto Moderation Rule Update_ gateway event.
|
|
910
981
|
*
|
|
911
|
-
* @see {@link https://discord.com/developers/
|
|
982
|
+
* @see {@link https://docs.discord.com/developers/resources/auto-moderation#modify-auto-moderation-rule}
|
|
912
983
|
*/
|
|
913
984
|
editAutomodRule: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions>, reason?: string) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
914
985
|
/**
|
|
915
986
|
* Modifies the bot's username, avatar or banner.
|
|
916
|
-
*
|
|
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}
|
|
917
997
|
*/
|
|
918
998
|
editBotProfile: (options: {
|
|
919
999
|
username?: string;
|
|
920
|
-
|
|
921
|
-
|
|
1000
|
+
avatar?: string | null;
|
|
1001
|
+
banner?: string | null;
|
|
922
1002
|
}) => Promise<Camelize<DiscordUser>>;
|
|
923
1003
|
/**
|
|
924
1004
|
* Edits a channel's settings.
|
|
@@ -965,7 +1045,7 @@ export interface RestManager {
|
|
|
965
1045
|
*
|
|
966
1046
|
* Fires a _Channel Update_ gateway event.
|
|
967
1047
|
*
|
|
968
|
-
* @see {@link https://discord.com/developers/
|
|
1048
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#edit-channel-permissions}
|
|
969
1049
|
*/
|
|
970
1050
|
editChannelPermissionOverrides: (channelId: BigString, options: EditChannelPermissionOverridesOptions, reason?: string) => Promise<void>;
|
|
971
1051
|
/**
|
|
@@ -979,7 +1059,13 @@ export interface RestManager {
|
|
|
979
1059
|
*
|
|
980
1060
|
* Fires a _Channel Update_ gateway event for every channel impacted in this change.
|
|
981
1061
|
*
|
|
982
|
-
*
|
|
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}
|
|
983
1069
|
*/
|
|
984
1070
|
editChannelPositions: (guildId: BigString, channelPositions: ModifyGuildChannelPositions[]) => Promise<void>;
|
|
985
1071
|
/**
|
|
@@ -997,7 +1083,7 @@ export interface RestManager {
|
|
|
997
1083
|
*
|
|
998
1084
|
* Fires a `Guild Emojis Update` gateway event.
|
|
999
1085
|
*
|
|
1000
|
-
* @see {@link https://discord.com/developers/
|
|
1086
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#modify-guild-emoji}
|
|
1001
1087
|
*/
|
|
1002
1088
|
editEmoji: (guildId: BigString, id: BigString, options: ModifyGuildEmoji, reason?: string) => Promise<Camelize<DiscordEmoji>>;
|
|
1003
1089
|
/**
|
|
@@ -1007,7 +1093,7 @@ export interface RestManager {
|
|
|
1007
1093
|
* @param options - The parameters for the edit of the emoji.
|
|
1008
1094
|
* @returns An instance of the updated {@link DiscordEmoji}.
|
|
1009
1095
|
*
|
|
1010
|
-
* @see {@link https://discord.com/developers/
|
|
1096
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#modify-application-emoji}
|
|
1011
1097
|
*/
|
|
1012
1098
|
editApplicationEmoji: (id: BigString, options: ModifyApplicationEmoji) => Promise<Camelize<DiscordEmoji>>;
|
|
1013
1099
|
/**
|
|
@@ -1025,7 +1111,7 @@ export interface RestManager {
|
|
|
1025
1111
|
*
|
|
1026
1112
|
* Fires a _Message Update_ event.
|
|
1027
1113
|
*
|
|
1028
|
-
* @see {@link https://discord.com/developers/
|
|
1114
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#edit-followup-message}
|
|
1029
1115
|
*/
|
|
1030
1116
|
editFollowupMessage: (token: string, messageId: BigString, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
|
|
1031
1117
|
/**
|
|
@@ -1035,7 +1121,7 @@ export interface RestManager {
|
|
|
1035
1121
|
* @param options - The parameters for the edit of the command.
|
|
1036
1122
|
* @returns An instance of the edited {@link DiscordApplicationCommand}.
|
|
1037
1123
|
*
|
|
1038
|
-
* @see {@link https://discord.com/developers/
|
|
1124
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#edit-global-application-command}
|
|
1039
1125
|
*/
|
|
1040
1126
|
editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1041
1127
|
/**
|
|
@@ -1054,7 +1140,7 @@ export interface RestManager {
|
|
|
1054
1140
|
*
|
|
1055
1141
|
* Fires a _Guild Update_ gateway event.
|
|
1056
1142
|
*
|
|
1057
|
-
* @see {@link https://discord.com/developers/
|
|
1143
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild}
|
|
1058
1144
|
*/
|
|
1059
1145
|
editGuild: (guildId: BigString, options: ModifyGuild, reason?: string) => Promise<Camelize<DiscordGuild>>;
|
|
1060
1146
|
/**
|
|
@@ -1065,7 +1151,7 @@ export interface RestManager {
|
|
|
1065
1151
|
* @param options - The parameters for the edit of the command.
|
|
1066
1152
|
* @returns An instance of the edited {@link DiscordApplicationCommand}.
|
|
1067
1153
|
*
|
|
1068
|
-
* @see {@link https://discord.com/developers/
|
|
1154
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#edit-guild-application-command}
|
|
1069
1155
|
*/
|
|
1070
1156
|
editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1071
1157
|
/**
|
|
@@ -1080,7 +1166,7 @@ export interface RestManager {
|
|
|
1080
1166
|
* For other stickers, requires the `MANAGE_GUILD_EXPRESSIONS` permission.
|
|
1081
1167
|
* Fires a Guild Stickers Update Gateway event.
|
|
1082
1168
|
*
|
|
1083
|
-
* @see {@link https://discord.com/developers/
|
|
1169
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#modify-guild-sticker}
|
|
1084
1170
|
*/
|
|
1085
1171
|
editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>, reason?: string) => Promise<Camelize<DiscordSticker>>;
|
|
1086
1172
|
/**
|
|
@@ -1096,7 +1182,7 @@ export interface RestManager {
|
|
|
1096
1182
|
*
|
|
1097
1183
|
* Fires a _Guild Update_ gateway event.
|
|
1098
1184
|
*
|
|
1099
|
-
* @see {@link https://discord.com/developers/
|
|
1185
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#modify-guild-template}
|
|
1100
1186
|
*/
|
|
1101
1187
|
editGuildTemplate: (guildId: BigString, templateCode: string, options: ModifyGuildTemplate) => Promise<Camelize<DiscordTemplate>>;
|
|
1102
1188
|
/**
|
|
@@ -1114,7 +1200,7 @@ export interface RestManager {
|
|
|
1114
1200
|
*
|
|
1115
1201
|
* Fires a _Message Update_ gateway event.
|
|
1116
1202
|
*
|
|
1117
|
-
* @see {@link https://discord.com/developers/
|
|
1203
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#edit-message}
|
|
1118
1204
|
*/
|
|
1119
1205
|
editMessage: (channelId: BigString, messageId: BigString, options: EditMessage) => Promise<Camelize<DiscordMessage>>;
|
|
1120
1206
|
/**
|
|
@@ -1131,7 +1217,7 @@ export interface RestManager {
|
|
|
1131
1217
|
*
|
|
1132
1218
|
* Fires a _Message Update_ event.
|
|
1133
1219
|
*
|
|
1134
|
-
* @see {@link https://discord.com/developers/
|
|
1220
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#edit-original-interaction-response}
|
|
1135
1221
|
*/
|
|
1136
1222
|
editOriginalInteractionResponse: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
|
|
1137
1223
|
/**
|
|
@@ -1149,7 +1235,7 @@ export interface RestManager {
|
|
|
1149
1235
|
* If attempting to request to speak:
|
|
1150
1236
|
* - Requires the `REQUEST_TO_SPEAK` permission.
|
|
1151
1237
|
*
|
|
1152
|
-
* @see {@link https://discord.com/developers/
|
|
1238
|
+
* @see {@link https://docs.discord.com/developers/resources/voice#modify-current-user-voice-state}
|
|
1153
1239
|
*/
|
|
1154
1240
|
editOwnVoiceState: (guildId: BigString, options: EditOwnVoiceState) => Promise<void>;
|
|
1155
1241
|
/**
|
|
@@ -1166,7 +1252,7 @@ export interface RestManager {
|
|
|
1166
1252
|
*
|
|
1167
1253
|
* Fires a _Guild Role Update_ gateway event.
|
|
1168
1254
|
*
|
|
1169
|
-
* @see {@link https://discord.com/developers/
|
|
1255
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-role}
|
|
1170
1256
|
*/
|
|
1171
1257
|
editRole: (guildId: BigString, roleId: BigString, options: EditGuildRole, reason?: string) => Promise<Camelize<DiscordRole>>;
|
|
1172
1258
|
/**
|
|
@@ -1182,7 +1268,7 @@ export interface RestManager {
|
|
|
1182
1268
|
*
|
|
1183
1269
|
* Fires a _Guild Role Update_ gateway event for every role impacted in this change.
|
|
1184
1270
|
*
|
|
1185
|
-
* @see {@link https://discord.com/developers/
|
|
1271
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-role-positions}
|
|
1186
1272
|
*/
|
|
1187
1273
|
editRolePositions: (guildId: BigString, options: ModifyRolePositions[], reason?: string) => Promise<Camelize<DiscordRole>[]>;
|
|
1188
1274
|
/**
|
|
@@ -1202,7 +1288,7 @@ export interface RestManager {
|
|
|
1202
1288
|
*
|
|
1203
1289
|
* Fires a _Guild Scheduled Event Update_ gateway event.
|
|
1204
1290
|
*
|
|
1205
|
-
* @see {@link https://discord.com/developers/
|
|
1291
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
|
1206
1292
|
*/
|
|
1207
1293
|
editScheduledEvent: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent>, reason?: string) => Promise<Camelize<DiscordScheduledEvent>>;
|
|
1208
1294
|
/**
|
|
@@ -1218,7 +1304,7 @@ export interface RestManager {
|
|
|
1218
1304
|
*
|
|
1219
1305
|
* Fires a _Stage Instance Update_ event.
|
|
1220
1306
|
*
|
|
1221
|
-
* @see {@link https://discord.com/developers/
|
|
1307
|
+
* @see {@link https://docs.discord.com/developers/resources/stage-instance#modify-stage-instance}
|
|
1222
1308
|
*/
|
|
1223
1309
|
editStageInstance: (channelId: BigString, topic: string, reason?: string) => Promise<Camelize<DiscordStageInstance>>;
|
|
1224
1310
|
/**
|
|
@@ -1232,7 +1318,7 @@ export interface RestManager {
|
|
|
1232
1318
|
*
|
|
1233
1319
|
* Requires the `MUTE_MEMBERS` permission.
|
|
1234
1320
|
*
|
|
1235
|
-
* @see {@link https://discord.com/developers/
|
|
1321
|
+
* @see {@link https://docs.discord.com/developers/resources/voice#modify-user-voice-state}
|
|
1236
1322
|
*/
|
|
1237
1323
|
editUserVoiceState: (guildId: BigString, options: EditUserVoiceState) => Promise<void>;
|
|
1238
1324
|
/**
|
|
@@ -1246,9 +1332,21 @@ export interface RestManager {
|
|
|
1246
1332
|
* @remarks
|
|
1247
1333
|
* This requires the `role_connections.write` scope.
|
|
1248
1334
|
*
|
|
1249
|
-
* @see {@link https://discord.com/developers/
|
|
1335
|
+
* @see {@link https://docs.discord.com/developers/resources/user#update-user-application-role-connection}
|
|
1250
1336
|
*/
|
|
1251
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>;
|
|
1252
1350
|
/**
|
|
1253
1351
|
* Edits a webhook.
|
|
1254
1352
|
*
|
|
@@ -1261,7 +1359,7 @@ export interface RestManager {
|
|
|
1261
1359
|
*
|
|
1262
1360
|
* Fires a _Webhooks Update_ gateway event.
|
|
1263
1361
|
*
|
|
1264
|
-
* @see {@link https://discord.com/developers/
|
|
1362
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#edit-webhook}
|
|
1265
1363
|
*/
|
|
1266
1364
|
editWebhook: (webhookId: BigString, options: ModifyWebhook, reason?: string) => Promise<Camelize<DiscordWebhook>>;
|
|
1267
1365
|
/**
|
|
@@ -1276,7 +1374,7 @@ export interface RestManager {
|
|
|
1276
1374
|
* @remarks
|
|
1277
1375
|
* Fires a _Message Update_ gateway event.
|
|
1278
1376
|
*
|
|
1279
|
-
* @see {@link https://discord.com/developers/
|
|
1377
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#edit-webhook-message}
|
|
1280
1378
|
*/
|
|
1281
1379
|
editWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options: EditWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
1282
1380
|
/**
|
|
@@ -1291,7 +1389,7 @@ export interface RestManager {
|
|
|
1291
1389
|
*
|
|
1292
1390
|
* Fires a _Webhooks Update_ gateway event.
|
|
1293
1391
|
*
|
|
1294
|
-
* @see {@link https://discord.com/developers/
|
|
1392
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#modify-webhook-with-token}
|
|
1295
1393
|
*/
|
|
1296
1394
|
editWebhookWithToken: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<Camelize<DiscordWebhook>>;
|
|
1297
1395
|
/**
|
|
@@ -1307,7 +1405,7 @@ export interface RestManager {
|
|
|
1307
1405
|
*
|
|
1308
1406
|
* Fires a _Guild Update_ gateway event.
|
|
1309
1407
|
*
|
|
1310
|
-
* @see {@link https://discord.com/developers/
|
|
1408
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-welcome-screen}
|
|
1311
1409
|
*/
|
|
1312
1410
|
editWelcomeScreen: (guildId: BigString, options: ModifyGuildWelcomeScreen, reason?: string) => Promise<Camelize<DiscordWelcomeScreen>>;
|
|
1313
1411
|
/**
|
|
@@ -1322,7 +1420,7 @@ export interface RestManager {
|
|
|
1322
1420
|
*
|
|
1323
1421
|
* Fires a _Guild Update_ gateway event.
|
|
1324
1422
|
*
|
|
1325
|
-
* @see {@link https://discord.com/developers/
|
|
1423
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-widget}
|
|
1326
1424
|
*/
|
|
1327
1425
|
editWidgetSettings: (guildId: BigString, options: Camelize<DiscordGuildWidgetSettings>, reason?: string) => Promise<Camelize<DiscordGuildWidgetSettings>>;
|
|
1328
1426
|
/**
|
|
@@ -1336,7 +1434,7 @@ export interface RestManager {
|
|
|
1336
1434
|
* @remarks
|
|
1337
1435
|
* If the webhook channel is a forum channel, you must provide a value for either `threadId` or `threadName`.
|
|
1338
1436
|
*
|
|
1339
|
-
* @see {@link https://discord.com/developers/
|
|
1437
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#execute-webhook}
|
|
1340
1438
|
*/
|
|
1341
1439
|
executeWebhook: (webhookId: BigString, token: string, options: ExecuteWebhook) => Promise<Camelize<DiscordMessage> | undefined>;
|
|
1342
1440
|
/**
|
|
@@ -1352,7 +1450,7 @@ export interface RestManager {
|
|
|
1352
1450
|
*
|
|
1353
1451
|
* Fires a _Webhooks Update_ gateway event.
|
|
1354
1452
|
*
|
|
1355
|
-
* @see {@link https://discord.com/developers/
|
|
1453
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#follow-announcement-channel}
|
|
1356
1454
|
*/
|
|
1357
1455
|
followAnnouncement: (sourceChannelId: BigString, targetChannelId: BigString, reason?: string) => Promise<Camelize<DiscordFollowedChannel>>;
|
|
1358
1456
|
/**
|
|
@@ -1366,7 +1464,7 @@ export interface RestManager {
|
|
|
1366
1464
|
*
|
|
1367
1465
|
* Threads are ordered by the `id` property in descending order.
|
|
1368
1466
|
*
|
|
1369
|
-
* @see {@link https://discord.com/developers/
|
|
1467
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#list-active-guild-threads}
|
|
1370
1468
|
*/
|
|
1371
1469
|
getActiveThreads: (guildId: BigString) => Promise<Camelize<DiscordListActiveThreads>>;
|
|
1372
1470
|
/** Get the applications info */
|
|
@@ -1416,7 +1514,7 @@ export interface RestManager {
|
|
|
1416
1514
|
* @remarks
|
|
1417
1515
|
* Then specifying the options object the access token passed-in requires the OAuth2 scope `applications.commands.permissions.update`
|
|
1418
1516
|
*
|
|
1419
|
-
* @see {@link https://discord.com/developers/
|
|
1517
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-application-command-permissions}
|
|
1420
1518
|
*/
|
|
1421
1519
|
getApplicationCommandPermission: (guildId: BigString, commandId: BigString, options?: GetApplicationCommandPermissionOptions) => Promise<Camelize<DiscordGuildApplicationCommandPermissions>>;
|
|
1422
1520
|
/**
|
|
@@ -1429,7 +1527,7 @@ export interface RestManager {
|
|
|
1429
1527
|
* @remarks
|
|
1430
1528
|
* Then specifying the options object the access token passed-in requires the OAuth2 scope `applications.commands.permissions.update`
|
|
1431
1529
|
*
|
|
1432
|
-
* @see {@link https://discord.com/developers/
|
|
1530
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-guild-application-command-permissions}
|
|
1433
1531
|
*/
|
|
1434
1532
|
getApplicationCommandPermissions: (guildId: BigString, options?: GetApplicationCommandPermissionOptions) => Promise<Camelize<DiscordGuildApplicationCommandPermissions>[]>;
|
|
1435
1533
|
/**
|
|
@@ -1442,7 +1540,7 @@ export interface RestManager {
|
|
|
1442
1540
|
* @remarks
|
|
1443
1541
|
* Requires the `VIEW_AUDIT_LOG` permission.
|
|
1444
1542
|
*
|
|
1445
|
-
* @see {@link https://discord.com/developers/
|
|
1543
|
+
* @see {@link https://docs.discord.com/developers/resources/audit-log#get-guild-audit-log}
|
|
1446
1544
|
*/
|
|
1447
1545
|
getAuditLog: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
|
|
1448
1546
|
/**
|
|
@@ -1455,7 +1553,7 @@ export interface RestManager {
|
|
|
1455
1553
|
* @remarks
|
|
1456
1554
|
* Requires the `MANAGE_GUILD` permission.
|
|
1457
1555
|
*
|
|
1458
|
-
* @see {@link https://discord.com/developers/
|
|
1556
|
+
* @see {@link https://docs.discord.com/developers/resources/auto-moderation#get-auto-moderation-rule}
|
|
1459
1557
|
*/
|
|
1460
1558
|
getAutomodRule: (guildId: BigString, ruleId: BigString) => Promise<Camelize<DiscordAutoModerationRule>>;
|
|
1461
1559
|
/**
|
|
@@ -1467,7 +1565,7 @@ export interface RestManager {
|
|
|
1467
1565
|
* @remarks
|
|
1468
1566
|
* Requires the `MANAGE_GUILD` permission.
|
|
1469
1567
|
*
|
|
1470
|
-
* @see {@link https://discord.com/developers/
|
|
1568
|
+
* @see {@link https://docs.discord.com/developers/resources/auto-moderation#list-auto-moderation-rules-for-guild}
|
|
1471
1569
|
*/
|
|
1472
1570
|
getAutomodRules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule>[]>;
|
|
1473
1571
|
/**
|
|
@@ -1486,7 +1584,7 @@ export interface RestManager {
|
|
|
1486
1584
|
* @remarks
|
|
1487
1585
|
* Requires the `BAN_MEMBERS` permission.
|
|
1488
1586
|
*
|
|
1489
|
-
* @see {@link https://discord.com/developers/
|
|
1587
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-ban}
|
|
1490
1588
|
*/
|
|
1491
1589
|
getBan: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
|
|
1492
1590
|
/**
|
|
@@ -1501,7 +1599,7 @@ export interface RestManager {
|
|
|
1501
1599
|
*
|
|
1502
1600
|
* Users are ordered by their IDs in _ascending_ order.
|
|
1503
1601
|
*
|
|
1504
|
-
* @see {@link https://discord.com/developers/
|
|
1602
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-bans}
|
|
1505
1603
|
*/
|
|
1506
1604
|
getBans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan>[]>;
|
|
1507
1605
|
/**
|
|
@@ -1513,7 +1611,7 @@ export interface RestManager {
|
|
|
1513
1611
|
* @remarks
|
|
1514
1612
|
* If the channel is a thread, a {@link DiscordThreadMember} object is included in the result.
|
|
1515
1613
|
*
|
|
1516
|
-
* @see {@link https://discord.com/developers/
|
|
1614
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-channel}
|
|
1517
1615
|
*/
|
|
1518
1616
|
getChannel: (channelId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
1519
1617
|
/**
|
|
@@ -1527,7 +1625,7 @@ export interface RestManager {
|
|
|
1527
1625
|
*
|
|
1528
1626
|
* Only usable for guild channels.
|
|
1529
1627
|
*
|
|
1530
|
-
* @see {@link https://discord.com/developers/
|
|
1628
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-channel-invites}
|
|
1531
1629
|
*/
|
|
1532
1630
|
getChannelInvites: (channelId: BigString) => Promise<Camelize<DiscordInviteMetadata>[]>;
|
|
1533
1631
|
/**
|
|
@@ -1539,7 +1637,7 @@ export interface RestManager {
|
|
|
1539
1637
|
* @remarks
|
|
1540
1638
|
* Excludes threads.
|
|
1541
1639
|
*
|
|
1542
|
-
* @see {@link https://discord.com/developers/
|
|
1640
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-channels}
|
|
1543
1641
|
*/
|
|
1544
1642
|
getChannels: (guildId: BigString) => Promise<Camelize<DiscordChannel>[]>;
|
|
1545
1643
|
/**
|
|
@@ -1551,7 +1649,7 @@ export interface RestManager {
|
|
|
1551
1649
|
* @remarks
|
|
1552
1650
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1553
1651
|
*
|
|
1554
|
-
* @see {@link https://discord.com/developers/
|
|
1652
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#get-channel-webhooks}
|
|
1555
1653
|
*/
|
|
1556
1654
|
getChannelWebhooks: (channelId: BigString) => Promise<Camelize<DiscordWebhook>[]>;
|
|
1557
1655
|
/**
|
|
@@ -1560,7 +1658,7 @@ export interface RestManager {
|
|
|
1560
1658
|
* @param userId - The ID of the user to create the DM channel with.
|
|
1561
1659
|
* @returns An instance of {@link DiscordChannel}.
|
|
1562
1660
|
*
|
|
1563
|
-
* @see {@link https://discord.com/developers/
|
|
1661
|
+
* @see {@link https://docs.discord.com/developers/resources/user#create-dm}
|
|
1564
1662
|
*/
|
|
1565
1663
|
getDmChannel: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
1566
1664
|
/**
|
|
@@ -1576,7 +1674,7 @@ export interface RestManager {
|
|
|
1576
1674
|
*
|
|
1577
1675
|
* Fires a _Channel create_ gateway event.
|
|
1578
1676
|
*
|
|
1579
|
-
* @see {@link https://discord.com/developers/
|
|
1677
|
+
* @see {@link https://docs.discord.com/developers/resources/user#create-group-dm}
|
|
1580
1678
|
*/
|
|
1581
1679
|
getGroupDmChannel: (options: CreateGroupDmOptions) => Promise<Camelize<DiscordChannel>>;
|
|
1582
1680
|
/**
|
|
@@ -1588,9 +1686,9 @@ export interface RestManager {
|
|
|
1588
1686
|
*
|
|
1589
1687
|
* @remarks
|
|
1590
1688
|
* Includes the `user` field if the bot has the `MANAGE_GUILD_EXPRESSIONS` permission,
|
|
1591
|
-
* 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.
|
|
1592
1690
|
*
|
|
1593
|
-
* @see {@link https://discord.com/developers/
|
|
1691
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#get-guild-emoji}
|
|
1594
1692
|
*/
|
|
1595
1693
|
getEmoji: (guildId: BigString, emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
|
|
1596
1694
|
/**
|
|
@@ -1602,7 +1700,7 @@ export interface RestManager {
|
|
|
1602
1700
|
* @remarks
|
|
1603
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.
|
|
1604
1702
|
*
|
|
1605
|
-
* @see {@link https://discord.com/developers/
|
|
1703
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#get-application-emoji}
|
|
1606
1704
|
*/
|
|
1607
1705
|
getApplicationEmoji: (emojiId: BigString) => Promise<Camelize<DiscordEmoji>>;
|
|
1608
1706
|
/**
|
|
@@ -1614,7 +1712,7 @@ export interface RestManager {
|
|
|
1614
1712
|
* @remarks
|
|
1615
1713
|
* Includes `user` fields if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
|
|
1616
1714
|
*
|
|
1617
|
-
* @see {@link https://discord.com/developers/
|
|
1715
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#list-guild-emojis}
|
|
1618
1716
|
*/
|
|
1619
1717
|
getEmojis: (guildId: BigString) => Promise<Camelize<DiscordEmoji>[]>;
|
|
1620
1718
|
/**
|
|
@@ -1625,7 +1723,7 @@ export interface RestManager {
|
|
|
1625
1723
|
* @remarks
|
|
1626
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.
|
|
1627
1725
|
*
|
|
1628
|
-
* @see {@link https://discord.com/developers/
|
|
1726
|
+
* @see {@link https://docs.discord.com/developers/resources/emoji#list-application-emojis}
|
|
1629
1727
|
*/
|
|
1630
1728
|
getApplicationEmojis: () => Promise<{
|
|
1631
1729
|
items: Camelize<DiscordEmoji>[];
|
|
@@ -1644,7 +1742,7 @@ export interface RestManager {
|
|
|
1644
1742
|
*
|
|
1645
1743
|
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1646
1744
|
*
|
|
1647
|
-
* @see {@link https://discord.com/developers/
|
|
1745
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#get-followup-message}
|
|
1648
1746
|
*/
|
|
1649
1747
|
getFollowupMessage: (token: string, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
1650
1748
|
/** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
|
|
@@ -1655,7 +1753,7 @@ export interface RestManager {
|
|
|
1655
1753
|
* @param commandId - The ID of the command to get.
|
|
1656
1754
|
* @returns An instance of {@link DiscordApplicationCommand}.
|
|
1657
1755
|
*
|
|
1658
|
-
* @see {@link https://discord.com/developers/
|
|
1756
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-global-application-command}
|
|
1659
1757
|
*/
|
|
1660
1758
|
getGlobalApplicationCommand: (commandId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1661
1759
|
/**
|
|
@@ -1664,7 +1762,7 @@ export interface RestManager {
|
|
|
1664
1762
|
* @param options - The parameters for the fetching of global application commands
|
|
1665
1763
|
* @returns A collection of {@link DiscordApplicationCommand} objects assorted by command ID.
|
|
1666
1764
|
*
|
|
1667
|
-
* @see {@link https://discord.com/developers/
|
|
1765
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-global-application-commands}
|
|
1668
1766
|
*/
|
|
1669
1767
|
getGlobalApplicationCommands: (options?: GetGlobalApplicationCommandsOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
|
|
1670
1768
|
/**
|
|
@@ -1674,7 +1772,7 @@ export interface RestManager {
|
|
|
1674
1772
|
* @param options - The parameters for the fetching of the guild.
|
|
1675
1773
|
* @returns An instance of {@link DiscordGuild}.
|
|
1676
1774
|
*
|
|
1677
|
-
* @see {@link https://discord.com/developers/
|
|
1775
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild}
|
|
1678
1776
|
*/
|
|
1679
1777
|
getGuild: (guildId: BigString, options?: {
|
|
1680
1778
|
counts?: boolean;
|
|
@@ -1689,7 +1787,7 @@ export interface RestManager {
|
|
|
1689
1787
|
* @remarks
|
|
1690
1788
|
* If used with an access token, the token needs to have the `guilds` scope
|
|
1691
1789
|
*
|
|
1692
|
-
* @see {@link https://discord.com/developers/
|
|
1790
|
+
* @see {@link https://docs.discord.com/developers/resources/user#get-current-user-guilds}
|
|
1693
1791
|
*/
|
|
1694
1792
|
getGuilds: (bearerToken?: string, options?: GetUserGuilds) => Promise<Partial<Camelize<DiscordGuild>>[]>;
|
|
1695
1793
|
/**
|
|
@@ -1699,7 +1797,7 @@ export interface RestManager {
|
|
|
1699
1797
|
* @param commandId - The ID of the command to get.
|
|
1700
1798
|
* @returns An instance of {@link DiscordApplicationCommand}.
|
|
1701
1799
|
*
|
|
1702
|
-
* @see {@link https://discord.com/developers/
|
|
1800
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-guild-application-command}
|
|
1703
1801
|
*/
|
|
1704
1802
|
getGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
1705
1803
|
/**
|
|
@@ -1709,7 +1807,7 @@ export interface RestManager {
|
|
|
1709
1807
|
* @param options - The parameters for the fetching of guild application commands
|
|
1710
1808
|
* @returns A collection of {@link DiscordApplicationCommand} objects assorted by command ID.
|
|
1711
1809
|
*
|
|
1712
|
-
* @see {@link https://discord.com/developers/
|
|
1810
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#get-global-application-commandss}
|
|
1713
1811
|
*/
|
|
1714
1812
|
getGuildApplicationCommands: (guildId: BigString, options?: GetGuildApplicationCommandsOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
|
|
1715
1813
|
/**
|
|
@@ -1721,7 +1819,7 @@ export interface RestManager {
|
|
|
1721
1819
|
* @remarks
|
|
1722
1820
|
* If the bot user is not in the guild, the guild must be discoverable.
|
|
1723
1821
|
*
|
|
1724
|
-
* @see {@link https://discord.com/developers/
|
|
1822
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-preview}
|
|
1725
1823
|
*/
|
|
1726
1824
|
getGuildPreview: (guildId: BigString) => Promise<Camelize<DiscordGuildPreview>>;
|
|
1727
1825
|
/**
|
|
@@ -1733,7 +1831,7 @@ export interface RestManager {
|
|
|
1733
1831
|
*
|
|
1734
1832
|
* @remarks Includes the user field if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
|
|
1735
1833
|
*
|
|
1736
|
-
* @see {@link https://discord.com/developers/
|
|
1834
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#get-guild-sticker}
|
|
1737
1835
|
*/
|
|
1738
1836
|
getGuildSticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
|
|
1739
1837
|
/**
|
|
@@ -1744,7 +1842,7 @@ export interface RestManager {
|
|
|
1744
1842
|
*
|
|
1745
1843
|
* @remarks Includes user fields if the bot has the `CREATE_GUILD_EXPRESSIONS` or `MANAGE_GUILD_EXPRESSIONS` permission.
|
|
1746
1844
|
*
|
|
1747
|
-
* @see {@link https://discord.com/developers/
|
|
1845
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#list-guild-stickers}
|
|
1748
1846
|
*/
|
|
1749
1847
|
getGuildStickers: (guildId: BigString) => Promise<Camelize<DiscordSticker>[]>;
|
|
1750
1848
|
/**
|
|
@@ -1756,7 +1854,7 @@ export interface RestManager {
|
|
|
1756
1854
|
* @remarks
|
|
1757
1855
|
* Requires the `MANAGE_GUILD` permission.
|
|
1758
1856
|
*
|
|
1759
|
-
* @see {@link https://discord.com/developers/
|
|
1857
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#get-guild-template}
|
|
1760
1858
|
*/
|
|
1761
1859
|
getGuildTemplate: (templateCode: string) => Promise<Camelize<DiscordTemplate>>;
|
|
1762
1860
|
/**
|
|
@@ -1768,7 +1866,7 @@ export interface RestManager {
|
|
|
1768
1866
|
* @remarks
|
|
1769
1867
|
* Requires the `MANAGE_GUILD` permission.
|
|
1770
1868
|
*
|
|
1771
|
-
* @see {@link https://discord.com/developers/
|
|
1869
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#get-guild-templates}
|
|
1772
1870
|
*/
|
|
1773
1871
|
getGuildTemplates: (guildId: BigString) => Promise<Camelize<DiscordTemplate>[]>;
|
|
1774
1872
|
/**
|
|
@@ -1780,7 +1878,7 @@ export interface RestManager {
|
|
|
1780
1878
|
* @remarks
|
|
1781
1879
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1782
1880
|
*
|
|
1783
|
-
* @see {@link https://discord.com/developers/
|
|
1881
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#get-guild-webhooks}
|
|
1784
1882
|
*/
|
|
1785
1883
|
getGuildWebhooks: (guildId: BigString) => Promise<Camelize<DiscordWebhook>[]>;
|
|
1786
1884
|
/**
|
|
@@ -1792,7 +1890,7 @@ export interface RestManager {
|
|
|
1792
1890
|
* @remarks
|
|
1793
1891
|
* Requires the `MANAGE_GUILD` permission.
|
|
1794
1892
|
*
|
|
1795
|
-
* @see {@link https://discord.com/developers/
|
|
1893
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-integrations}
|
|
1796
1894
|
*/
|
|
1797
1895
|
getIntegrations: (guildId: BigString) => Promise<Camelize<DiscordIntegration>[]>;
|
|
1798
1896
|
/**
|
|
@@ -1802,7 +1900,7 @@ export interface RestManager {
|
|
|
1802
1900
|
* @param options - The parameters for the fetching of the invite.
|
|
1803
1901
|
* @returns An instance of {@link DiscordInviteMetadata}.
|
|
1804
1902
|
*
|
|
1805
|
-
* @see {@link https://discord.com/developers/
|
|
1903
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-invite}
|
|
1806
1904
|
*/
|
|
1807
1905
|
getInvite: (inviteCode: string, options?: GetInvite) => Promise<Camelize<DiscordInviteMetadata>>;
|
|
1808
1906
|
/**
|
|
@@ -1814,7 +1912,7 @@ export interface RestManager {
|
|
|
1814
1912
|
* @remarks
|
|
1815
1913
|
* Requires the `MANAGE_GUILD` or `VIEW_AUDIT_LOG` permission.
|
|
1816
1914
|
*
|
|
1817
|
-
* @see {@link https://discord.com/developers/
|
|
1915
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-invites}
|
|
1818
1916
|
*/
|
|
1819
1917
|
getInvites: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata>[]>;
|
|
1820
1918
|
/**
|
|
@@ -1830,7 +1928,7 @@ export interface RestManager {
|
|
|
1830
1928
|
* If getting a message from a guild channel:
|
|
1831
1929
|
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1832
1930
|
*
|
|
1833
|
-
* @see {@link https://discord.com/developers/
|
|
1931
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-channel-message}
|
|
1834
1932
|
*/
|
|
1835
1933
|
getMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
1836
1934
|
/**
|
|
@@ -1846,15 +1944,24 @@ export interface RestManager {
|
|
|
1846
1944
|
* If getting a messages from a guild channel:
|
|
1847
1945
|
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1848
1946
|
*
|
|
1849
|
-
* @see {@link https://discord.com/developers/
|
|
1947
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-channel-messages}
|
|
1850
1948
|
*/
|
|
1851
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>>;
|
|
1852
1959
|
/**
|
|
1853
1960
|
* Returns a sticker pack for the given ID.
|
|
1854
1961
|
*
|
|
1855
1962
|
* @returns A {@link DiscordStickerPack} object.
|
|
1856
1963
|
*
|
|
1857
|
-
* @see {@link https://discord.com/developers/
|
|
1964
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#get-sticker-pack}
|
|
1858
1965
|
*/
|
|
1859
1966
|
getStickerPack: (stickerPackId: BigString) => Promise<Camelize<DiscordStickerPack>>;
|
|
1860
1967
|
/**
|
|
@@ -1862,7 +1969,7 @@ export interface RestManager {
|
|
|
1862
1969
|
*
|
|
1863
1970
|
* @returns A collection of {@link DiscordStickerPack} objects assorted by sticker ID.
|
|
1864
1971
|
*
|
|
1865
|
-
* @see {@link https://discord.com/developers/
|
|
1972
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#list-sticker-packs}
|
|
1866
1973
|
*/
|
|
1867
1974
|
getStickerPacks: () => Promise<Camelize<DiscordStickerPack>[]>;
|
|
1868
1975
|
/**
|
|
@@ -1878,7 +1985,7 @@ export interface RestManager {
|
|
|
1878
1985
|
*
|
|
1879
1986
|
* Does not support ephemeral follow-up messages due to these being stateless.
|
|
1880
1987
|
*
|
|
1881
|
-
* @see {@link https://discord.com/developers/
|
|
1988
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#get-original-interaction-response}
|
|
1882
1989
|
*/
|
|
1883
1990
|
getOriginalInteractionResponse: (token: string) => Promise<Camelize<DiscordMessage>>;
|
|
1884
1991
|
/**
|
|
@@ -1893,7 +2000,7 @@ export interface RestManager {
|
|
|
1893
2000
|
*
|
|
1894
2001
|
* If the user is missing the `READ_MESSAGE_HISTORY` permission in the channel, then no pins will be returned.
|
|
1895
2002
|
*
|
|
1896
|
-
* @see {@link https://discord.com/developers/
|
|
2003
|
+
* @see {@link https://docs.discord.com/developers/resources/message#get-channel-pins}
|
|
1897
2004
|
*/
|
|
1898
2005
|
getChannelPins: (channelId: BigString, options?: GetChannelPinsOptions) => Promise<Camelize<DiscordGetChannelPins>>;
|
|
1899
2006
|
/**
|
|
@@ -1908,7 +2015,7 @@ export interface RestManager {
|
|
|
1908
2015
|
* If getting a message from a guild channel:
|
|
1909
2016
|
* - Requires the `READ_MESSAGE_HISTORY` permission.
|
|
1910
2017
|
*
|
|
1911
|
-
* @see {@link https://discord.com/developers/
|
|
2018
|
+
* @see {@link https://docs.discord.com/developers/resources/message#get-pinned-messages-deprecated}
|
|
1912
2019
|
* @deprecated Use {@link getChannelPins} instead.
|
|
1913
2020
|
*/
|
|
1914
2021
|
getPinnedMessages: (channelId: BigString) => Promise<Camelize<DiscordMessage>[]>;
|
|
@@ -1927,7 +2034,7 @@ export interface RestManager {
|
|
|
1927
2034
|
*
|
|
1928
2035
|
* Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
|
|
1929
2036
|
*
|
|
1930
|
-
* @see {@link https://discord.com/developers/
|
|
2037
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#list-private-archived-threads}
|
|
1931
2038
|
*/
|
|
1932
2039
|
getPrivateArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordListArchivedThreads>>;
|
|
1933
2040
|
/**
|
|
@@ -1944,7 +2051,7 @@ export interface RestManager {
|
|
|
1944
2051
|
*
|
|
1945
2052
|
* Threads are ordered by the `id` property in descending order.
|
|
1946
2053
|
*
|
|
1947
|
-
* @see {@link https://discord.com/developers/
|
|
2054
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#list-joined-private-archived-threads}
|
|
1948
2055
|
*/
|
|
1949
2056
|
getPrivateJoinedArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordListArchivedThreads>>;
|
|
1950
2057
|
/**
|
|
@@ -1957,7 +2064,7 @@ export interface RestManager {
|
|
|
1957
2064
|
* @remarks
|
|
1958
2065
|
* Requires the `MANAGE_GUILD` and `KICK_MEMBERS` permissions.
|
|
1959
2066
|
*
|
|
1960
|
-
* @see {@link https://discord.com/developers/
|
|
2067
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-prune-count}
|
|
1961
2068
|
*/
|
|
1962
2069
|
getPruneCount: (guildId: BigString, options?: GetGuildPruneCountQuery) => Promise<Camelize<DiscordPrunedCount>>;
|
|
1963
2070
|
/**
|
|
@@ -1975,7 +2082,7 @@ export interface RestManager {
|
|
|
1975
2082
|
*
|
|
1976
2083
|
* Threads are ordered by the `archive_timestamp` property included in the metadata of the object in descending order.
|
|
1977
2084
|
*
|
|
1978
|
-
* @see {@link https://discord.com/developers/
|
|
2085
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#list-public-archived-threads}
|
|
1979
2086
|
*/
|
|
1980
2087
|
getPublicArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<Camelize<DiscordListArchivedThreads>>;
|
|
1981
2088
|
/**
|
|
@@ -1987,7 +2094,7 @@ export interface RestManager {
|
|
|
1987
2094
|
* @remarks
|
|
1988
2095
|
* ⚠️ This endpoint should be used sparingly due to {@link DiscordRole} objects already being included in guild payloads.
|
|
1989
2096
|
*
|
|
1990
|
-
* @see {@link https://discord.com/developers/
|
|
2097
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-roles}
|
|
1991
2098
|
*/
|
|
1992
2099
|
getRoles: (guildId: BigString) => Promise<Camelize<DiscordRole>[]>;
|
|
1993
2100
|
/**
|
|
@@ -1997,7 +2104,7 @@ export interface RestManager {
|
|
|
1997
2104
|
* @param roleId - The ID of the role.
|
|
1998
2105
|
* @returns A {@link DiscordRole} object.
|
|
1999
2106
|
*
|
|
2000
|
-
* @see {@link https://discord.com/developers/
|
|
2107
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role}
|
|
2001
2108
|
*/
|
|
2002
2109
|
getRole: (guildId: BigString, roleId: BigString) => Promise<Camelize<DiscordRole>>;
|
|
2003
2110
|
/**
|
|
@@ -2008,7 +2115,7 @@ export interface RestManager {
|
|
|
2008
2115
|
* @param options - The parameters for the fetching of the scheduled event.
|
|
2009
2116
|
* @returns An instance of {@link DiscordScheduledEvent}.
|
|
2010
2117
|
*
|
|
2011
|
-
* @see {@link https://discord.com/developers/
|
|
2118
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#get-guild-scheduled-event}
|
|
2012
2119
|
*/
|
|
2013
2120
|
getScheduledEvent: (guildId: BigString, eventId: BigString, options?: {
|
|
2014
2121
|
withUserCount?: boolean;
|
|
@@ -2020,7 +2127,7 @@ export interface RestManager {
|
|
|
2020
2127
|
* @param options - The parameters for the fetching of the scheduled events.
|
|
2021
2128
|
* @returns A collection of {@link DiscordScheduledEvent} objects assorted by event ID.
|
|
2022
2129
|
*
|
|
2023
|
-
* @see {@link https://discord.com/developers/
|
|
2130
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#list-scheduled-events-for-guild}
|
|
2024
2131
|
*/
|
|
2025
2132
|
getScheduledEvents: (guildId: BigString, options?: GetScheduledEvents) => Promise<Camelize<DiscordScheduledEvent>[]>;
|
|
2026
2133
|
/**
|
|
@@ -2036,7 +2143,7 @@ export interface RestManager {
|
|
|
2036
2143
|
*
|
|
2037
2144
|
* Users are ordered by their IDs in _ascending_ order.
|
|
2038
2145
|
*
|
|
2039
|
-
* @see {@link https://discord.com/developers/
|
|
2146
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-scheduled-event#get-guild-scheduled-event-users}
|
|
2040
2147
|
*/
|
|
2041
2148
|
getScheduledEventUsers: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => Promise<Array<{
|
|
2042
2149
|
user: Camelize<DiscordUser>;
|
|
@@ -2050,7 +2157,7 @@ export interface RestManager {
|
|
|
2050
2157
|
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
2051
2158
|
* @returns An instance of {@link DiscordStageInstance}.
|
|
2052
2159
|
*
|
|
2053
|
-
* @see {@link https://discord.com/developers/
|
|
2160
|
+
* @see {@link https://docs.discord.com/developers/resources/stage-instance#get-stage-instance}
|
|
2054
2161
|
*/
|
|
2055
2162
|
getStageInstance: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
|
|
2056
2163
|
/**
|
|
@@ -2059,7 +2166,7 @@ export interface RestManager {
|
|
|
2059
2166
|
* @param guildId - The ID of the guild to get the voice state from.
|
|
2060
2167
|
* @returns An instance of {@link DiscordVoiceState}.
|
|
2061
2168
|
*
|
|
2062
|
-
* @see {@link https://discord.com/developers/
|
|
2169
|
+
* @see {@link https://docs.discord.com/developers/resources/voice#get-current-user-voice-state}
|
|
2063
2170
|
*/
|
|
2064
2171
|
getOwnVoiceState: (guildId: BigString) => Promise<Camelize<DiscordVoiceState>>;
|
|
2065
2172
|
/**
|
|
@@ -2069,7 +2176,10 @@ export interface RestManager {
|
|
|
2069
2176
|
* @param userId - The ID of the user to get the voice state from
|
|
2070
2177
|
* @returns An instance of {@link DiscordVoiceState}.
|
|
2071
2178
|
*
|
|
2072
|
-
* @
|
|
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}
|
|
2073
2183
|
*/
|
|
2074
2184
|
getUserVoiceState: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordVoiceState>>;
|
|
2075
2185
|
/**
|
|
@@ -2078,7 +2188,7 @@ export interface RestManager {
|
|
|
2078
2188
|
* @param stickerId The ID of the sticker to get
|
|
2079
2189
|
* @returns A {@link DiscordSticker}
|
|
2080
2190
|
*
|
|
2081
|
-
* @see {@link https://discord.com/developers/
|
|
2191
|
+
* @see {@link https://docs.discord.com/developers/resources/sticker#get-sticker}
|
|
2082
2192
|
*/
|
|
2083
2193
|
getSticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
|
|
2084
2194
|
/**
|
|
@@ -2089,7 +2199,7 @@ export interface RestManager {
|
|
|
2089
2199
|
* @param options - The parameters for the fetching of the thread member.
|
|
2090
2200
|
* @returns An instance of {@link DiscordThreadMember}.
|
|
2091
2201
|
*
|
|
2092
|
-
* @see {@link https://discord.com/developers/
|
|
2202
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-thread-member}
|
|
2093
2203
|
*/
|
|
2094
2204
|
getThreadMember: (channelId: BigString, userId: BigString, options?: GetThreadMember) => Promise<Camelize<DiscordThreadMember>>;
|
|
2095
2205
|
/**
|
|
@@ -2102,7 +2212,7 @@ export interface RestManager {
|
|
|
2102
2212
|
* @remarks
|
|
2103
2213
|
* Requires the application to have the `GUILD_MEMBERS` privileged intent enabled.
|
|
2104
2214
|
*
|
|
2105
|
-
* @see {@link https://discord.com/developers/
|
|
2215
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#list-thread-members}
|
|
2106
2216
|
*/
|
|
2107
2217
|
getThreadMembers: (channelId: BigString, options?: ListThreadMembers) => Promise<Camelize<DiscordThreadMember>[]>;
|
|
2108
2218
|
/**
|
|
@@ -2114,7 +2224,7 @@ export interface RestManager {
|
|
|
2114
2224
|
* @param options - The parameters for the fetching of the users.
|
|
2115
2225
|
* @returns A collection of {@link DiscordUser} objects assorted by user ID.
|
|
2116
2226
|
*
|
|
2117
|
-
* @see {@link https://discord.com/developers/
|
|
2227
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#get-reactions}
|
|
2118
2228
|
*/
|
|
2119
2229
|
getReactions: (channelId: BigString, messageId: BigString, reaction: string, options?: GetReactions) => Promise<Camelize<DiscordUser>[]>;
|
|
2120
2230
|
/**
|
|
@@ -2156,7 +2266,7 @@ export interface RestManager {
|
|
|
2156
2266
|
* @remarks
|
|
2157
2267
|
* The access token requires the `role_connections.write` scope.
|
|
2158
2268
|
*
|
|
2159
|
-
* @see {@link https://discord.com/developers/
|
|
2269
|
+
* @see {@link https://docs.discord.com/developers/resources/user#get-user-application-role-connection}
|
|
2160
2270
|
*/
|
|
2161
2271
|
getUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString) => Promise<Camelize<DiscordApplicationRoleConnection>>;
|
|
2162
2272
|
/**
|
|
@@ -2170,7 +2280,7 @@ export interface RestManager {
|
|
|
2170
2280
|
*
|
|
2171
2281
|
* The `code` property will be `null` if the guild does not have a set vanity url.
|
|
2172
2282
|
*
|
|
2173
|
-
* @see {@link https://discord.com/developers/
|
|
2283
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-vanity-url}
|
|
2174
2284
|
*/
|
|
2175
2285
|
getVanityUrl: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
|
|
2176
2286
|
/**
|
|
@@ -2179,7 +2289,7 @@ export interface RestManager {
|
|
|
2179
2289
|
* @param guildId - The ID of the guild to get the voice regions for.
|
|
2180
2290
|
* @returns A collection of {@link DiscordVoiceRegion} objects assorted by voice region ID.
|
|
2181
2291
|
*
|
|
2182
|
-
* @see {@link https://discord.com/developers/
|
|
2292
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-voice-regions}
|
|
2183
2293
|
*/
|
|
2184
2294
|
getVoiceRegions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion>[]>;
|
|
2185
2295
|
/**
|
|
@@ -2191,7 +2301,7 @@ export interface RestManager {
|
|
|
2191
2301
|
* @remarks
|
|
2192
2302
|
* Requires the `MANAGE_WEBHOOKS` permission unless the application making the request owns the webhook.
|
|
2193
2303
|
*
|
|
2194
|
-
* @see {@link https://discord.com/developers/
|
|
2304
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#get-webhook}
|
|
2195
2305
|
*/
|
|
2196
2306
|
getWebhook: (webhookId: BigString) => Promise<Camelize<DiscordWebhook>>;
|
|
2197
2307
|
/**
|
|
@@ -2203,7 +2313,7 @@ export interface RestManager {
|
|
|
2203
2313
|
* @param options - The parameters for the fetching of the message.
|
|
2204
2314
|
* @returns An instance of {@link DiscordMessage}.
|
|
2205
2315
|
*
|
|
2206
|
-
* @see {@link https://discord.com/developers/
|
|
2316
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#get-webhook-message}
|
|
2207
2317
|
*/
|
|
2208
2318
|
getWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: GetWebhookMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
2209
2319
|
/**
|
|
@@ -2213,7 +2323,7 @@ export interface RestManager {
|
|
|
2213
2323
|
* @param token - The webhook token, used to get the webhook.
|
|
2214
2324
|
* @returns An instance of {@link DiscordWebhook}.
|
|
2215
2325
|
*
|
|
2216
|
-
* @see {@link https://discord.com/developers/
|
|
2326
|
+
* @see {@link https://docs.discord.com/developers/resources/webhook#get-webhook-with-token}
|
|
2217
2327
|
*/
|
|
2218
2328
|
getWebhookWithToken: (webhookId: BigString, token: string) => Promise<Camelize<DiscordWebhook>>;
|
|
2219
2329
|
/**
|
|
@@ -2226,7 +2336,7 @@ export interface RestManager {
|
|
|
2226
2336
|
* If the welcome screen is not enabled:
|
|
2227
2337
|
* - Requires the `MANAGE_GUILD` permission.
|
|
2228
2338
|
*
|
|
2229
|
-
* @see {@link https://discord.com/developers/
|
|
2339
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-welcome-screen}
|
|
2230
2340
|
*/
|
|
2231
2341
|
getWelcomeScreen: (guildId: BigString) => Promise<Camelize<DiscordWelcomeScreen>>;
|
|
2232
2342
|
/**
|
|
@@ -2238,7 +2348,7 @@ export interface RestManager {
|
|
|
2238
2348
|
* @remarks
|
|
2239
2349
|
* Fires an `INVITE_CREATED` Gateway event when an invite channel is defined and a new `Invite` is generated.
|
|
2240
2350
|
*
|
|
2241
|
-
* @see {@link https://discord.com/developers/
|
|
2351
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-widget}
|
|
2242
2352
|
*/
|
|
2243
2353
|
getWidget: (guildId: BigString) => Promise<Camelize<DiscordGuildWidget>>;
|
|
2244
2354
|
/**
|
|
@@ -2250,7 +2360,7 @@ export interface RestManager {
|
|
|
2250
2360
|
* @remarks
|
|
2251
2361
|
* Requires the `MANAGE_GUILD` permission.
|
|
2252
2362
|
*
|
|
2253
|
-
* @see {@link https://discord.com/developers/
|
|
2363
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-widget-settings}
|
|
2254
2364
|
*/
|
|
2255
2365
|
getWidgetSettings: (guildId: BigString) => Promise<Camelize<DiscordGuildWidgetSettings>>;
|
|
2256
2366
|
/**
|
|
@@ -2263,7 +2373,7 @@ export interface RestManager {
|
|
|
2263
2373
|
*
|
|
2264
2374
|
* Fires a _Thread Members Update_ gateway event.
|
|
2265
2375
|
*
|
|
2266
|
-
* @see {@link https://discord.com/developers/
|
|
2376
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#join-thread}
|
|
2267
2377
|
*/
|
|
2268
2378
|
joinThread: (channelId: BigString) => Promise<void>;
|
|
2269
2379
|
/**
|
|
@@ -2274,7 +2384,7 @@ export interface RestManager {
|
|
|
2274
2384
|
* @remarks
|
|
2275
2385
|
* Fires a _Guild Delete_ event.
|
|
2276
2386
|
*
|
|
2277
|
-
* @see {@link https://discord.com/developers/
|
|
2387
|
+
* @see {@link https://docs.discord.com/developers/resources/user#leave-guild}
|
|
2278
2388
|
*/
|
|
2279
2389
|
leaveGuild: (guildId: BigString) => Promise<void>;
|
|
2280
2390
|
/**
|
|
@@ -2287,7 +2397,7 @@ export interface RestManager {
|
|
|
2287
2397
|
*
|
|
2288
2398
|
* Fires a _Thread Members Update_ gateway event.
|
|
2289
2399
|
*
|
|
2290
|
-
* @see {@link https://discord.com/developers/
|
|
2400
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#leave-thread}
|
|
2291
2401
|
*/
|
|
2292
2402
|
leaveThread: (channelId: BigString) => Promise<void>;
|
|
2293
2403
|
/**
|
|
@@ -2305,7 +2415,7 @@ export interface RestManager {
|
|
|
2305
2415
|
*
|
|
2306
2416
|
* Fires a _Message Create_ event in the guilds the subscribed channels are in.
|
|
2307
2417
|
*
|
|
2308
|
-
* @see {@link https://discord.com/developers/
|
|
2418
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#crosspost-message}
|
|
2309
2419
|
*/
|
|
2310
2420
|
publishMessage: (channelId: BigString, messageId: BigString) => Promise<Camelize<DiscordMessage>>;
|
|
2311
2421
|
/**
|
|
@@ -2321,7 +2431,7 @@ export interface RestManager {
|
|
|
2321
2431
|
*
|
|
2322
2432
|
* Fires a _Guild Member Update_ gateway event.
|
|
2323
2433
|
*
|
|
2324
|
-
* @see {@link https://discord.com/developers/
|
|
2434
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#remove-guild-member-role}
|
|
2325
2435
|
*/
|
|
2326
2436
|
removeRole: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
|
|
2327
2437
|
/**
|
|
@@ -2338,7 +2448,7 @@ export interface RestManager {
|
|
|
2338
2448
|
*
|
|
2339
2449
|
* Fires a _Thread Members Update_ gateway event.
|
|
2340
2450
|
*
|
|
2341
|
-
* @see {@link https://discord.com/developers/
|
|
2451
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#remove-thread-member}
|
|
2342
2452
|
*/
|
|
2343
2453
|
removeThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
2344
2454
|
/**
|
|
@@ -2347,7 +2457,7 @@ export interface RestManager {
|
|
|
2347
2457
|
* @param channelId - The ID of the channel to remove the recipient user of.
|
|
2348
2458
|
* @param userId - The user ID of the user to remove.
|
|
2349
2459
|
*
|
|
2350
|
-
* @see {@link https://discord.com/developers/
|
|
2460
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#group-dm-remove-recipient}
|
|
2351
2461
|
*/
|
|
2352
2462
|
removeDmRecipient: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
2353
2463
|
/**
|
|
@@ -2374,7 +2484,7 @@ export interface RestManager {
|
|
|
2374
2484
|
*
|
|
2375
2485
|
* Fires a _Message Create_ gateway event.
|
|
2376
2486
|
*
|
|
2377
|
-
* @see {@link https://discord.com/developers/
|
|
2487
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#create-message}
|
|
2378
2488
|
*/
|
|
2379
2489
|
sendMessage: (channelId: BigString, options: CreateMessageOptions) => Promise<Camelize<DiscordMessage>>;
|
|
2380
2490
|
/**
|
|
@@ -2398,7 +2508,7 @@ export interface RestManager {
|
|
|
2398
2508
|
*
|
|
2399
2509
|
* Fires a _Message Create_ event.
|
|
2400
2510
|
*
|
|
2401
|
-
* @see {@link https://discord.com/developers/
|
|
2511
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#create-followup-message}
|
|
2402
2512
|
*/
|
|
2403
2513
|
sendFollowupMessage: (token: string, options: InteractionCallbackData) => Promise<Camelize<DiscordMessage>>;
|
|
2404
2514
|
/**
|
|
@@ -2421,7 +2531,7 @@ export interface RestManager {
|
|
|
2421
2531
|
*
|
|
2422
2532
|
* Fires a _Message Create_ event.
|
|
2423
2533
|
*
|
|
2424
|
-
* @see {@link https://discord.com/developers/
|
|
2534
|
+
* @see {@link https://docs.discord.com/developers/interactions/receiving-and-responding#create-interaction-response}
|
|
2425
2535
|
*/
|
|
2426
2536
|
sendInteractionResponse: (interactionId: BigString, token: string, options: InteractionResponse, params?: InteractionCallbackOptions) => Promise<void | Camelize<DiscordInteractionCallbackResponse>>;
|
|
2427
2537
|
/**
|
|
@@ -2442,7 +2552,7 @@ export interface RestManager {
|
|
|
2442
2552
|
*
|
|
2443
2553
|
* Fires a _Thread Create_ gateway event.
|
|
2444
2554
|
*
|
|
2445
|
-
* @see {@link https://discord.com/developers/
|
|
2555
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#start-thread-from-message}
|
|
2446
2556
|
*/
|
|
2447
2557
|
startThreadWithMessage: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage, reason?: string) => Promise<Camelize<DiscordChannel>>;
|
|
2448
2558
|
/**
|
|
@@ -2458,7 +2568,7 @@ export interface RestManager {
|
|
|
2458
2568
|
*
|
|
2459
2569
|
* Fires a _Thread Create_ gateway event.
|
|
2460
2570
|
*
|
|
2461
|
-
* @see {@link https://discord.com/developers/
|
|
2571
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#start-thread-without-message}
|
|
2462
2572
|
*/
|
|
2463
2573
|
startThreadWithoutMessage: (channelId: BigString, options: StartThreadWithoutMessage, reason?: string) => Promise<Camelize<DiscordChannel>>;
|
|
2464
2574
|
/**
|
|
@@ -2495,7 +2605,7 @@ export interface RestManager {
|
|
|
2495
2605
|
*
|
|
2496
2606
|
* Fires a _Guild Update_ gateway event.
|
|
2497
2607
|
*
|
|
2498
|
-
* @see {@link https://discord.com/developers/
|
|
2608
|
+
* @see {@link https://docs.discord.com/developers/resources/guild-template#get-guild-templates}
|
|
2499
2609
|
*/
|
|
2500
2610
|
syncGuildTemplate: (guildId: BigString) => Promise<Camelize<DiscordTemplate>>;
|
|
2501
2611
|
/**
|
|
@@ -2510,7 +2620,7 @@ export interface RestManager {
|
|
|
2510
2620
|
*
|
|
2511
2621
|
* Fires a _Typing Start_ gateway event.
|
|
2512
2622
|
*
|
|
2513
|
-
* @see {@link https://discord.com/developers/
|
|
2623
|
+
* @see {@link https://docs.discord.com/developers/resources/channel#trigger-typing-indicator}
|
|
2514
2624
|
*/
|
|
2515
2625
|
triggerTypingIndicator: (channelId: BigString) => Promise<void>;
|
|
2516
2626
|
/**
|
|
@@ -2528,7 +2638,7 @@ export interface RestManager {
|
|
|
2528
2638
|
* When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
|
|
2529
2639
|
* You will be able to update only your own application commands
|
|
2530
2640
|
*
|
|
2531
|
-
* @see {@link https://discord.com/developers/
|
|
2641
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#bulk-overwrite-global-application-commands}
|
|
2532
2642
|
*/
|
|
2533
2643
|
upsertGlobalApplicationCommands: (commands: CreateApplicationCommand[], options?: UpsertGlobalApplicationCommandOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
|
|
2534
2644
|
/**
|
|
@@ -2547,7 +2657,7 @@ export interface RestManager {
|
|
|
2547
2657
|
* When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
|
|
2548
2658
|
* You will be able to update only your own application commands
|
|
2549
2659
|
*
|
|
2550
|
-
* @see {@link https://discord.com/developers/
|
|
2660
|
+
* @see {@link https://docs.discord.com/developers/interactions/application-commands#bulk-overwrite-guild-application-commands}
|
|
2551
2661
|
*/
|
|
2552
2662
|
upsertGuildApplicationCommands: (guildId: BigString, commands: CreateApplicationCommand[], options?: UpsertGuildApplicationCommandOptions) => Promise<Camelize<DiscordApplicationCommand>[]>;
|
|
2553
2663
|
/**
|
|
@@ -2563,7 +2673,7 @@ export interface RestManager {
|
|
|
2563
2673
|
*
|
|
2564
2674
|
* Fires a _Guild Ban Add_ gateway event.
|
|
2565
2675
|
*
|
|
2566
|
-
* @see {@link https://discord.com/developers/
|
|
2676
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#create-guild-ban}
|
|
2567
2677
|
*/
|
|
2568
2678
|
banMember: (guildId: BigString, userId: BigString, options?: CreateGuildBan, reason?: string) => Promise<void>;
|
|
2569
2679
|
/**
|
|
@@ -2580,7 +2690,7 @@ export interface RestManager {
|
|
|
2580
2690
|
*
|
|
2581
2691
|
* Fires as many _Guild Ban Add_ gateway events as many user where banned.
|
|
2582
2692
|
*
|
|
2583
|
-
* @see {@link https://discord.com/developers/
|
|
2693
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#bulk-guild-ban}
|
|
2584
2694
|
*/
|
|
2585
2695
|
bulkBanMembers: (guildId: BigString, options: CreateGuildBulkBan, reason?: string) => Promise<Camelize<DiscordBulkBan>>;
|
|
2586
2696
|
/**
|
|
@@ -2594,9 +2704,9 @@ export interface RestManager {
|
|
|
2594
2704
|
* @remarks
|
|
2595
2705
|
* Fires a _Guild Member Update_ gateway event.
|
|
2596
2706
|
*
|
|
2597
|
-
* @see {@link https://discord.com/developers/
|
|
2707
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-current-member}
|
|
2598
2708
|
*/
|
|
2599
|
-
|
|
2709
|
+
editCurrentMember: (guildId: BigString, options: ModifyCurrentMember, reason?: string) => Promise<Camelize<DiscordMember>>;
|
|
2600
2710
|
/**
|
|
2601
2711
|
* Edits a member's properties.
|
|
2602
2712
|
*
|
|
@@ -2611,20 +2721,9 @@ export interface RestManager {
|
|
|
2611
2721
|
*
|
|
2612
2722
|
* Fires a _Guild Member Update_ gateway event.
|
|
2613
2723
|
*
|
|
2614
|
-
* @see {@link https://discord.com/developers/
|
|
2724
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#modify-guild-member}
|
|
2615
2725
|
*/
|
|
2616
2726
|
editMember: (guildId: BigString, userId: BigString, options: ModifyGuildMember, reason?: string) => Promise<Camelize<DiscordMember>>;
|
|
2617
|
-
/**
|
|
2618
|
-
* Gets the member object by user ID.
|
|
2619
|
-
*
|
|
2620
|
-
|
|
2621
|
-
* @param guildId - The ID of the guild to get the member object for.
|
|
2622
|
-
* @param userId - The ID of the user to get the member object for.
|
|
2623
|
-
* @returns An instance of {@link DiscordMemberWithUser}.
|
|
2624
|
-
*
|
|
2625
|
-
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
|
|
2626
|
-
*/
|
|
2627
|
-
getMember: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordMemberWithUser>>;
|
|
2628
2727
|
/**
|
|
2629
2728
|
* Gets the current member object.
|
|
2630
2729
|
*
|
|
@@ -2635,9 +2734,20 @@ export interface RestManager {
|
|
|
2635
2734
|
* @remarks
|
|
2636
2735
|
* The access tokens needs the `guilds.members.read` scope
|
|
2637
2736
|
*
|
|
2638
|
-
* @see {@link https://discord.com/developers/
|
|
2737
|
+
* @see {@link https://docs.discord.com/developers/resources/user#get-current-user-guild-member}
|
|
2639
2738
|
*/
|
|
2640
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>>;
|
|
2641
2751
|
/**
|
|
2642
2752
|
* Gets the list of members for a guild.
|
|
2643
2753
|
*
|
|
@@ -2650,11 +2760,11 @@ export interface RestManager {
|
|
|
2650
2760
|
*
|
|
2651
2761
|
* ⚠️ It is not recommended to use this endpoint with very large bots. Instead, opt to use `fetchMembers()`:
|
|
2652
2762
|
* REST communication only permits 50 requests to be made per second, while gateways allow for up to 120 requests
|
|
2653
|
-
* 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}.
|
|
2654
2764
|
*
|
|
2655
|
-
* @see {@link https://discord.com/developers/
|
|
2656
|
-
* @see {@link https://discord.com/developers/
|
|
2657
|
-
* @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}
|
|
2658
2768
|
*/
|
|
2659
2769
|
getMembers: (guildId: BigString, options: ListGuildMembers) => Promise<Camelize<DiscordMemberWithUser>[]>;
|
|
2660
2770
|
/**
|
|
@@ -2677,7 +2787,7 @@ export interface RestManager {
|
|
|
2677
2787
|
*
|
|
2678
2788
|
* Fires a _Guild Member Remove_ gateway event.
|
|
2679
2789
|
*
|
|
2680
|
-
* @see {@link https://discord.com/developers/
|
|
2790
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#remove-guild-member}
|
|
2681
2791
|
*/
|
|
2682
2792
|
kickMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
|
|
2683
2793
|
/**
|
|
@@ -2692,7 +2802,7 @@ export interface RestManager {
|
|
|
2692
2802
|
*
|
|
2693
2803
|
* Fires a _Channel Pins Update_ event.
|
|
2694
2804
|
*
|
|
2695
|
-
* @see {@link https://discord.com/developers/
|
|
2805
|
+
* @see {@link https://docs.discord.com/developers/resources/message#pin-message}
|
|
2696
2806
|
*/
|
|
2697
2807
|
pinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
2698
2808
|
/**
|
|
@@ -2713,7 +2823,7 @@ export interface RestManager {
|
|
|
2713
2823
|
*
|
|
2714
2824
|
* Fires a _Guild Member Remove_ gateway event for every member kicked.
|
|
2715
2825
|
*
|
|
2716
|
-
* @see {@link https://discord.com/developers/
|
|
2826
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#begin-guild-prune}
|
|
2717
2827
|
*/
|
|
2718
2828
|
pruneMembers: (guildId: BigString, options: BeginGuildPrune, reason?: string) => Promise<{
|
|
2719
2829
|
pruned: number | null;
|
|
@@ -2727,7 +2837,7 @@ export interface RestManager {
|
|
|
2727
2837
|
* @param options - The parameters for searching through the members.
|
|
2728
2838
|
* @returns A collection of {@link DiscordMember} objects assorted by user ID.
|
|
2729
2839
|
*
|
|
2730
|
-
* @see {@link https://discord.com/developers/
|
|
2840
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#search-guild-members}
|
|
2731
2841
|
*/
|
|
2732
2842
|
searchMembers: (guildId: BigString, query: string, options?: Omit<SearchMembers, 'query'>) => Promise<Camelize<DiscordMemberWithUser>[]>;
|
|
2733
2843
|
/**
|
|
@@ -2743,7 +2853,7 @@ export interface RestManager {
|
|
|
2743
2853
|
*
|
|
2744
2854
|
* Fires a _Guild Ban Remove_ gateway event.
|
|
2745
2855
|
*
|
|
2746
|
-
* @see {@link https://discord.com/developers/
|
|
2856
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#remove-guild-ban}
|
|
2747
2857
|
*/
|
|
2748
2858
|
unbanMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
|
|
2749
2859
|
/**
|
|
@@ -2758,7 +2868,7 @@ export interface RestManager {
|
|
|
2758
2868
|
*
|
|
2759
2869
|
* Fires a _Channel Pins Update_ event.
|
|
2760
2870
|
*
|
|
2761
|
-
* @see {@link https://discord.com/developers/
|
|
2871
|
+
* @see {@link https://docs.discord.com/developers/resources/message#unpin-message}
|
|
2762
2872
|
*/
|
|
2763
2873
|
unpinMessage: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
2764
2874
|
/**
|
|
@@ -2952,6 +3062,18 @@ export interface RestManager {
|
|
|
2952
3062
|
* @returns The created lobby
|
|
2953
3063
|
*/
|
|
2954
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>>;
|
|
2955
3077
|
/**
|
|
2956
3078
|
* Returns a lobby object for the specified lobby id, if it exists.
|
|
2957
3079
|
*
|
|
@@ -2985,6 +3107,22 @@ export interface RestManager {
|
|
|
2985
3107
|
* @returns The lobby member object
|
|
2986
3108
|
*/
|
|
2987
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>[]>;
|
|
2988
3126
|
/**
|
|
2989
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.
|
|
2990
3128
|
*
|
|
@@ -3027,6 +3165,77 @@ export interface RestManager {
|
|
|
3027
3165
|
* Uses bearer token for authorization and the user must be a lobby member with the CanLinkLobby lobby member flag.
|
|
3028
3166
|
*/
|
|
3029
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>>;
|
|
3030
3239
|
}
|
|
3031
3240
|
export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
|
|
3032
3241
|
export type ApiVersions = 9 | 10;
|
|
@@ -3036,6 +3245,17 @@ export interface CreateRequestBodyOptions {
|
|
|
3036
3245
|
unauthorized?: boolean;
|
|
3037
3246
|
reason?: string;
|
|
3038
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;
|
|
3039
3259
|
}
|
|
3040
3260
|
export type MakeRequestOptions = Omit<CreateRequestBodyOptions, 'method'> & Pick<SendRequestOptions, 'runThroughQueue'>;
|
|
3041
3261
|
export interface RequestBody {
|