@discordeno/rest 19.0.0-next.40c19da → 19.0.0-next.4287398
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/invalidBucket.d.ts +6 -7
- package/dist/invalidBucket.d.ts.map +1 -1
- package/dist/invalidBucket.js +23 -25
- package/dist/invalidBucket.js.map +1 -1
- package/dist/manager.d.ts +9 -0
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +692 -856
- package/dist/manager.js.map +1 -1
- package/dist/queue.d.ts +5 -0
- package/dist/queue.d.ts.map +1 -1
- package/dist/queue.js +16 -12
- package/dist/queue.js.map +1 -1
- package/dist/routes.d.ts +3 -0
- package/dist/routes.d.ts.map +1 -0
- package/dist/routes.js +525 -0
- package/dist/routes.js.map +1 -0
- package/dist/types.d.ts +454 -211
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typings/routes.d.ts +24 -6
- package/dist/typings/routes.d.ts.map +1 -1
- package/dist/typings/routes.js.map +1 -1
- package/package.json +5 -6
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ApplicationCommandPermissions, AtLeastOne, BeginGuildPrune, BigString, Camelize,
|
|
1
|
+
import type { AddDmRecipientOptions, AddGuildMemberOptions, ApplicationCommandPermissions, AtLeastOne, BeginGuildPrune, BigString, Camelize, CamelizedDiscordAccessTokenResponse, CamelizedDiscordActiveThreads, CamelizedDiscordApplication, CamelizedDiscordApplicationCommand, CamelizedDiscordApplicationRoleConnection, CamelizedDiscordArchivedThreads, CamelizedDiscordAuditLog, CamelizedDiscordAutoModerationRule, CamelizedDiscordBan, CamelizedDiscordChannel, CamelizedDiscordConnection, CamelizedDiscordCurrentAuthorization, CamelizedDiscordEmoji, CamelizedDiscordFollowedChannel, CamelizedDiscordGetGatewayBot, CamelizedDiscordGuild, CamelizedDiscordGuildApplicationCommandPermissions, CamelizedDiscordGuildPreview, CamelizedDiscordGuildWidget, CamelizedDiscordGuildWidgetSettings, CamelizedDiscordIntegration, CamelizedDiscordInvite, CamelizedDiscordInviteMetadata, CamelizedDiscordMember, CamelizedDiscordMemberWithUser, CamelizedDiscordMessage, CamelizedDiscordModifyGuildWelcomeScreen, CamelizedDiscordPartialGuild, CamelizedDiscordPrunedCount, CamelizedDiscordRole, CamelizedDiscordScheduledEvent, CamelizedDiscordStageInstance, CamelizedDiscordSticker, CamelizedDiscordStickerPack, CamelizedDiscordTemplate, CamelizedDiscordThreadMember, CamelizedDiscordTokenExchange, CamelizedDiscordTokenRevocation, CamelizedDiscordUser, CamelizedDiscordVanityUrl, CamelizedDiscordVoiceRegion, CamelizedDiscordWebhook, CamelizedDiscordWelcomeScreen, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGlobalApplicationCommandOptions, CreateGuild, CreateGuildApplicationCommandOptions, CreateGuildBan, CreateGuildChannel, CreateGuildEmoji, CreateGuildFromTemplate, CreateGuildRole, CreateGuildStickerOptions, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, CreateTemplate, DeleteWebhookMessageOptions, EditAutoModerationRuleOptions, EditBotMemberOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditGuildStickerOptions, EditMessage, EditOwnVoiceState, EditScheduledEvent, EditUserVoiceState, ExecuteWebhook, FileContent, GetApplicationCommandPermissionOptions, GetBans, GetGroupDmOptions, GetGuildAuditLog, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetReactions, GetScheduledEventUsers, GetScheduledEvents, GetUserGuilds, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, MfaLevels, ModifyChannel, ModifyGuild, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyGuildMember, ModifyGuildTemplate, ModifyRolePositions, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, UpsertGlobalApplicationCommandOptions, UpsertGuildApplicationCommandOptions } from '@discordeno/types';
|
|
2
2
|
import type { InvalidRequestBucket } from './invalidBucket.js';
|
|
3
3
|
import type { Queue } from './queue.js';
|
|
4
4
|
import type { RestRoutes } from './typings/routes.js';
|
|
5
5
|
export interface CreateRestManagerOptions {
|
|
6
6
|
/** The bot token which will be used to make requests. */
|
|
7
|
-
token
|
|
7
|
+
token?: string;
|
|
8
8
|
/**
|
|
9
9
|
* For old bots that have a different bot id and application id.
|
|
10
10
|
* @default bot id from token
|
|
@@ -29,7 +29,7 @@ export interface CreateRestManagerOptions {
|
|
|
29
29
|
}
|
|
30
30
|
export interface RestManager {
|
|
31
31
|
/** The bot token which will be used to make requests. */
|
|
32
|
-
token
|
|
32
|
+
token?: string;
|
|
33
33
|
/** The application id. Normally this is not required for recent bots but old bot's application id is sometimes different from the bot id so it is required for those bots. */
|
|
34
34
|
applicationId: bigint;
|
|
35
35
|
/** The api version to use when making requests. Only the latest supported version will be tested. */
|
|
@@ -40,6 +40,12 @@ export interface RestManager {
|
|
|
40
40
|
* @default https://discord.com/api
|
|
41
41
|
*/
|
|
42
42
|
baseUrl: string;
|
|
43
|
+
/**
|
|
44
|
+
* `true` if the `baseUrl` does not start with `https://discord.com/api`.
|
|
45
|
+
*
|
|
46
|
+
* Mostly used only for intern functions.
|
|
47
|
+
*/
|
|
48
|
+
isProxied: boolean;
|
|
43
49
|
/** The authorization header to attach when sending requests to the proxy. */
|
|
44
50
|
authorization?: string;
|
|
45
51
|
/** The maximum amount of times a request should be retried. Defaults to Infinity */
|
|
@@ -58,34 +64,43 @@ export interface RestManager {
|
|
|
58
64
|
invalidBucket: InvalidRequestBucket;
|
|
59
65
|
/** The routes that are available for this manager. */
|
|
60
66
|
routes: RestRoutes;
|
|
67
|
+
/** Allows the user to inject custom headers that will be sent with every request. */
|
|
68
|
+
createBaseHeaders: () => Record<string, string>;
|
|
69
|
+
/** Whether or not the rest manager should keep objects in raw snake case from discord. */
|
|
70
|
+
preferSnakeCase: (enabled: boolean) => RestManager;
|
|
61
71
|
/** Check the rate limits for a url or a bucket. */
|
|
62
|
-
checkRateLimits: (url: string) => number | false;
|
|
72
|
+
checkRateLimits: (url: string, headers?: Record<string, string>) => number | false;
|
|
63
73
|
/** Reshapes and modifies the obj as needed to make it ready for discords api. */
|
|
64
74
|
changeToDiscordFormat: (obj: any) => any;
|
|
65
75
|
/** Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord. */
|
|
66
|
-
|
|
76
|
+
createRequestBody: (method: RequestMethods, options?: CreateRequestBodyOptions) => RequestBody;
|
|
67
77
|
/** This will create a infinite loop running in 1 seconds using tail recursion to keep rate limits clean. When a rate limit resets, this will remove it so the queue can proceed. */
|
|
68
78
|
processRateLimitedPaths: () => void;
|
|
69
|
-
/**
|
|
70
|
-
|
|
79
|
+
/**
|
|
80
|
+
* Processes the rate limit headers and determines if it needs to be rate limited and returns the bucket id if available
|
|
81
|
+
*
|
|
82
|
+
* @remarks
|
|
83
|
+
* The authenticationHeader should be defined ONLY if the request was done using a OAuth2 Access Token, in other cases it should be passed as an empty string
|
|
84
|
+
*/
|
|
85
|
+
processHeaders: (url: string, headers: Headers, authenticationHeader?: string) => string | undefined;
|
|
71
86
|
/** Sends a request to the api. */
|
|
72
87
|
sendRequest: (options: SendRequestOptions) => Promise<void>;
|
|
73
88
|
/** Split a url to separate rate limit buckets based on major/minor parameters. */
|
|
74
89
|
simplifyUrl: (url: string, method: RequestMethods) => string;
|
|
75
90
|
/** Make a request to be sent to the api. */
|
|
76
|
-
makeRequest: <T = unknown>(method: RequestMethods, url: string,
|
|
91
|
+
makeRequest: <T = unknown>(method: RequestMethods, url: string, options?: MakeRequestOptions) => Promise<T>;
|
|
77
92
|
/** Takes a request and processes it into a queue. */
|
|
78
|
-
processRequest: (request: SendRequestOptions) => void
|
|
93
|
+
processRequest: (request: SendRequestOptions) => Promise<void>;
|
|
79
94
|
/** Make a get request to the api */
|
|
80
|
-
get: <T = void>(url: string) => Promise<Camelize<T>>;
|
|
95
|
+
get: <T = void>(url: string, options?: Omit<MakeRequestOptions, 'body'>) => Promise<Camelize<T>>;
|
|
81
96
|
/** Make a post request to the api. */
|
|
82
|
-
post: <T = void>(url: string,
|
|
97
|
+
post: <T = void>(url: string, options?: MakeRequestOptions) => Promise<Camelize<T>>;
|
|
83
98
|
/** Make a put request to the api. */
|
|
84
|
-
put: <T = void>(url: string,
|
|
99
|
+
put: <T = void>(url: string, options?: MakeRequestOptions) => Promise<Camelize<T>>;
|
|
85
100
|
/** Make a delete request to the api. */
|
|
86
|
-
delete: (url: string,
|
|
101
|
+
delete: (url: string, options?: Omit<MakeRequestOptions, 'body'>) => Promise<void>;
|
|
87
102
|
/** Make a patch request to the api. */
|
|
88
|
-
patch: <T = void>(url: string,
|
|
103
|
+
patch: <T = void>(url: string, options?: MakeRequestOptions) => Promise<Camelize<T>>;
|
|
89
104
|
/**
|
|
90
105
|
* Adds a reaction to a message.
|
|
91
106
|
*
|
|
@@ -130,6 +145,7 @@ export interface RestManager {
|
|
|
130
145
|
* @param guildId - The ID of the guild the member to add the role to is in.
|
|
131
146
|
* @param userId - The user ID of the member to add the role to.
|
|
132
147
|
* @param roleId - The ID of the role to add to the member.
|
|
148
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
133
149
|
*
|
|
134
150
|
* @remarks
|
|
135
151
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -154,12 +170,42 @@ export interface RestManager {
|
|
|
154
170
|
* @see {@link https://discord.com/developers/docs/resources/channel#add-thread-member}
|
|
155
171
|
*/
|
|
156
172
|
addThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
173
|
+
/**
|
|
174
|
+
* Adds a recipient to a group DM.
|
|
175
|
+
*
|
|
176
|
+
* @param channelId - The ID of the group dm to add the user to.
|
|
177
|
+
* @param userId - The user ID of the user to add to the group dm.
|
|
178
|
+
* @param options - The options for adding the user
|
|
179
|
+
*
|
|
180
|
+
* @remarks
|
|
181
|
+
* Requires an OAuth2 access token with the `gdm.join` scope
|
|
182
|
+
*
|
|
183
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#group-dm-add-recipient}
|
|
184
|
+
*/
|
|
185
|
+
addDmRecipient: (channelId: BigString, userId: BigString, options: AddDmRecipientOptions) => Promise<void>;
|
|
186
|
+
/**
|
|
187
|
+
* Adds a member to a guild.
|
|
188
|
+
*
|
|
189
|
+
* @param guildId - The ID of the thread to add the member to.
|
|
190
|
+
* @param userId - The user ID of the member to add to the thread.
|
|
191
|
+
* @param options - The options for the add of a guild member
|
|
192
|
+
*
|
|
193
|
+
* @remarks
|
|
194
|
+
* Requires the bot to be in the specified server
|
|
195
|
+
* Requires an OAuth2 access token with the `guilds.join` scope
|
|
196
|
+
*
|
|
197
|
+
* Fires a _Guild Member Add_ gateway event.
|
|
198
|
+
*
|
|
199
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#add-guild-member}
|
|
200
|
+
*/
|
|
201
|
+
addGuildMember: (guildId: BigString, userId: BigString, options: AddGuildMemberOptions) => Promise<void>;
|
|
157
202
|
/**
|
|
158
203
|
* Creates an automod rule in a guild.
|
|
159
204
|
*
|
|
160
205
|
* @param guildId - The ID of the guild to create the rule in.
|
|
161
206
|
* @param options - The parameters for the creation of the rule.
|
|
162
|
-
* @
|
|
207
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
208
|
+
* @returns An instance of the created {@link CamelizedDiscordAutoModerationRule}.
|
|
163
209
|
*
|
|
164
210
|
* @remarks
|
|
165
211
|
* Requires the `MANAGE_GUILD` permission.
|
|
@@ -168,13 +214,14 @@ export interface RestManager {
|
|
|
168
214
|
*
|
|
169
215
|
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule}
|
|
170
216
|
*/
|
|
171
|
-
createAutomodRule: (guildId: BigString, options: CreateAutoModerationRuleOptions) => Promise<
|
|
217
|
+
createAutomodRule: (guildId: BigString, options: CreateAutoModerationRuleOptions, reason?: string) => Promise<CamelizedDiscordAutoModerationRule>;
|
|
172
218
|
/**
|
|
173
219
|
* Creates a channel within a guild.
|
|
174
220
|
*
|
|
175
221
|
* @param guildId - The ID of the guild to create the channel within.
|
|
176
222
|
* @param options - The parameters for the creation of the channel.
|
|
177
|
-
* @
|
|
223
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
224
|
+
* @returns An instance of the created {@link CamelizedDiscordChannel}.
|
|
178
225
|
*
|
|
179
226
|
* @remarks
|
|
180
227
|
* Requires the `MANAGE_CHANNELS` permission.
|
|
@@ -187,13 +234,14 @@ export interface RestManager {
|
|
|
187
234
|
*
|
|
188
235
|
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-channel}
|
|
189
236
|
*/
|
|
190
|
-
createChannel: (guildId: BigString, options: CreateGuildChannel) => Promise<
|
|
237
|
+
createChannel: (guildId: BigString, options: CreateGuildChannel, reason?: string) => Promise<CamelizedDiscordChannel>;
|
|
191
238
|
/**
|
|
192
239
|
* Creates an emoji in a guild.
|
|
193
240
|
*
|
|
194
241
|
* @param guildId - The ID of the guild in which to create the emoji.
|
|
195
242
|
* @param options - The parameters for the creation of the emoji.
|
|
196
|
-
* @
|
|
243
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
244
|
+
* @returns An instance of the created {@link CamelizedDiscordEmoji}.
|
|
197
245
|
*
|
|
198
246
|
* @remarks
|
|
199
247
|
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
@@ -204,13 +252,14 @@ export interface RestManager {
|
|
|
204
252
|
*
|
|
205
253
|
* @see {@link https://discord.com/developers/docs/resources/emoji#create-guild-emoji}
|
|
206
254
|
*/
|
|
207
|
-
createEmoji: (guildId: BigString, options: CreateGuildEmoji) => Promise<
|
|
255
|
+
createEmoji: (guildId: BigString, options: CreateGuildEmoji, reason?: string) => Promise<CamelizedDiscordEmoji>;
|
|
208
256
|
/**
|
|
209
257
|
* Creates a new thread in a forum channel, and sends a message within the created thread.
|
|
210
258
|
*
|
|
211
259
|
* @param channelId - The ID of the forum channel to create the thread within.
|
|
212
260
|
* @param options - The parameters for the creation of the thread.
|
|
213
|
-
* @
|
|
261
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
262
|
+
* @returns An instance of {@link CamelizedDiscordChannel} with a nested {@link Message} object.
|
|
214
263
|
*
|
|
215
264
|
* @remarks
|
|
216
265
|
* Requires the `CREATE_MESSAGES` permission.
|
|
@@ -222,11 +271,12 @@ export interface RestManager {
|
|
|
222
271
|
*
|
|
223
272
|
* @experimental
|
|
224
273
|
*/
|
|
225
|
-
createForumThread: (channelId: BigString, options: CreateForumPostWithMessage) => Promise<
|
|
274
|
+
createForumThread: (channelId: BigString, options: CreateForumPostWithMessage, reason?: string) => Promise<CamelizedDiscordChannel>;
|
|
226
275
|
/**
|
|
227
276
|
* Creates an application command accessible globally; across different guilds and channels.
|
|
228
277
|
*
|
|
229
278
|
* @param command - The command to create.
|
|
279
|
+
* @param options - Additional options for the endpoint
|
|
230
280
|
* @returns An instance of the created {@link ApplicationCommand}.
|
|
231
281
|
*
|
|
232
282
|
* @remarks
|
|
@@ -234,14 +284,17 @@ export interface RestManager {
|
|
|
234
284
|
* ⚠️ Global commands once created are cached for periods of __an hour__, so changes made to existing commands will take an hour to surface.
|
|
235
285
|
* ⚠️ You can only create up to 200 _new_ commands daily.
|
|
236
286
|
*
|
|
287
|
+
* When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
|
|
288
|
+
* You will be able to update only your own application commands
|
|
289
|
+
*
|
|
237
290
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-global-application-command}
|
|
238
291
|
*/
|
|
239
|
-
createGlobalApplicationCommand: (command: CreateApplicationCommand) => Promise<
|
|
292
|
+
createGlobalApplicationCommand: (command: CreateApplicationCommand, options?: CreateGlobalApplicationCommandOptions) => Promise<CamelizedDiscordApplicationCommand>;
|
|
240
293
|
/**
|
|
241
294
|
* Creates a guild.
|
|
242
295
|
*
|
|
243
296
|
* @param options - The parameters for the creation of the guild.
|
|
244
|
-
* @returns An instance of the created {@link
|
|
297
|
+
* @returns An instance of the created {@link CamelizedDiscordGuild}.
|
|
245
298
|
*
|
|
246
299
|
* @remarks
|
|
247
300
|
* ⚠️ This route can only be used by bots in __fewer than 10 guilds__.
|
|
@@ -250,21 +303,25 @@ export interface RestManager {
|
|
|
250
303
|
*
|
|
251
304
|
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild}
|
|
252
305
|
*/
|
|
253
|
-
createGuild: (options: CreateGuild) => Promise<
|
|
306
|
+
createGuild: (options: CreateGuild) => Promise<CamelizedDiscordGuild>;
|
|
254
307
|
/**
|
|
255
308
|
* Creates an application command only accessible in a specific guild.
|
|
256
309
|
*
|
|
257
310
|
* @param command - The command to create.
|
|
258
311
|
* @param guildId - The ID of the guild to create the command for.
|
|
312
|
+
* @param options - Additional options for the endpoint
|
|
259
313
|
* @returns An instance of the created {@link ApplicationCommand}.
|
|
260
314
|
*
|
|
261
315
|
* @remarks
|
|
262
316
|
* ⚠️ Creating a command with the same name as an existing command for your application will overwrite the old command.
|
|
263
317
|
* ⚠️ You can only create up to 200 _new_ commands daily.
|
|
264
318
|
*
|
|
319
|
+
* When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
|
|
320
|
+
* You will be able to update only your own application commands
|
|
321
|
+
*
|
|
265
322
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
|
|
266
323
|
*/
|
|
267
|
-
createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString) => Promise<
|
|
324
|
+
createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString, options?: CreateGuildApplicationCommandOptions) => Promise<CamelizedDiscordApplicationCommand>;
|
|
268
325
|
/**
|
|
269
326
|
* Creates a guild from a template.
|
|
270
327
|
*
|
|
@@ -279,12 +336,13 @@ export interface RestManager {
|
|
|
279
336
|
*
|
|
280
337
|
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template}
|
|
281
338
|
*/
|
|
282
|
-
createGuildFromTemplate: (templateCode: string, options: CreateGuildFromTemplate) => Promise<
|
|
339
|
+
createGuildFromTemplate: (templateCode: string, options: CreateGuildFromTemplate) => Promise<CamelizedDiscordGuild>;
|
|
283
340
|
/**
|
|
284
341
|
* Create a new sticker for the guild.
|
|
285
342
|
*
|
|
286
343
|
* @param guildId The ID of the guild to get
|
|
287
|
-
* @
|
|
344
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
345
|
+
* @return A {@link CamelizedDiscordSticker}
|
|
288
346
|
*
|
|
289
347
|
* @remarks
|
|
290
348
|
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
@@ -294,7 +352,7 @@ export interface RestManager {
|
|
|
294
352
|
*
|
|
295
353
|
* @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
|
|
296
354
|
*/
|
|
297
|
-
createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions) => Promise<
|
|
355
|
+
createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions, reason?: string) => Promise<CamelizedDiscordSticker>;
|
|
298
356
|
/**
|
|
299
357
|
* Creates a template from a guild.
|
|
300
358
|
*
|
|
@@ -309,13 +367,14 @@ export interface RestManager {
|
|
|
309
367
|
*
|
|
310
368
|
* @see {@link https://discord.com/developers/docs/resources/guild-template#create-guild-template}
|
|
311
369
|
*/
|
|
312
|
-
createGuildTemplate: (guildId: BigString, options: CreateTemplate) => Promise<
|
|
370
|
+
createGuildTemplate: (guildId: BigString, options: CreateTemplate) => Promise<CamelizedDiscordTemplate>;
|
|
313
371
|
/**
|
|
314
372
|
* Creates an invite to a channel in a guild.
|
|
315
373
|
*
|
|
316
374
|
* @param channelId - The ID of the channel to create the invite to.
|
|
317
375
|
* @param options - The parameters for the creation of the invite.
|
|
318
|
-
* @
|
|
376
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
377
|
+
* @returns An instance of the created {@link CamelizedDiscordInvite}.
|
|
319
378
|
*
|
|
320
379
|
* @remarks
|
|
321
380
|
* Requires the `CREATE_INSTANT_INVITE` permission.
|
|
@@ -327,13 +386,14 @@ export interface RestManager {
|
|
|
327
386
|
*
|
|
328
387
|
* @see {@link https://discord.com/developers/docs/resources/channel#create-channel-invite}
|
|
329
388
|
*/
|
|
330
|
-
createInvite: (channelId: BigString, options?: CreateChannelInvite) => Promise<
|
|
389
|
+
createInvite: (channelId: BigString, options?: CreateChannelInvite, reason?: string) => Promise<CamelizedDiscordInvite>;
|
|
331
390
|
/**
|
|
332
391
|
* Creates a role in a guild.
|
|
333
392
|
*
|
|
334
393
|
* @param guildId - The ID of the guild to create the role in.
|
|
335
394
|
* @param options - The parameters for the creation of the role.
|
|
336
|
-
* @
|
|
395
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
396
|
+
* @returns An instance of the created {@link CamelizedDiscordRole}.
|
|
337
397
|
*
|
|
338
398
|
* @remarks
|
|
339
399
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -342,12 +402,13 @@ export interface RestManager {
|
|
|
342
402
|
*
|
|
343
403
|
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-role}
|
|
344
404
|
*/
|
|
345
|
-
createRole: (guildId: BigString, options: CreateGuildRole, reason?: string) => Promise<
|
|
405
|
+
createRole: (guildId: BigString, options: CreateGuildRole, reason?: string) => Promise<CamelizedDiscordRole>;
|
|
346
406
|
/**
|
|
347
407
|
* Creates a scheduled event in a guild.
|
|
348
408
|
*
|
|
349
409
|
* @param guildId - The ID of the guild to create the scheduled event in.
|
|
350
410
|
* @param options - The parameters for the creation of the scheduled event.
|
|
411
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
351
412
|
* @returns An instance of the created {@link ScheduledEvent}.
|
|
352
413
|
*
|
|
353
414
|
* @remarks
|
|
@@ -359,12 +420,13 @@ export interface RestManager {
|
|
|
359
420
|
*
|
|
360
421
|
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event}
|
|
361
422
|
*/
|
|
362
|
-
createScheduledEvent: (guildId: BigString, options: CreateScheduledEvent) => Promise<
|
|
423
|
+
createScheduledEvent: (guildId: BigString, options: CreateScheduledEvent, reason?: string) => Promise<CamelizedDiscordScheduledEvent>;
|
|
363
424
|
/**
|
|
364
425
|
* Creates a stage instance associated with a stage channel.
|
|
365
426
|
*
|
|
366
427
|
* @param options - The parameters for the creation of the stage instance.
|
|
367
|
-
* @
|
|
428
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
429
|
+
* @returns An instance of the created {@link CamelizedDiscordStageInstance}.
|
|
368
430
|
*
|
|
369
431
|
* @remarks
|
|
370
432
|
* Requires the user to be a moderator of the stage channel.
|
|
@@ -373,29 +435,31 @@ export interface RestManager {
|
|
|
373
435
|
*
|
|
374
436
|
* @see {@link https://discord.com/developers/docs/resources/stage-instance#create-stage-instance}
|
|
375
437
|
*/
|
|
376
|
-
createStageInstance: (options: CreateStageInstance) => Promise<
|
|
438
|
+
createStageInstance: (options: CreateStageInstance, reason?: string) => Promise<CamelizedDiscordStageInstance>;
|
|
377
439
|
/**
|
|
378
440
|
* Creates a webhook.
|
|
379
441
|
*
|
|
380
442
|
* @param channelId - The ID of the channel to create the webhook in.
|
|
381
443
|
* @param options - The parameters for the creation of the webhook.
|
|
382
|
-
* @
|
|
444
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
445
|
+
* @returns An instance of the created {@link CamelizedDiscordWebhook}.
|
|
383
446
|
*
|
|
384
447
|
* @remarks
|
|
385
448
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
386
449
|
*
|
|
387
|
-
* ⚠️ The webhook name must not contain the
|
|
450
|
+
* ⚠️ The webhook name must not contain the substrings 'clyde', or 'discord' (case-insensitive).
|
|
388
451
|
*
|
|
389
452
|
* Fires a _Webhooks Update_ gateway event.
|
|
390
453
|
*
|
|
391
454
|
* @see {@link https://discord.com/developers/docs/resources/webhook#create-webhook}
|
|
392
455
|
*/
|
|
393
|
-
createWebhook: (channelId: BigString, options: CreateWebhook) => Promise<
|
|
456
|
+
createWebhook: (channelId: BigString, options: CreateWebhook, reason?: string) => Promise<CamelizedDiscordWebhook>;
|
|
394
457
|
/**
|
|
395
458
|
* Deletes an automod rule.
|
|
396
459
|
*
|
|
397
460
|
* @param guildId - The ID of the guild to delete the rule from.
|
|
398
461
|
* @param ruleId - The ID of the automod rule to delete.
|
|
462
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
399
463
|
*
|
|
400
464
|
* @remarks
|
|
401
465
|
* Requires the `MANAGE_GUILD` permission.
|
|
@@ -409,6 +473,7 @@ export interface RestManager {
|
|
|
409
473
|
* Deletes a channel from within a guild.
|
|
410
474
|
*
|
|
411
475
|
* @param channelId - The ID of the channel to delete.
|
|
476
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
412
477
|
* @returns An instance of the deleted {@link Channel}.
|
|
413
478
|
*
|
|
414
479
|
* @remarks
|
|
@@ -435,6 +500,7 @@ export interface RestManager {
|
|
|
435
500
|
*
|
|
436
501
|
* @param channelId - The ID of the channel to delete the permission override of.
|
|
437
502
|
* @param overwriteId - The ID of the permission override to delete.
|
|
503
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
438
504
|
*
|
|
439
505
|
* @remarks
|
|
440
506
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -449,6 +515,7 @@ export interface RestManager {
|
|
|
449
515
|
*
|
|
450
516
|
* @param guildId - The ID of the guild from which to delete the emoji.
|
|
451
517
|
* @param id - The ID of the emoji to delete.
|
|
518
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
452
519
|
*
|
|
453
520
|
* @remarks
|
|
454
521
|
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
@@ -506,7 +573,8 @@ export interface RestManager {
|
|
|
506
573
|
* Delete a new sticker for the guild.
|
|
507
574
|
*
|
|
508
575
|
* @param guildId The ID of the guild to get
|
|
509
|
-
* @
|
|
576
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
577
|
+
* @return A {@link CamelizedDiscordSticker}
|
|
510
578
|
*
|
|
511
579
|
* @remarks
|
|
512
580
|
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
@@ -536,6 +604,7 @@ export interface RestManager {
|
|
|
536
604
|
*
|
|
537
605
|
* @param guildId - The ID of the guild from which to delete the integration.
|
|
538
606
|
* @param integrationId - The ID of the integration to delete from the guild.
|
|
607
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
539
608
|
*
|
|
540
609
|
* @remarks
|
|
541
610
|
* Requires the `MANAGE_GUILD` permission.
|
|
@@ -547,11 +616,12 @@ export interface RestManager {
|
|
|
547
616
|
*
|
|
548
617
|
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-integration}
|
|
549
618
|
*/
|
|
550
|
-
deleteIntegration: (guildId: BigString, integrationId: BigString) => Promise<void>;
|
|
619
|
+
deleteIntegration: (guildId: BigString, integrationId: BigString, reason?: string) => Promise<void>;
|
|
551
620
|
/**
|
|
552
621
|
* Deletes an invite to a channel.
|
|
553
622
|
*
|
|
554
623
|
* @param inviteCode - The invite code of the invite to delete.
|
|
624
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
555
625
|
*
|
|
556
626
|
* @remarks
|
|
557
627
|
* Requires the `MANAGE_CHANNELS` permission.
|
|
@@ -566,6 +636,7 @@ export interface RestManager {
|
|
|
566
636
|
*
|
|
567
637
|
* @param channelId - The ID of the channel to delete the message from.
|
|
568
638
|
* @param messageId - The ID of the message to delete from the channel.
|
|
639
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
569
640
|
*
|
|
570
641
|
* @remarks
|
|
571
642
|
* If not deleting own message:
|
|
@@ -581,6 +652,7 @@ export interface RestManager {
|
|
|
581
652
|
*
|
|
582
653
|
* @param channelId - The ID of the channel to delete the messages from.
|
|
583
654
|
* @param messageIds - The IDs of the messages to delete from the channel.
|
|
655
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
584
656
|
*
|
|
585
657
|
* @remarks
|
|
586
658
|
* Requires the `MANAGE_MESSAGES` permission.
|
|
@@ -658,6 +730,7 @@ export interface RestManager {
|
|
|
658
730
|
*
|
|
659
731
|
* @param guildId - The ID of the guild to delete the role from.
|
|
660
732
|
* @param roleId - The ID of the role to delete.
|
|
733
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
661
734
|
*
|
|
662
735
|
* @remarks
|
|
663
736
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -666,7 +739,7 @@ export interface RestManager {
|
|
|
666
739
|
*
|
|
667
740
|
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild-role}
|
|
668
741
|
*/
|
|
669
|
-
deleteRole: (guildId: BigString, roleId: BigString) => Promise<void>;
|
|
742
|
+
deleteRole: (guildId: BigString, roleId: BigString, reason?: string) => Promise<void>;
|
|
670
743
|
/**
|
|
671
744
|
* Deletes a scheduled event from a guild.
|
|
672
745
|
*
|
|
@@ -685,6 +758,7 @@ export interface RestManager {
|
|
|
685
758
|
* Deletes the stage instance associated with a stage channel, if one exists.
|
|
686
759
|
*
|
|
687
760
|
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
761
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
688
762
|
*
|
|
689
763
|
* @remarks
|
|
690
764
|
* Requires the user to be a moderator of the stage channel.
|
|
@@ -765,14 +839,15 @@ export interface RestManager {
|
|
|
765
839
|
*
|
|
766
840
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-application-command-permissions}
|
|
767
841
|
*/
|
|
768
|
-
editApplicationCommandPermissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: ApplicationCommandPermissions[]) => Promise<
|
|
842
|
+
editApplicationCommandPermissions: (guildId: BigString, commandId: BigString, bearerToken: string, options: ApplicationCommandPermissions[]) => Promise<CamelizedDiscordGuildApplicationCommandPermissions>;
|
|
769
843
|
/**
|
|
770
844
|
* Edits an automod rule.
|
|
771
845
|
*
|
|
772
846
|
* @param guildId - The ID of the guild to edit the rule in.
|
|
773
847
|
* @param ruleId - The ID of the rule to edit.
|
|
774
848
|
* @param options - The parameters for the edit of the rule.
|
|
775
|
-
* @
|
|
849
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
850
|
+
* @returns An instance of the edited {@link CamelizedDiscordAutoModerationRule}.
|
|
776
851
|
*
|
|
777
852
|
* @remarks
|
|
778
853
|
* Requires the `MANAGE_GUILD` permission.
|
|
@@ -781,7 +856,7 @@ export interface RestManager {
|
|
|
781
856
|
*
|
|
782
857
|
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule}
|
|
783
858
|
*/
|
|
784
|
-
editAutomodRule: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions
|
|
859
|
+
editAutomodRule: (guildId: BigString, ruleId: BigString, options: Partial<EditAutoModerationRuleOptions>, reason?: string) => Promise<CamelizedDiscordAutoModerationRule>;
|
|
785
860
|
/**
|
|
786
861
|
* Modifies the bot's username or avatar.
|
|
787
862
|
* NOTE: username: if changed may cause the bot's discriminator to be randomized.
|
|
@@ -789,13 +864,14 @@ export interface RestManager {
|
|
|
789
864
|
editBotProfile: (options: {
|
|
790
865
|
username?: string;
|
|
791
866
|
botAvatarURL?: string | null;
|
|
792
|
-
}) => Promise<
|
|
867
|
+
}) => Promise<CamelizedDiscordUser>;
|
|
793
868
|
/**
|
|
794
869
|
* Edits a channel's settings.
|
|
795
870
|
*
|
|
796
871
|
* @param channelId - The ID of the channel to edit.
|
|
797
872
|
* @param options - The parameters for the edit of the channel.
|
|
798
|
-
* @
|
|
873
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
874
|
+
* @returns An instance of the edited {@link CamelizedDiscordChannel}.
|
|
799
875
|
*
|
|
800
876
|
* @remarks
|
|
801
877
|
* If editing a channel of type {@link ChannelTypes.GroupDm}:
|
|
@@ -819,12 +895,13 @@ export interface RestManager {
|
|
|
819
895
|
* - Otherwise:
|
|
820
896
|
* - Fires a _Channel Update_ gateway event.
|
|
821
897
|
*/
|
|
822
|
-
editChannel: (channelId: BigString, options: ModifyChannel) => Promise<
|
|
898
|
+
editChannel: (channelId: BigString, options: ModifyChannel, reason?: string) => Promise<CamelizedDiscordChannel>;
|
|
823
899
|
/**
|
|
824
900
|
* Edits the permission overrides for a user or role in a channel.
|
|
825
901
|
*
|
|
826
902
|
* @param channelId - The ID of the channel to edit the permission overrides of.
|
|
827
903
|
* @param options - The permission override.
|
|
904
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
828
905
|
*
|
|
829
906
|
* @remarks
|
|
830
907
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -835,7 +912,7 @@ export interface RestManager {
|
|
|
835
912
|
*
|
|
836
913
|
* @see {@link https://discord.com/developers/docs/resources/channel#edit-channel-permissions}
|
|
837
914
|
*/
|
|
838
|
-
editChannelPermissionOverrides: (channelId: BigString, options: EditChannelPermissionOverridesOptions) => Promise<void>;
|
|
915
|
+
editChannelPermissionOverrides: (channelId: BigString, options: EditChannelPermissionOverridesOptions, reason?: string) => Promise<void>;
|
|
839
916
|
/**
|
|
840
917
|
* Edits the positions of a set of channels in a guild.
|
|
841
918
|
*
|
|
@@ -856,7 +933,8 @@ export interface RestManager {
|
|
|
856
933
|
* @param guildId - The ID of the guild in which to edit the emoji.
|
|
857
934
|
* @param id - The ID of the emoji to edit.
|
|
858
935
|
* @param options - The parameters for the edit of the emoji.
|
|
859
|
-
* @
|
|
936
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
937
|
+
* @returns An instance of the updated {@link CamelizedDiscordEmoji}.
|
|
860
938
|
*
|
|
861
939
|
* @remarks
|
|
862
940
|
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
@@ -865,7 +943,7 @@ export interface RestManager {
|
|
|
865
943
|
*
|
|
866
944
|
* @see {@link https://discord.com/developers/docs/resources/emoji#modify-guild-emoji}
|
|
867
945
|
*/
|
|
868
|
-
editEmoji: (guildId: BigString, id: BigString, options: ModifyGuildEmoji) => Promise<
|
|
946
|
+
editEmoji: (guildId: BigString, id: BigString, options: ModifyGuildEmoji, reason?: string) => Promise<CamelizedDiscordEmoji>;
|
|
869
947
|
/**
|
|
870
948
|
* Edits a follow-up message to an interaction.
|
|
871
949
|
*
|
|
@@ -883,7 +961,7 @@ export interface RestManager {
|
|
|
883
961
|
*
|
|
884
962
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-followup-message}
|
|
885
963
|
*/
|
|
886
|
-
editFollowupMessage: (token: string, messageId: BigString, options: InteractionCallbackData) => Promise<
|
|
964
|
+
editFollowupMessage: (token: string, messageId: BigString, options: InteractionCallbackData) => Promise<CamelizedDiscordMessage>;
|
|
887
965
|
/**
|
|
888
966
|
* Edits a global application command.
|
|
889
967
|
*
|
|
@@ -893,13 +971,14 @@ export interface RestManager {
|
|
|
893
971
|
*
|
|
894
972
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
|
|
895
973
|
*/
|
|
896
|
-
editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<
|
|
974
|
+
editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<CamelizedDiscordApplicationCommand>;
|
|
897
975
|
/**
|
|
898
976
|
* Edits a guild's settings.
|
|
899
977
|
*
|
|
900
978
|
* @param guildId - The ID of the guild to edit.
|
|
901
979
|
* @param shardId - The ID of the shard the guild is in.
|
|
902
980
|
* @param options - The parameters for the edit of the guild.
|
|
981
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
903
982
|
* @returns An instance of the edited {@link Guild}.
|
|
904
983
|
*
|
|
905
984
|
* @remarks
|
|
@@ -912,7 +991,7 @@ export interface RestManager {
|
|
|
912
991
|
*
|
|
913
992
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
|
|
914
993
|
*/
|
|
915
|
-
editGuild: (guildId: BigString, options: ModifyGuild) => Promise<
|
|
994
|
+
editGuild: (guildId: BigString, options: ModifyGuild, reason?: string) => Promise<CamelizedDiscordGuild>;
|
|
916
995
|
/**
|
|
917
996
|
* Edits an application command registered in a guild.
|
|
918
997
|
*
|
|
@@ -923,14 +1002,17 @@ export interface RestManager {
|
|
|
923
1002
|
*
|
|
924
1003
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
|
|
925
1004
|
*/
|
|
926
|
-
editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<
|
|
927
|
-
/** Modify a guild's MFA level. Requires guild ownership.
|
|
1005
|
+
editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<CamelizedDiscordApplicationCommand>;
|
|
1006
|
+
/** Modify a guild's MFA level. Requires guild ownership.
|
|
1007
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1008
|
+
*/
|
|
928
1009
|
editGuildMfaLevel: (guildId: BigString, mfaLevel: MfaLevels, reason?: string) => Promise<void>;
|
|
929
1010
|
/**
|
|
930
1011
|
* Edit the given sticker.
|
|
931
1012
|
*
|
|
932
1013
|
* @param guildId The ID of the guild to get
|
|
933
|
-
* @
|
|
1014
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1015
|
+
* @return A {@link CamelizedDiscordSticker}
|
|
934
1016
|
*
|
|
935
1017
|
* @remarks
|
|
936
1018
|
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
@@ -938,7 +1020,7 @@ export interface RestManager {
|
|
|
938
1020
|
*
|
|
939
1021
|
* @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
|
|
940
1022
|
*/
|
|
941
|
-
editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions
|
|
1023
|
+
editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>, reason?: string) => Promise<CamelizedDiscordSticker>;
|
|
942
1024
|
/**
|
|
943
1025
|
* Edits a template's settings.
|
|
944
1026
|
*
|
|
@@ -954,7 +1036,7 @@ export interface RestManager {
|
|
|
954
1036
|
*
|
|
955
1037
|
* @see {@link https://discord.com/developers/docs/resources/guild-template#modify-guild-template}
|
|
956
1038
|
*/
|
|
957
|
-
editGuildTemplate: (guildId: BigString, templateCode: string, options: ModifyGuildTemplate) => Promise<
|
|
1039
|
+
editGuildTemplate: (guildId: BigString, templateCode: string, options: ModifyGuildTemplate) => Promise<CamelizedDiscordTemplate>;
|
|
958
1040
|
/**
|
|
959
1041
|
* Edits a message.
|
|
960
1042
|
*
|
|
@@ -972,7 +1054,7 @@ export interface RestManager {
|
|
|
972
1054
|
*
|
|
973
1055
|
* @see {@link https://discord.com/developers/docs/resources/channel#edit-message}
|
|
974
1056
|
*/
|
|
975
|
-
editMessage: (channelId: BigString, messageId: BigString, options: EditMessage) => Promise<
|
|
1057
|
+
editMessage: (channelId: BigString, messageId: BigString, options: EditMessage) => Promise<CamelizedDiscordMessage>;
|
|
976
1058
|
/**
|
|
977
1059
|
* Edits the initial message response to an interaction.
|
|
978
1060
|
*
|
|
@@ -989,14 +1071,14 @@ export interface RestManager {
|
|
|
989
1071
|
*
|
|
990
1072
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#edit-original-interaction-response}
|
|
991
1073
|
*/
|
|
992
|
-
editOriginalInteractionResponse: (token: string, options: InteractionCallbackData) => Promise<
|
|
1074
|
+
editOriginalInteractionResponse: (token: string, options: InteractionCallbackData) => Promise<CamelizedDiscordMessage>;
|
|
993
1075
|
/**
|
|
994
1076
|
* Edits the original webhook message.
|
|
995
1077
|
*
|
|
996
1078
|
* @param webhookId - The ID of the webhook to edit the original message of.
|
|
997
1079
|
* @param token - The webhook token, used to edit the message.
|
|
998
1080
|
* @param options - The parameters for the edit of the message.
|
|
999
|
-
* @returns An instance of the edited {@link
|
|
1081
|
+
* @returns An instance of the edited {@link CamelizedDiscordMessage}.
|
|
1000
1082
|
*
|
|
1001
1083
|
* @remarks
|
|
1002
1084
|
* Fires a _Message Update_ gateway event.
|
|
@@ -1005,7 +1087,7 @@ export interface RestManager {
|
|
|
1005
1087
|
*/
|
|
1006
1088
|
editOriginalWebhookMessage: (webhookId: BigString, token: string, options: InteractionCallbackData & {
|
|
1007
1089
|
threadId?: BigString;
|
|
1008
|
-
}) => Promise<
|
|
1090
|
+
}) => Promise<CamelizedDiscordMessage>;
|
|
1009
1091
|
/**
|
|
1010
1092
|
* Edits the voice state of the bot user.
|
|
1011
1093
|
*
|
|
@@ -1030,7 +1112,8 @@ export interface RestManager {
|
|
|
1030
1112
|
* @param guildId - The ID of the guild to edit the role in.
|
|
1031
1113
|
* @param roleId - The ID of the role to edit.
|
|
1032
1114
|
* @param options - The parameters for the edit of the role.
|
|
1033
|
-
* @
|
|
1115
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1116
|
+
* @returns An instance of the edited {@link CamelizedDiscordRole}.
|
|
1034
1117
|
*
|
|
1035
1118
|
* @remarks
|
|
1036
1119
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -1039,13 +1122,14 @@ export interface RestManager {
|
|
|
1039
1122
|
*
|
|
1040
1123
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role}
|
|
1041
1124
|
*/
|
|
1042
|
-
editRole: (guildId: BigString, roleId: BigString, options: EditGuildRole) => Promise<
|
|
1125
|
+
editRole: (guildId: BigString, roleId: BigString, options: EditGuildRole, reason?: string) => Promise<CamelizedDiscordRole>;
|
|
1043
1126
|
/**
|
|
1044
1127
|
* Edits the positions of a set of roles.
|
|
1045
1128
|
*
|
|
1046
1129
|
* @param guildId - The ID of the guild to edit the role positions in.
|
|
1047
1130
|
* @param options - The parameters for the edit of the role positions.
|
|
1048
|
-
* @
|
|
1131
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1132
|
+
* @returns A collection of {@link CamelizedDiscordRole} objects assorted by role ID.
|
|
1049
1133
|
*
|
|
1050
1134
|
* @remarks
|
|
1051
1135
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -1054,12 +1138,13 @@ export interface RestManager {
|
|
|
1054
1138
|
*
|
|
1055
1139
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-role-positions}
|
|
1056
1140
|
*/
|
|
1057
|
-
editRolePositions: (guildId: BigString, options: ModifyRolePositions[]) => Promise<
|
|
1141
|
+
editRolePositions: (guildId: BigString, options: ModifyRolePositions[], reason?: string) => Promise<CamelizedDiscordRole[]>;
|
|
1058
1142
|
/**
|
|
1059
1143
|
* Edits a scheduled event.
|
|
1060
1144
|
*
|
|
1061
1145
|
* @param guildId - The ID of the guild to edit the scheduled event in.
|
|
1062
1146
|
* @param eventId - The ID of the scheduled event to edit.
|
|
1147
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1063
1148
|
* @returns An instance of the edited {@link ScheduledEvent}.
|
|
1064
1149
|
*
|
|
1065
1150
|
* @remarks
|
|
@@ -1073,12 +1158,14 @@ export interface RestManager {
|
|
|
1073
1158
|
*
|
|
1074
1159
|
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event}
|
|
1075
1160
|
*/
|
|
1076
|
-
editScheduledEvent: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent
|
|
1161
|
+
editScheduledEvent: (guildId: BigString, eventId: BigString, options: Partial<EditScheduledEvent>, reason?: string) => Promise<CamelizedDiscordScheduledEvent>;
|
|
1077
1162
|
/**
|
|
1078
1163
|
* Edits a stage instance.
|
|
1079
1164
|
*
|
|
1080
1165
|
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
1081
|
-
* @
|
|
1166
|
+
* @param topic - Topic of the Stage instance (1-120 characters).
|
|
1167
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1168
|
+
* @returns An instance of the updated {@link CamelizedDiscordStageInstance}.
|
|
1082
1169
|
*
|
|
1083
1170
|
* @remarks
|
|
1084
1171
|
* Requires the user to be a moderator of the stage channel.
|
|
@@ -1087,7 +1174,7 @@ export interface RestManager {
|
|
|
1087
1174
|
*
|
|
1088
1175
|
* @see {@link https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance}
|
|
1089
1176
|
*/
|
|
1090
|
-
editStageInstance: (channelId: BigString,
|
|
1177
|
+
editStageInstance: (channelId: BigString, topic: string, reason?: string) => Promise<CamelizedDiscordStageInstance>;
|
|
1091
1178
|
/**
|
|
1092
1179
|
* Edits the voice state of another user.
|
|
1093
1180
|
*
|
|
@@ -1102,11 +1189,26 @@ export interface RestManager {
|
|
|
1102
1189
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state}
|
|
1103
1190
|
*/
|
|
1104
1191
|
editUserVoiceState: (guildId: BigString, options: EditUserVoiceState) => Promise<void>;
|
|
1192
|
+
/**
|
|
1193
|
+
* Edit the current user application role connection for the application.
|
|
1194
|
+
*
|
|
1195
|
+
* @param bearerToken - The access token of the user
|
|
1196
|
+
* @param applicationId - The id of the application to edit the role connection
|
|
1197
|
+
* @param options - The options to edit
|
|
1198
|
+
* @returns {CamelizedDiscordApplicationRoleConnection}
|
|
1199
|
+
*
|
|
1200
|
+
* @remarks
|
|
1201
|
+
* This requires the `role_connections.write` scope.
|
|
1202
|
+
*
|
|
1203
|
+
* @see {@link https://discord.com/developers/docs/resources/user#update-user-application-role-connection}
|
|
1204
|
+
*/
|
|
1205
|
+
editUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString, options: CamelizedDiscordApplicationRoleConnection) => Promise<CamelizedDiscordApplicationRoleConnection>;
|
|
1105
1206
|
/**
|
|
1106
1207
|
* Edits a webhook.
|
|
1107
1208
|
*
|
|
1108
1209
|
* @param webhookId - The ID of the webhook to edit.
|
|
1109
|
-
* @
|
|
1210
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1211
|
+
* @returns An instance of the edited {@link CamelizedDiscordWebhook}.
|
|
1110
1212
|
*
|
|
1111
1213
|
* @remarks
|
|
1112
1214
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
@@ -1115,7 +1217,7 @@ export interface RestManager {
|
|
|
1115
1217
|
*
|
|
1116
1218
|
* @see {@link https://discord.com/developers/docs/resources/webhook#edit-webhook}
|
|
1117
1219
|
*/
|
|
1118
|
-
editWebhook: (webhookId: BigString, options: ModifyWebhook) => Promise<
|
|
1220
|
+
editWebhook: (webhookId: BigString, options: ModifyWebhook, reason?: string) => Promise<CamelizedDiscordWebhook>;
|
|
1119
1221
|
/**
|
|
1120
1222
|
* Edits a webhook message.
|
|
1121
1223
|
*
|
|
@@ -1123,7 +1225,7 @@ export interface RestManager {
|
|
|
1123
1225
|
* @param token - The webhook token, used to edit the message.
|
|
1124
1226
|
* @param messageId - The ID of the message to edit.
|
|
1125
1227
|
* @param options - The parameters for the edit of the message.
|
|
1126
|
-
* @returns An instance of the edited {@link
|
|
1228
|
+
* @returns An instance of the edited {@link CamelizedDiscordMessage}.
|
|
1127
1229
|
*
|
|
1128
1230
|
* @remarks
|
|
1129
1231
|
* Fires a _Message Update_ gateway event.
|
|
@@ -1132,13 +1234,13 @@ export interface RestManager {
|
|
|
1132
1234
|
*/
|
|
1133
1235
|
editWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options: InteractionCallbackData & {
|
|
1134
1236
|
threadId?: BigString;
|
|
1135
|
-
}) => Promise<
|
|
1237
|
+
}) => Promise<CamelizedDiscordMessage>;
|
|
1136
1238
|
/**
|
|
1137
1239
|
* Edits a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
1138
1240
|
*
|
|
1139
1241
|
* @param webhookId - The ID of the webhook to edit.
|
|
1140
1242
|
* @param token - The webhook token, used to edit the webhook.
|
|
1141
|
-
* @returns An instance of the edited {@link
|
|
1243
|
+
* @returns An instance of the edited {@link CamelizedDiscordWebhook}.
|
|
1142
1244
|
*
|
|
1143
1245
|
* @remarks
|
|
1144
1246
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
@@ -1147,12 +1249,13 @@ export interface RestManager {
|
|
|
1147
1249
|
*
|
|
1148
1250
|
* @see {@link https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token}
|
|
1149
1251
|
*/
|
|
1150
|
-
editWebhookWithToken: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<
|
|
1252
|
+
editWebhookWithToken: (webhookId: BigString, token: string, options: Omit<ModifyWebhook, 'channelId'>) => Promise<CamelizedDiscordWebhook>;
|
|
1151
1253
|
/**
|
|
1152
1254
|
* Edits a guild's welcome screen.
|
|
1153
1255
|
*
|
|
1154
1256
|
* @param guildId - The ID of the guild to edit the welcome screen of.
|
|
1155
1257
|
* @param options - The parameters for the edit of the welcome screen.
|
|
1258
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1156
1259
|
* @returns An instance of the edited {@link WelcomeScreen}.
|
|
1157
1260
|
*
|
|
1158
1261
|
* @remarks
|
|
@@ -1162,11 +1265,12 @@ export interface RestManager {
|
|
|
1162
1265
|
*
|
|
1163
1266
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen}
|
|
1164
1267
|
*/
|
|
1165
|
-
editWelcomeScreen: (guildId: BigString, options:
|
|
1268
|
+
editWelcomeScreen: (guildId: BigString, options: CamelizedDiscordModifyGuildWelcomeScreen, reason?: string) => Promise<CamelizedDiscordWelcomeScreen>;
|
|
1166
1269
|
/**
|
|
1167
1270
|
* Edits the settings of a guild's widget.
|
|
1168
1271
|
*
|
|
1169
1272
|
* @param guildId - The ID of the guild to edit the settings of the widget of.
|
|
1273
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1170
1274
|
* @returns An instance of the edited {@link GuildWidgetSettings}.
|
|
1171
1275
|
*
|
|
1172
1276
|
* @remarks
|
|
@@ -1176,27 +1280,27 @@ export interface RestManager {
|
|
|
1176
1280
|
*
|
|
1177
1281
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-widget}
|
|
1178
1282
|
*/
|
|
1179
|
-
editWidgetSettings: (guildId: BigString, options:
|
|
1283
|
+
editWidgetSettings: (guildId: BigString, options: CamelizedDiscordGuildWidgetSettings, reason?: string) => Promise<CamelizedDiscordGuildWidgetSettings>;
|
|
1180
1284
|
/**
|
|
1181
1285
|
* Executes a webhook, causing a message to be posted in the channel configured for the webhook.
|
|
1182
1286
|
*
|
|
1183
1287
|
* @param webhookId - The ID of the webhook to execute.
|
|
1184
1288
|
* @param token - The webhook token, used to execute the webhook.
|
|
1185
1289
|
* @param options - The parameters for the execution of the webhook.
|
|
1186
|
-
* @returns An instance of the created {@link
|
|
1290
|
+
* @returns An instance of the created {@link CamelizedDiscordMessage}, or `undefined` if the {@link ExecuteWebhook.wait | wait} property of the {@link options} object parameter is set to `false`.
|
|
1187
1291
|
*
|
|
1188
1292
|
* @remarks
|
|
1189
1293
|
* If the webhook channel is a forum channel, you must provide a value for either `threadId` or `threadName`.
|
|
1190
1294
|
*
|
|
1191
1295
|
* @see {@link https://discord.com/developers/docs/resources/webhook#execute-webhook}
|
|
1192
1296
|
*/
|
|
1193
|
-
executeWebhook: (webhookId: BigString, token: string, options: ExecuteWebhook) => Promise<
|
|
1297
|
+
executeWebhook: (webhookId: BigString, token: string, options: ExecuteWebhook) => Promise<CamelizedDiscordMessage | undefined>;
|
|
1194
1298
|
/**
|
|
1195
1299
|
* Follows an announcement channel, allowing messages posted within it to be cross-posted into the target channel.
|
|
1196
1300
|
*
|
|
1197
1301
|
* @param sourceChannelId - The ID of the announcement channel to follow.
|
|
1198
1302
|
* @param targetChannelId - The ID of the target channel - the channel to cross-post to.
|
|
1199
|
-
* @returns An instance of {@link
|
|
1303
|
+
* @returns An instance of {@link CamelizedDiscordFollowedChannel}.
|
|
1200
1304
|
*
|
|
1201
1305
|
* @remarks
|
|
1202
1306
|
* Requires the `MANAGE_WEBHOOKS` permission in the __target channel__.
|
|
@@ -1205,12 +1309,12 @@ export interface RestManager {
|
|
|
1205
1309
|
*
|
|
1206
1310
|
* @see {@link https://discord.com/developers/docs/resources/channel#follow-announcement-channel}
|
|
1207
1311
|
*/
|
|
1208
|
-
followAnnouncement: (sourceChannelId: BigString, targetChannelId: BigString) => Promise<
|
|
1312
|
+
followAnnouncement: (sourceChannelId: BigString, targetChannelId: BigString) => Promise<CamelizedDiscordFollowedChannel>;
|
|
1209
1313
|
/**
|
|
1210
1314
|
* Gets the list of all active threads for a guild.
|
|
1211
1315
|
*
|
|
1212
1316
|
* @param guildId - The ID of the guild to get the threads of.
|
|
1213
|
-
* @returns An instance of {@link
|
|
1317
|
+
* @returns An instance of {@link CamelizedDiscordActiveThreads}.
|
|
1214
1318
|
*
|
|
1215
1319
|
* @remarks
|
|
1216
1320
|
* Returns both public and private threads.
|
|
@@ -1219,28 +1323,59 @@ export interface RestManager {
|
|
|
1219
1323
|
*
|
|
1220
1324
|
* @see {@link https://discord.com/developers/docs/resources/guild#list-active-guild-threads}
|
|
1221
1325
|
*/
|
|
1222
|
-
getActiveThreads: (guildId: BigString) => Promise<
|
|
1326
|
+
getActiveThreads: (guildId: BigString) => Promise<CamelizedDiscordActiveThreads>;
|
|
1223
1327
|
/** Get the applications info */
|
|
1224
|
-
getApplicationInfo: () => Promise<
|
|
1328
|
+
getApplicationInfo: () => Promise<CamelizedDiscordApplication>;
|
|
1329
|
+
/**
|
|
1330
|
+
* Get the current authentication info for the authenticated user
|
|
1331
|
+
*
|
|
1332
|
+
* @param bearerToken - Any OAuth2 derived access token
|
|
1333
|
+
* @returns An instance of {@link CamelizedDiscordCurrentAuthorization}
|
|
1334
|
+
*
|
|
1335
|
+
* @remarks
|
|
1336
|
+
* The user object is not defined if the scopes do not include `identify`.
|
|
1337
|
+
* In the user object, if defined, the email is not included if the scopes do not include `email`
|
|
1338
|
+
*/
|
|
1339
|
+
getCurrentAuthenticationInfo: (bearerToken: string) => Promise<CamelizedDiscordCurrentAuthorization>;
|
|
1340
|
+
/**
|
|
1341
|
+
* Exchange the information to get a OAuth2 accessToken token
|
|
1342
|
+
*
|
|
1343
|
+
* @param options - The options to make the exchange with discord
|
|
1344
|
+
*/
|
|
1345
|
+
exchangeToken: (options: CamelizedDiscordTokenExchange) => Promise<CamelizedDiscordAccessTokenResponse>;
|
|
1346
|
+
/**
|
|
1347
|
+
* Revoke an access_token
|
|
1348
|
+
*
|
|
1349
|
+
* @param options - The options to revoke the access_token
|
|
1350
|
+
*/
|
|
1351
|
+
revokeToken: (options: CamelizedDiscordTokenRevocation) => Promise<void>;
|
|
1225
1352
|
/**
|
|
1226
1353
|
* Gets the permissions of a guild application command.
|
|
1227
1354
|
*
|
|
1228
1355
|
* @param guildId - The ID of the guild the command is registered in.
|
|
1229
1356
|
* @param commandId - The ID of the command to get the permissions of.
|
|
1357
|
+
* @param options - The OAuth2 related optional parameters for the endpoint
|
|
1230
1358
|
* @returns An instance of {@link ApplicationCommandPermission}.
|
|
1231
1359
|
*
|
|
1360
|
+
* @remarks
|
|
1361
|
+
* Then specifying the options object the access token passed-in requires the OAuth2 scope `applications.commands.permissions.update`
|
|
1362
|
+
*
|
|
1232
1363
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-application-command-permissions}
|
|
1233
1364
|
*/
|
|
1234
|
-
getApplicationCommandPermission: (guildId: BigString, commandId: BigString) => Promise<
|
|
1365
|
+
getApplicationCommandPermission: (guildId: BigString, commandId: BigString, options?: GetApplicationCommandPermissionOptions) => Promise<CamelizedDiscordGuildApplicationCommandPermissions>;
|
|
1235
1366
|
/**
|
|
1236
|
-
* Gets the permissions of all application commands registered in a guild by the ID of the guild.
|
|
1367
|
+
* Gets the permissions of all application commands registered in a guild by the ID of the guild and optionally an external application.
|
|
1237
1368
|
*
|
|
1238
1369
|
* @param guildId - The ID of the guild to get the permissions objects of.
|
|
1370
|
+
* @param options - The OAuth2 related optional parameters for the endpoint
|
|
1239
1371
|
* @returns A collection of {@link ApplicationCommandPermission} objects assorted by command ID.
|
|
1240
1372
|
*
|
|
1373
|
+
* @remarks
|
|
1374
|
+
* Then specifying the options object the access token passed-in requires the OAuth2 scope `applications.commands.permissions.update`
|
|
1375
|
+
*
|
|
1241
1376
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
|
|
1242
1377
|
*/
|
|
1243
|
-
getApplicationCommandPermissions: (guildId: BigString) => Promise<
|
|
1378
|
+
getApplicationCommandPermissions: (guildId: BigString, options?: GetApplicationCommandPermissionOptions) => Promise<CamelizedDiscordGuildApplicationCommandPermissions[]>;
|
|
1244
1379
|
/**
|
|
1245
1380
|
* Gets a guild's audit log.
|
|
1246
1381
|
*
|
|
@@ -1253,57 +1388,57 @@ export interface RestManager {
|
|
|
1253
1388
|
*
|
|
1254
1389
|
* @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
|
|
1255
1390
|
*/
|
|
1256
|
-
getAuditLog: (guildId: BigString, options?: GetGuildAuditLog) => Promise<
|
|
1391
|
+
getAuditLog: (guildId: BigString, options?: GetGuildAuditLog) => Promise<CamelizedDiscordAuditLog>;
|
|
1257
1392
|
/**
|
|
1258
1393
|
* Gets an automod rule by its ID.
|
|
1259
1394
|
*
|
|
1260
1395
|
* @param guildId - The ID of the guild to get the rule of.
|
|
1261
1396
|
* @param ruleId - The ID of the rule to get.
|
|
1262
|
-
* @returns An instance of {@link
|
|
1397
|
+
* @returns An instance of {@link CamelizedDiscordAutoModerationRule}.
|
|
1263
1398
|
*
|
|
1264
1399
|
* @remarks
|
|
1265
1400
|
* Requires the `MANAGE_GUILD` permission.
|
|
1266
1401
|
*
|
|
1267
1402
|
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule}
|
|
1268
1403
|
*/
|
|
1269
|
-
getAutomodRule: (guildId: BigString, ruleId: BigString) => Promise<
|
|
1404
|
+
getAutomodRule: (guildId: BigString, ruleId: BigString) => Promise<CamelizedDiscordAutoModerationRule>;
|
|
1270
1405
|
/**
|
|
1271
1406
|
* Gets the list of automod rules for a guild.
|
|
1272
1407
|
*
|
|
1273
1408
|
* @param guildId - The ID of the guild to get the rules from.
|
|
1274
|
-
* @returns A collection of {@link
|
|
1409
|
+
* @returns A collection of {@link CamelizedDiscordAutoModerationRule} objects assorted by rule ID.
|
|
1275
1410
|
*
|
|
1276
1411
|
* @remarks
|
|
1277
1412
|
* Requires the `MANAGE_GUILD` permission.
|
|
1278
1413
|
*
|
|
1279
1414
|
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
|
|
1280
1415
|
*/
|
|
1281
|
-
getAutomodRules: (guildId: BigString) => Promise<
|
|
1416
|
+
getAutomodRules: (guildId: BigString) => Promise<CamelizedDiscordAutoModerationRule[]>;
|
|
1282
1417
|
/**
|
|
1283
1418
|
* Gets the list of available voice regions.
|
|
1284
1419
|
*
|
|
1285
1420
|
* @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
|
|
1286
1421
|
*/
|
|
1287
|
-
getAvailableVoiceRegions: () => Promise<
|
|
1422
|
+
getAvailableVoiceRegions: () => Promise<CamelizedDiscordVoiceRegion[]>;
|
|
1288
1423
|
/**
|
|
1289
1424
|
* Gets a ban by user ID.
|
|
1290
1425
|
*
|
|
1291
1426
|
* @param guildId - The ID of the guild to get the ban from.
|
|
1292
1427
|
* @param userId - The ID of the user to get the ban for.
|
|
1293
|
-
* @returns An instance of {@link
|
|
1428
|
+
* @returns An instance of {@link CamelizedDiscordBan}.
|
|
1294
1429
|
*
|
|
1295
1430
|
* @remarks
|
|
1296
1431
|
* Requires the `BAN_MEMBERS` permission.
|
|
1297
1432
|
*
|
|
1298
1433
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
|
|
1299
1434
|
*/
|
|
1300
|
-
getBan: (guildId: BigString, userId: BigString) => Promise<
|
|
1435
|
+
getBan: (guildId: BigString, userId: BigString) => Promise<CamelizedDiscordBan>;
|
|
1301
1436
|
/**
|
|
1302
1437
|
* Gets the list of bans for a guild.
|
|
1303
1438
|
*
|
|
1304
1439
|
* @param guildId - The ID of the guild to get the list of bans for.
|
|
1305
1440
|
* @param options - The parameters for the fetching of the list of bans.
|
|
1306
|
-
* @returns A collection of {@link
|
|
1441
|
+
* @returns A collection of {@link CamelizedDiscordBan} objects assorted by user ID.
|
|
1307
1442
|
*
|
|
1308
1443
|
* @remarks
|
|
1309
1444
|
* Requires the `BAN_MEMBERS` permission.
|
|
@@ -1312,24 +1447,24 @@ export interface RestManager {
|
|
|
1312
1447
|
*
|
|
1313
1448
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
|
|
1314
1449
|
*/
|
|
1315
|
-
getBans: (guildId: BigString, options?: GetBans) => Promise<
|
|
1450
|
+
getBans: (guildId: BigString, options?: GetBans) => Promise<CamelizedDiscordBan[]>;
|
|
1316
1451
|
/**
|
|
1317
1452
|
* Gets a channel by its ID.
|
|
1318
1453
|
*
|
|
1319
1454
|
* @param channelId - The ID of the channel to get.
|
|
1320
|
-
* @returns An instance of {@link
|
|
1455
|
+
* @returns An instance of {@link CamelizedDiscordChannel}.
|
|
1321
1456
|
*
|
|
1322
1457
|
* @remarks
|
|
1323
1458
|
* If the channel is a thread, a {@link ThreadMember} object is included in the result.
|
|
1324
1459
|
*
|
|
1325
1460
|
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel}
|
|
1326
1461
|
*/
|
|
1327
|
-
getChannel: (channelId: BigString) => Promise<
|
|
1462
|
+
getChannel: (channelId: BigString) => Promise<CamelizedDiscordChannel>;
|
|
1328
1463
|
/**
|
|
1329
1464
|
* Gets the list of invites for a channel.
|
|
1330
1465
|
*
|
|
1331
1466
|
* @param channelId - The ID of the channel to get the invites of.
|
|
1332
|
-
* @returns A collection of {@link
|
|
1467
|
+
* @returns A collection of {@link CamelizedDiscordInviteMetadata} objects assorted by invite code.
|
|
1333
1468
|
*
|
|
1334
1469
|
* @remarks
|
|
1335
1470
|
* Requires the `MANAGE_CHANNELS` permission.
|
|
@@ -1338,59 +1473,75 @@ export interface RestManager {
|
|
|
1338
1473
|
*
|
|
1339
1474
|
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-invites}
|
|
1340
1475
|
*/
|
|
1341
|
-
getChannelInvites: (channelId: BigString) => Promise<
|
|
1476
|
+
getChannelInvites: (channelId: BigString) => Promise<CamelizedDiscordInviteMetadata[]>;
|
|
1342
1477
|
/**
|
|
1343
1478
|
* Gets the list of channels for a guild.
|
|
1344
1479
|
*
|
|
1345
1480
|
* @param guildId - The ID of the guild to get the channels of.
|
|
1346
|
-
* @returns A collection of {@link
|
|
1481
|
+
* @returns A collection of {@link CamelizedDiscordChannel} objects assorted by channel ID.
|
|
1347
1482
|
*
|
|
1348
1483
|
* @remarks
|
|
1349
1484
|
* Excludes threads.
|
|
1350
1485
|
*
|
|
1351
1486
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-channels}
|
|
1352
1487
|
*/
|
|
1353
|
-
getChannels: (guildId: BigString) => Promise<
|
|
1488
|
+
getChannels: (guildId: BigString) => Promise<CamelizedDiscordChannel[]>;
|
|
1354
1489
|
/**
|
|
1355
1490
|
* Gets a list of webhooks for a channel.
|
|
1356
1491
|
*
|
|
1357
1492
|
* @param channelId - The ID of the channel which to get the webhooks of.
|
|
1358
|
-
* @returns A collection of {@link
|
|
1493
|
+
* @returns A collection of {@link CamelizedDiscordWebhook} objects assorted by webhook ID.
|
|
1359
1494
|
*
|
|
1360
1495
|
* @remarks
|
|
1361
1496
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1362
1497
|
*
|
|
1363
1498
|
* @see {@link https://discord.com/developers/docs/resources/webhook#get-channel-webhooks}
|
|
1364
1499
|
*/
|
|
1365
|
-
getChannelWebhooks: (channelId: BigString) => Promise<
|
|
1500
|
+
getChannelWebhooks: (channelId: BigString) => Promise<CamelizedDiscordWebhook[]>;
|
|
1366
1501
|
/**
|
|
1367
1502
|
* Gets or creates a DM channel with a user.
|
|
1368
1503
|
*
|
|
1369
1504
|
* @param userId - The ID of the user to create the DM channel with.
|
|
1370
|
-
* @returns An instance of {@link
|
|
1505
|
+
* @returns An instance of {@link CamelizedDiscordChannel}.
|
|
1371
1506
|
*
|
|
1372
1507
|
* @see {@link https://discord.com/developers/docs/resources/user#create-dm}
|
|
1373
1508
|
*/
|
|
1374
|
-
getDmChannel: (userId: BigString) => Promise<
|
|
1509
|
+
getDmChannel: (userId: BigString) => Promise<CamelizedDiscordChannel>;
|
|
1510
|
+
/**
|
|
1511
|
+
* Create a new group DM channel with multiple users.
|
|
1512
|
+
*
|
|
1513
|
+
* @param options - The options for create a new group dm
|
|
1514
|
+
* @returns An instance of {@link CamelizedDiscordChannel}.
|
|
1515
|
+
*
|
|
1516
|
+
* @remarks
|
|
1517
|
+
* The access tokens require to have the `gdm.join` scope
|
|
1518
|
+
*
|
|
1519
|
+
* This endpoint is limited to 10 active group DMs.
|
|
1520
|
+
*
|
|
1521
|
+
* Fires a _Channel create_ gateway event.
|
|
1522
|
+
*
|
|
1523
|
+
* @see {@link https://discord.com/developers/docs/resources/user#create-group-dm}
|
|
1524
|
+
*/
|
|
1525
|
+
getGroupDmChannel: (options: GetGroupDmOptions) => Promise<CamelizedDiscordChannel>;
|
|
1375
1526
|
/**
|
|
1376
1527
|
* Gets an emoji by its ID.
|
|
1377
1528
|
*
|
|
1378
1529
|
* @param guildId - The ID of the guild from which to get the emoji.
|
|
1379
1530
|
* @param emojiId - The ID of the emoji to get.
|
|
1380
|
-
* @returns An instance of {@link
|
|
1531
|
+
* @returns An instance of {@link CamelizedDiscordEmoji}.
|
|
1381
1532
|
*
|
|
1382
1533
|
* @see {@link https://discord.com/developers/docs/resources/emoji#get-guild-emoji}
|
|
1383
1534
|
*/
|
|
1384
|
-
getEmoji: (guildId: BigString, emojiId: BigString) => Promise<
|
|
1535
|
+
getEmoji: (guildId: BigString, emojiId: BigString) => Promise<CamelizedDiscordEmoji>;
|
|
1385
1536
|
/**
|
|
1386
1537
|
* Gets the list of emojis for a guild.
|
|
1387
1538
|
*
|
|
1388
1539
|
* @param guildId - The ID of the guild which to get the emojis of.
|
|
1389
|
-
* @returns A collection of {@link
|
|
1540
|
+
* @returns A collection of {@link CamelizedDiscordEmoji} objects assorted by emoji ID.
|
|
1390
1541
|
*
|
|
1391
1542
|
* @see {@link https://discord.com/developers/docs/resources/emoji#list-guild-emojis}
|
|
1392
1543
|
*/
|
|
1393
|
-
getEmojis: (guildId: BigString) => Promise<
|
|
1544
|
+
getEmojis: (guildId: BigString) => Promise<CamelizedDiscordEmoji[]>;
|
|
1394
1545
|
/**
|
|
1395
1546
|
* Gets a follow-up message to an interaction by the ID of the message.
|
|
1396
1547
|
*
|
|
@@ -1407,9 +1558,9 @@ export interface RestManager {
|
|
|
1407
1558
|
*
|
|
1408
1559
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-followup-message}
|
|
1409
1560
|
*/
|
|
1410
|
-
getFollowupMessage: (token: string, messageId: BigString) => Promise<
|
|
1561
|
+
getFollowupMessage: (token: string, messageId: BigString) => Promise<CamelizedDiscordMessage>;
|
|
1411
1562
|
/** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
|
|
1412
|
-
getGatewayBot: () => Promise<
|
|
1563
|
+
getGatewayBot: () => Promise<CamelizedDiscordGetGatewayBot>;
|
|
1413
1564
|
/**
|
|
1414
1565
|
* Gets a global application command by its ID.
|
|
1415
1566
|
*
|
|
@@ -1418,7 +1569,7 @@ export interface RestManager {
|
|
|
1418
1569
|
*
|
|
1419
1570
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-command}
|
|
1420
1571
|
*/
|
|
1421
|
-
getGlobalApplicationCommand: (commandId: BigString) => Promise<
|
|
1572
|
+
getGlobalApplicationCommand: (commandId: BigString) => Promise<CamelizedDiscordApplicationCommand>;
|
|
1422
1573
|
/**
|
|
1423
1574
|
* Gets the list of your bot's global application commands.
|
|
1424
1575
|
*
|
|
@@ -1426,7 +1577,7 @@ export interface RestManager {
|
|
|
1426
1577
|
*
|
|
1427
1578
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
|
|
1428
1579
|
*/
|
|
1429
|
-
getGlobalApplicationCommands: () => Promise<
|
|
1580
|
+
getGlobalApplicationCommands: () => Promise<CamelizedDiscordApplicationCommand[]>;
|
|
1430
1581
|
/**
|
|
1431
1582
|
* Gets a guild by its ID.
|
|
1432
1583
|
*
|
|
@@ -1438,7 +1589,20 @@ export interface RestManager {
|
|
|
1438
1589
|
*/
|
|
1439
1590
|
getGuild: (guildId: BigString, options?: {
|
|
1440
1591
|
counts?: boolean;
|
|
1441
|
-
}) => Promise<
|
|
1592
|
+
}) => Promise<CamelizedDiscordGuild>;
|
|
1593
|
+
/**
|
|
1594
|
+
* Get the user guilds.
|
|
1595
|
+
*
|
|
1596
|
+
* @param bearerToken - The access token of the user
|
|
1597
|
+
* @param options - The parameters for the fetching of the guild.
|
|
1598
|
+
* @returns An instance of {@link Guild}.
|
|
1599
|
+
*
|
|
1600
|
+
* @remarks
|
|
1601
|
+
* The access tokens needs to have the `guilds` scope
|
|
1602
|
+
*
|
|
1603
|
+
* @see {@link https://discord.com/developers/docs/resources/user#get-current-user-guilds}
|
|
1604
|
+
*/
|
|
1605
|
+
getGuilds: (bearerToken: string, options?: GetUserGuilds) => Promise<CamelizedDiscordPartialGuild[]>;
|
|
1442
1606
|
/**
|
|
1443
1607
|
* Gets a guild application command by its ID.
|
|
1444
1608
|
*
|
|
@@ -1448,7 +1612,7 @@ export interface RestManager {
|
|
|
1448
1612
|
*
|
|
1449
1613
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command}
|
|
1450
1614
|
*/
|
|
1451
|
-
getGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<
|
|
1615
|
+
getGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<CamelizedDiscordApplicationCommand>;
|
|
1452
1616
|
/**
|
|
1453
1617
|
* Gets the list of application commands registered by your bot in a guild.
|
|
1454
1618
|
*
|
|
@@ -1457,7 +1621,7 @@ export interface RestManager {
|
|
|
1457
1621
|
*
|
|
1458
1622
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
|
|
1459
1623
|
*/
|
|
1460
|
-
getGuildApplicationCommands: (guildId: BigString) => Promise<
|
|
1624
|
+
getGuildApplicationCommands: (guildId: BigString) => Promise<CamelizedDiscordApplicationCommand[]>;
|
|
1461
1625
|
/**
|
|
1462
1626
|
* Gets the preview of a guild by a guild's ID.
|
|
1463
1627
|
*
|
|
@@ -1465,34 +1629,34 @@ export interface RestManager {
|
|
|
1465
1629
|
* @returns An instance of {@link GuildPreview}.
|
|
1466
1630
|
*
|
|
1467
1631
|
* @remarks
|
|
1468
|
-
* If the bot user is not in the guild, the guild must be
|
|
1632
|
+
* If the bot user is not in the guild, the guild must be discoverable.
|
|
1469
1633
|
*
|
|
1470
1634
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-preview}
|
|
1471
1635
|
*/
|
|
1472
|
-
getGuildPreview: (guildId: BigString) => Promise<
|
|
1636
|
+
getGuildPreview: (guildId: BigString) => Promise<CamelizedDiscordGuildPreview>;
|
|
1473
1637
|
/**
|
|
1474
1638
|
* Returns a sticker object for the given guild and sticker IDs.
|
|
1475
1639
|
*
|
|
1476
1640
|
* @param guildId The ID of the guild to get
|
|
1477
1641
|
* @param stickerId The ID of the sticker to get
|
|
1478
|
-
* @return A {@link
|
|
1642
|
+
* @return A {@link CamelizedDiscordSticker}
|
|
1479
1643
|
*
|
|
1480
1644
|
* @remarks Includes the user field if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1481
1645
|
*
|
|
1482
1646
|
* @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
|
|
1483
1647
|
*/
|
|
1484
|
-
getGuildSticker: (guildId: BigString, stickerId: BigString) => Promise<
|
|
1648
|
+
getGuildSticker: (guildId: BigString, stickerId: BigString) => Promise<CamelizedDiscordSticker>;
|
|
1485
1649
|
/**
|
|
1486
1650
|
* Returns an array of sticker objects for the given guild.
|
|
1487
1651
|
*
|
|
1488
1652
|
* @param guildId The ID of the guild to get
|
|
1489
|
-
* @returns A collection of {@link
|
|
1653
|
+
* @returns A collection of {@link CamelizedDiscordSticker} objects assorted by sticker ID.
|
|
1490
1654
|
*
|
|
1491
1655
|
* @remarks Includes user fields if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1492
1656
|
*
|
|
1493
1657
|
* @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
|
|
1494
1658
|
*/
|
|
1495
|
-
getGuildStickers: (guildId: BigString) => Promise<
|
|
1659
|
+
getGuildStickers: (guildId: BigString) => Promise<CamelizedDiscordSticker[]>;
|
|
1496
1660
|
/**
|
|
1497
1661
|
* Gets a template by its code.
|
|
1498
1662
|
*
|
|
@@ -1504,7 +1668,7 @@ export interface RestManager {
|
|
|
1504
1668
|
*
|
|
1505
1669
|
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-template}
|
|
1506
1670
|
*/
|
|
1507
|
-
getGuildTemplate: (templateCode: string) => Promise<
|
|
1671
|
+
getGuildTemplate: (templateCode: string) => Promise<CamelizedDiscordTemplate>;
|
|
1508
1672
|
/**
|
|
1509
1673
|
* Gets the list of templates for a guild.
|
|
1510
1674
|
*
|
|
@@ -1516,19 +1680,19 @@ export interface RestManager {
|
|
|
1516
1680
|
*
|
|
1517
1681
|
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
|
|
1518
1682
|
*/
|
|
1519
|
-
getGuildTemplates: (guildId: BigString) => Promise<
|
|
1683
|
+
getGuildTemplates: (guildId: BigString) => Promise<CamelizedDiscordTemplate[]>;
|
|
1520
1684
|
/**
|
|
1521
1685
|
* Gets the list of webhooks for a guild.
|
|
1522
1686
|
*
|
|
1523
1687
|
* @param guildId - The ID of the guild to get the list of webhooks for.
|
|
1524
|
-
* @returns A collection of {@link
|
|
1688
|
+
* @returns A collection of {@link CamelizedDiscordWebhook} objects assorted by webhook ID.
|
|
1525
1689
|
*
|
|
1526
1690
|
* @remarks
|
|
1527
1691
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1528
1692
|
*
|
|
1529
1693
|
* @see {@link https://discord.com/developers/docs/resources/webhook#get-guild-webhooks}
|
|
1530
1694
|
*/
|
|
1531
|
-
getGuildWebhooks: (guildId: BigString) => Promise<
|
|
1695
|
+
getGuildWebhooks: (guildId: BigString) => Promise<CamelizedDiscordWebhook[]>;
|
|
1532
1696
|
/**
|
|
1533
1697
|
* Gets the list of integrations attached to a guild.
|
|
1534
1698
|
*
|
|
@@ -1540,17 +1704,17 @@ export interface RestManager {
|
|
|
1540
1704
|
*
|
|
1541
1705
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-integrations}
|
|
1542
1706
|
*/
|
|
1543
|
-
getIntegrations: (guildId: BigString) => Promise<
|
|
1707
|
+
getIntegrations: (guildId: BigString) => Promise<CamelizedDiscordIntegration[]>;
|
|
1544
1708
|
/**
|
|
1545
1709
|
* Gets an invite to a channel by its invite code.
|
|
1546
1710
|
*
|
|
1547
1711
|
* @param inviteCode - The invite code of the invite to get.
|
|
1548
1712
|
* @param options - The parameters for the fetching of the invite.
|
|
1549
|
-
* @returns An instance of {@link
|
|
1713
|
+
* @returns An instance of {@link CamelizedDiscordInviteMetadata}.
|
|
1550
1714
|
*
|
|
1551
1715
|
* @see {@link https://discord.com/developers/docs/resources/invite#get-invite}
|
|
1552
1716
|
*/
|
|
1553
|
-
getInvite: (inviteCode: string, options?: GetInvite) => Promise<
|
|
1717
|
+
getInvite: (inviteCode: string, options?: GetInvite) => Promise<CamelizedDiscordInviteMetadata>;
|
|
1554
1718
|
/**
|
|
1555
1719
|
* Gets the list of invites for a guild.
|
|
1556
1720
|
*
|
|
@@ -1562,7 +1726,7 @@ export interface RestManager {
|
|
|
1562
1726
|
*
|
|
1563
1727
|
* @see {@link https://discord.com/developers/docs/resources/invite#get-invites}
|
|
1564
1728
|
*/
|
|
1565
|
-
getInvites: (guildId: BigString) => Promise<
|
|
1729
|
+
getInvites: (guildId: BigString) => Promise<CamelizedDiscordInviteMetadata[]>;
|
|
1566
1730
|
/**
|
|
1567
1731
|
* Gets a message from a channel by the ID of the message.
|
|
1568
1732
|
*
|
|
@@ -1578,7 +1742,7 @@ export interface RestManager {
|
|
|
1578
1742
|
*
|
|
1579
1743
|
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-message}
|
|
1580
1744
|
*/
|
|
1581
|
-
getMessage: (channelId: BigString, messageId: BigString) => Promise<
|
|
1745
|
+
getMessage: (channelId: BigString, messageId: BigString) => Promise<CamelizedDiscordMessage>;
|
|
1582
1746
|
/**
|
|
1583
1747
|
* Gets multiple messages from a channel.
|
|
1584
1748
|
*
|
|
@@ -1594,7 +1758,7 @@ export interface RestManager {
|
|
|
1594
1758
|
*
|
|
1595
1759
|
* @see {@link https://discord.com/developers/docs/resources/channel#get-channel-messages}
|
|
1596
1760
|
*/
|
|
1597
|
-
getMessages: (channelId: BigString, options?: GetMessagesOptions) => Promise<
|
|
1761
|
+
getMessages: (channelId: BigString, options?: GetMessagesOptions) => Promise<CamelizedDiscordMessage[]>;
|
|
1598
1762
|
/**
|
|
1599
1763
|
* Returns the list of sticker packs available to Nitro subscribers.
|
|
1600
1764
|
*
|
|
@@ -1602,7 +1766,7 @@ export interface RestManager {
|
|
|
1602
1766
|
*
|
|
1603
1767
|
* @see {@link https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs}
|
|
1604
1768
|
*/
|
|
1605
|
-
getNitroStickerPacks: () => Promise<
|
|
1769
|
+
getNitroStickerPacks: () => Promise<CamelizedDiscordStickerPack[]>;
|
|
1606
1770
|
/**
|
|
1607
1771
|
* Gets the initial message response to an interaction.
|
|
1608
1772
|
*
|
|
@@ -1618,7 +1782,7 @@ export interface RestManager {
|
|
|
1618
1782
|
*
|
|
1619
1783
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response}
|
|
1620
1784
|
*/
|
|
1621
|
-
getOriginalInteractionResponse: (token: string) => Promise<
|
|
1785
|
+
getOriginalInteractionResponse: (token: string) => Promise<CamelizedDiscordMessage>;
|
|
1622
1786
|
/**
|
|
1623
1787
|
* Gets the pinned messages for a channel.
|
|
1624
1788
|
*
|
|
@@ -1633,13 +1797,13 @@ export interface RestManager {
|
|
|
1633
1797
|
*
|
|
1634
1798
|
* @see {@link https://discord.com/developers/docs/resources/channel#get-pinned-messages}
|
|
1635
1799
|
*/
|
|
1636
|
-
getPinnedMessages: (channelId: BigString) => Promise<
|
|
1800
|
+
getPinnedMessages: (channelId: BigString) => Promise<CamelizedDiscordMessage[]>;
|
|
1637
1801
|
/**
|
|
1638
1802
|
* Gets the list of private archived threads for a channel.
|
|
1639
1803
|
*
|
|
1640
1804
|
* @param channelId - The ID of the channel to get the archived threads for.
|
|
1641
1805
|
* @param options - The parameters for the fetching of threads.
|
|
1642
|
-
* @returns An instance of {@link
|
|
1806
|
+
* @returns An instance of {@link CamelizedDiscordArchivedThreads}.
|
|
1643
1807
|
*
|
|
1644
1808
|
* @remarks
|
|
1645
1809
|
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
@@ -1651,13 +1815,13 @@ export interface RestManager {
|
|
|
1651
1815
|
*
|
|
1652
1816
|
* @see {@link https://discord.com/developers/docs/resources/channel#list-private-archived-threads}
|
|
1653
1817
|
*/
|
|
1654
|
-
getPrivateArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<
|
|
1818
|
+
getPrivateArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<CamelizedDiscordArchivedThreads>;
|
|
1655
1819
|
/**
|
|
1656
1820
|
* Gets the list of private archived threads the bot is a member of for a channel.
|
|
1657
1821
|
*
|
|
1658
1822
|
* @param channelId - The ID of the channel to get the archived threads for.
|
|
1659
1823
|
* @param options - The parameters for the fetching of threads.
|
|
1660
|
-
* @returns An instance of {@link
|
|
1824
|
+
* @returns An instance of {@link CamelizedDiscordArchivedThreads}.
|
|
1661
1825
|
*
|
|
1662
1826
|
* @remarks
|
|
1663
1827
|
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
@@ -1668,7 +1832,7 @@ export interface RestManager {
|
|
|
1668
1832
|
*
|
|
1669
1833
|
* @see {@link https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads}
|
|
1670
1834
|
*/
|
|
1671
|
-
getPrivateJoinedArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<
|
|
1835
|
+
getPrivateJoinedArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<CamelizedDiscordArchivedThreads>;
|
|
1672
1836
|
/**
|
|
1673
1837
|
* Gets the number of members that would be kicked from a guild during pruning.
|
|
1674
1838
|
*
|
|
@@ -1681,7 +1845,7 @@ export interface RestManager {
|
|
|
1681
1845
|
*
|
|
1682
1846
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-prune-count}
|
|
1683
1847
|
*/
|
|
1684
|
-
getPruneCount: (guildId: BigString, options?: GetGuildPruneCountQuery) => Promise<
|
|
1848
|
+
getPruneCount: (guildId: BigString, options?: GetGuildPruneCountQuery) => Promise<CamelizedDiscordPrunedCount>;
|
|
1685
1849
|
/**
|
|
1686
1850
|
* Gets the list of public archived threads for a channel.
|
|
1687
1851
|
*
|
|
@@ -1699,7 +1863,7 @@ export interface RestManager {
|
|
|
1699
1863
|
*
|
|
1700
1864
|
* @see {@link https://discord.com/developers/docs/resources/channel#list-public-archived-threads}
|
|
1701
1865
|
*/
|
|
1702
|
-
getPublicArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<
|
|
1866
|
+
getPublicArchivedThreads: (channelId: BigString, options?: ListArchivedThreads) => Promise<CamelizedDiscordArchivedThreads>;
|
|
1703
1867
|
/**
|
|
1704
1868
|
* Gets the list of roles for a guild.
|
|
1705
1869
|
*
|
|
@@ -1711,7 +1875,7 @@ export interface RestManager {
|
|
|
1711
1875
|
*
|
|
1712
1876
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-roles}
|
|
1713
1877
|
*/
|
|
1714
|
-
getRoles: (guildId: BigString) => Promise<
|
|
1878
|
+
getRoles: (guildId: BigString) => Promise<CamelizedDiscordRole[]>;
|
|
1715
1879
|
/**
|
|
1716
1880
|
* Gets a scheduled event by its ID.
|
|
1717
1881
|
*
|
|
@@ -1724,7 +1888,7 @@ export interface RestManager {
|
|
|
1724
1888
|
*/
|
|
1725
1889
|
getScheduledEvent: (guildId: BigString, eventId: BigString, options?: {
|
|
1726
1890
|
withUserCount?: boolean;
|
|
1727
|
-
}) => Promise<
|
|
1891
|
+
}) => Promise<CamelizedDiscordScheduledEvent>;
|
|
1728
1892
|
/**
|
|
1729
1893
|
* Gets the list of scheduled events for a guild.
|
|
1730
1894
|
*
|
|
@@ -1734,7 +1898,7 @@ export interface RestManager {
|
|
|
1734
1898
|
*
|
|
1735
1899
|
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild}
|
|
1736
1900
|
*/
|
|
1737
|
-
getScheduledEvents: (guildId: BigString, options?: GetScheduledEvents) => Promise<
|
|
1901
|
+
getScheduledEvents: (guildId: BigString, options?: GetScheduledEvents) => Promise<CamelizedDiscordScheduledEvent[]>;
|
|
1738
1902
|
/**
|
|
1739
1903
|
* Gets the list of subscribers to a scheduled event from a guild.
|
|
1740
1904
|
*
|
|
@@ -1751,51 +1915,51 @@ export interface RestManager {
|
|
|
1751
1915
|
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users}
|
|
1752
1916
|
*/
|
|
1753
1917
|
getScheduledEventUsers: (guildId: BigString, eventId: BigString, options?: GetScheduledEventUsers) => Promise<Array<{
|
|
1754
|
-
user:
|
|
1755
|
-
member?:
|
|
1918
|
+
user: CamelizedDiscordUser;
|
|
1919
|
+
member?: CamelizedDiscordMember;
|
|
1756
1920
|
}>>;
|
|
1757
1921
|
/** Get the bots Gateway metadata that can help during the operation of large or sharded bots. */
|
|
1758
|
-
getSessionInfo: () => Promise<
|
|
1922
|
+
getSessionInfo: () => Promise<CamelizedDiscordGetGatewayBot>;
|
|
1759
1923
|
/**
|
|
1760
1924
|
* Gets the stage instance associated with a stage channel, if one exists.
|
|
1761
1925
|
*
|
|
1762
1926
|
* @param channelId - The ID of the stage channel the stage instance is associated with.
|
|
1763
|
-
* @returns An instance of {@link
|
|
1927
|
+
* @returns An instance of {@link CamelizedDiscordStageInstance}.
|
|
1764
1928
|
*
|
|
1765
1929
|
* @see {@link https://discord.com/developers/docs/resources/stage-instance#get-stage-instance}
|
|
1766
1930
|
*/
|
|
1767
|
-
getStageInstance: (channelId: BigString) => Promise<
|
|
1931
|
+
getStageInstance: (channelId: BigString) => Promise<CamelizedDiscordStageInstance>;
|
|
1768
1932
|
/**
|
|
1769
1933
|
* Returns a sticker object for the given sticker ID.
|
|
1770
1934
|
*
|
|
1771
1935
|
* @param stickerId The ID of the sticker to get
|
|
1772
|
-
* @returns A {@link
|
|
1936
|
+
* @returns A {@link CamelizedDiscordSticker}
|
|
1773
1937
|
*
|
|
1774
1938
|
* @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
|
|
1775
1939
|
*/
|
|
1776
|
-
getSticker: (stickerId: BigString) => Promise<
|
|
1940
|
+
getSticker: (stickerId: BigString) => Promise<CamelizedDiscordSticker>;
|
|
1777
1941
|
/**
|
|
1778
1942
|
* Gets a thread member by their user ID.
|
|
1779
1943
|
*
|
|
1780
1944
|
* @param channelId - The ID of the thread to get the thread member of.
|
|
1781
1945
|
* @param userId - The user ID of the thread member to get.
|
|
1782
|
-
* @returns An instance of {@link
|
|
1946
|
+
* @returns An instance of {@link CamelizedDiscordThreadMember}.
|
|
1783
1947
|
*
|
|
1784
1948
|
* @see {@link https://discord.com/developers/docs/resources/channel#get-thread-member}
|
|
1785
1949
|
*/
|
|
1786
|
-
getThreadMember: (channelId: BigString, userId: BigString) => Promise<
|
|
1950
|
+
getThreadMember: (channelId: BigString, userId: BigString) => Promise<CamelizedDiscordThreadMember>;
|
|
1787
1951
|
/**
|
|
1788
1952
|
* Gets the list of thread members for a thread.
|
|
1789
1953
|
*
|
|
1790
1954
|
* @param channelId - The ID of the thread to get the thread members of.
|
|
1791
|
-
* @returns A collection of {@link
|
|
1955
|
+
* @returns A collection of {@link CamelizedDiscordThreadMember} assorted by user ID.
|
|
1792
1956
|
*
|
|
1793
1957
|
* @remarks
|
|
1794
1958
|
* Requires the application to have the `GUILD_MEMBERS` privileged intent enabled.
|
|
1795
1959
|
*
|
|
1796
1960
|
* @see {@link https://discord.com/developers/docs/resources/channel#list-thread-members}
|
|
1797
1961
|
*/
|
|
1798
|
-
getThreadMembers: (channelId: BigString) => Promise<
|
|
1962
|
+
getThreadMembers: (channelId: BigString) => Promise<CamelizedDiscordThreadMember[]>;
|
|
1799
1963
|
/**
|
|
1800
1964
|
* Gets the list of users that reacted with an emoji to a message.
|
|
1801
1965
|
*
|
|
@@ -1807,14 +1971,49 @@ export interface RestManager {
|
|
|
1807
1971
|
*
|
|
1808
1972
|
* @see {@link https://discord.com/developers/docs/resources/channel#get-reactions}
|
|
1809
1973
|
*/
|
|
1810
|
-
getReactions: (channelId: BigString, messageId: BigString, reaction: string, options?: GetReactions) => Promise<
|
|
1974
|
+
getReactions: (channelId: BigString, messageId: BigString, reaction: string, options?: GetReactions) => Promise<CamelizedDiscordUser[]>;
|
|
1811
1975
|
/**
|
|
1812
1976
|
* Get a user's data from the api
|
|
1813
1977
|
*
|
|
1814
1978
|
* @param id The user's id
|
|
1815
|
-
* @returns {
|
|
1979
|
+
* @returns {CamelizedDiscordUser}
|
|
1980
|
+
*/
|
|
1981
|
+
getUser: (id: BigString) => Promise<CamelizedDiscordUser>;
|
|
1982
|
+
/**
|
|
1983
|
+
* Get the current user data.
|
|
1984
|
+
*
|
|
1985
|
+
* @param bearerToken - The access token of the user
|
|
1986
|
+
* @returns {CamelizedDiscordUser}
|
|
1987
|
+
*
|
|
1988
|
+
* @remarks
|
|
1989
|
+
* This requires the `identify` scope.
|
|
1990
|
+
*
|
|
1991
|
+
* To get the mail this also requires the `email` scope
|
|
1992
|
+
*/
|
|
1993
|
+
getCurrentUser: (bearerToken: string) => Promise<CamelizedDiscordUser>;
|
|
1994
|
+
/**
|
|
1995
|
+
* Get the current user connections.
|
|
1996
|
+
*
|
|
1997
|
+
* @param bearerToken - The access token of the user
|
|
1998
|
+
* @returns {CamelizedDiscordConnection[]}
|
|
1999
|
+
*
|
|
2000
|
+
* @remarks
|
|
2001
|
+
* This requires the `connections` scope.
|
|
1816
2002
|
*/
|
|
1817
|
-
|
|
2003
|
+
getUserConnections: (bearerToken: string) => Promise<CamelizedDiscordConnection[]>;
|
|
2004
|
+
/**
|
|
2005
|
+
* Get the current user application role connection for the application.
|
|
2006
|
+
*
|
|
2007
|
+
* @param bearerToken - The access token of the user
|
|
2008
|
+
* @param applicationId - The id of the application to get the role connection
|
|
2009
|
+
* @returns {CamelizedDiscordApplicationRoleConnection}
|
|
2010
|
+
*
|
|
2011
|
+
* @remarks
|
|
2012
|
+
* The access token requires the `role_connections.write` scope.
|
|
2013
|
+
*
|
|
2014
|
+
* @see {@link https://discord.com/developers/docs/resources/user#get-user-application-role-connection}
|
|
2015
|
+
*/
|
|
2016
|
+
getUserApplicationRoleConnection: (bearerToken: string, applicationId: BigString) => Promise<CamelizedDiscordApplicationRoleConnection>;
|
|
1818
2017
|
/**
|
|
1819
2018
|
* Gets information about the vanity url of a guild.
|
|
1820
2019
|
*
|
|
@@ -1828,7 +2027,7 @@ export interface RestManager {
|
|
|
1828
2027
|
*
|
|
1829
2028
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
|
|
1830
2029
|
*/
|
|
1831
|
-
getVanityUrl: (guildId: BigString) => Promise<
|
|
2030
|
+
getVanityUrl: (guildId: BigString) => Promise<CamelizedDiscordVanityUrl>;
|
|
1832
2031
|
/**
|
|
1833
2032
|
* Gets the list of voice regions for a guild.
|
|
1834
2033
|
*
|
|
@@ -1837,19 +2036,19 @@ export interface RestManager {
|
|
|
1837
2036
|
*
|
|
1838
2037
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
|
|
1839
2038
|
*/
|
|
1840
|
-
getVoiceRegions: (guildId: BigString) => Promise<
|
|
2039
|
+
getVoiceRegions: (guildId: BigString) => Promise<CamelizedDiscordVoiceRegion[]>;
|
|
1841
2040
|
/**
|
|
1842
2041
|
* Gets a webhook by its ID.
|
|
1843
2042
|
*
|
|
1844
2043
|
* @param webhookId - The ID of the webhook to get.
|
|
1845
|
-
* @returns An instance of {@link
|
|
2044
|
+
* @returns An instance of {@link CamelizedDiscordWebhook}.
|
|
1846
2045
|
*
|
|
1847
2046
|
* @remarks
|
|
1848
2047
|
* Requires the `MANAGE_WEBHOOKS` permission.
|
|
1849
2048
|
*
|
|
1850
2049
|
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook}
|
|
1851
2050
|
*/
|
|
1852
|
-
getWebhook: (webhookId: BigString) => Promise<
|
|
2051
|
+
getWebhook: (webhookId: BigString) => Promise<CamelizedDiscordWebhook>;
|
|
1853
2052
|
/**
|
|
1854
2053
|
* Gets a webhook message by its ID.
|
|
1855
2054
|
*
|
|
@@ -1857,21 +2056,21 @@ export interface RestManager {
|
|
|
1857
2056
|
* @param token - The webhook token, used to get webhook messages.
|
|
1858
2057
|
* @param messageId - the ID of the webhook message to get.
|
|
1859
2058
|
* @param options - The parameters for the fetching of the message.
|
|
1860
|
-
* @returns An instance of {@link
|
|
2059
|
+
* @returns An instance of {@link CamelizedDiscordMessage}.
|
|
1861
2060
|
*
|
|
1862
2061
|
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-message}
|
|
1863
2062
|
*/
|
|
1864
|
-
getWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: GetWebhookMessageOptions) => Promise<
|
|
2063
|
+
getWebhookMessage: (webhookId: BigString, token: string, messageId: BigString, options?: GetWebhookMessageOptions) => Promise<CamelizedDiscordMessage>;
|
|
1865
2064
|
/**
|
|
1866
2065
|
* Gets a webhook using the webhook token, thereby bypassing the need for authentication + permissions.
|
|
1867
2066
|
*
|
|
1868
2067
|
* @param webhookId - The ID of the webhook to get.
|
|
1869
2068
|
* @param token - The webhook token, used to get the webhook.
|
|
1870
|
-
* @returns An instance of {@link
|
|
2069
|
+
* @returns An instance of {@link CamelizedDiscordWebhook}.
|
|
1871
2070
|
*
|
|
1872
2071
|
* @see {@link https://discord.com/developers/docs/resources/webhook#get-webhook-with-token}
|
|
1873
2072
|
*/
|
|
1874
|
-
getWebhookWithToken: (webhookId: BigString, token: string) => Promise<
|
|
2073
|
+
getWebhookWithToken: (webhookId: BigString, token: string) => Promise<CamelizedDiscordWebhook>;
|
|
1875
2074
|
/**
|
|
1876
2075
|
* Gets the welcome screen for a guild.
|
|
1877
2076
|
*
|
|
@@ -1884,7 +2083,7 @@ export interface RestManager {
|
|
|
1884
2083
|
*
|
|
1885
2084
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen}
|
|
1886
2085
|
*/
|
|
1887
|
-
getWelcomeScreen: (guildId: BigString) => Promise<
|
|
2086
|
+
getWelcomeScreen: (guildId: BigString) => Promise<CamelizedDiscordWelcomeScreen>;
|
|
1888
2087
|
/**
|
|
1889
2088
|
* Gets the guild widget by guild ID.
|
|
1890
2089
|
*
|
|
@@ -1893,7 +2092,7 @@ export interface RestManager {
|
|
|
1893
2092
|
*
|
|
1894
2093
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget}
|
|
1895
2094
|
*/
|
|
1896
|
-
getWidget: (guildId: BigString) => Promise<
|
|
2095
|
+
getWidget: (guildId: BigString) => Promise<CamelizedDiscordGuildWidget>;
|
|
1897
2096
|
/**
|
|
1898
2097
|
* Gets the settings of a guild's widget.
|
|
1899
2098
|
*
|
|
@@ -1905,7 +2104,7 @@ export interface RestManager {
|
|
|
1905
2104
|
*
|
|
1906
2105
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-widget-settings}
|
|
1907
2106
|
*/
|
|
1908
|
-
getWidgetSettings: (guildId: BigString) => Promise<
|
|
2107
|
+
getWidgetSettings: (guildId: BigString) => Promise<CamelizedDiscordGuildWidgetSettings>;
|
|
1909
2108
|
/**
|
|
1910
2109
|
* Adds the bot user to a thread.
|
|
1911
2110
|
*
|
|
@@ -1960,13 +2159,14 @@ export interface RestManager {
|
|
|
1960
2159
|
*
|
|
1961
2160
|
* @see {@link https://discord.com/developers/docs/resources/channel#crosspost-message}
|
|
1962
2161
|
*/
|
|
1963
|
-
publishMessage: (channelId: BigString, messageId: BigString) => Promise<
|
|
2162
|
+
publishMessage: (channelId: BigString, messageId: BigString) => Promise<CamelizedDiscordMessage>;
|
|
1964
2163
|
/**
|
|
1965
2164
|
* Removes a role from a member.
|
|
1966
2165
|
*
|
|
1967
2166
|
* @param guildId - The ID of the guild the member to remove the role from is in.
|
|
1968
2167
|
* @param userId - The user ID of the member to remove the role from.
|
|
1969
2168
|
* @param roleId - The ID of the role to remove from the member.
|
|
2169
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
1970
2170
|
*
|
|
1971
2171
|
* @remarks
|
|
1972
2172
|
* Requires the `MANAGE_ROLES` permission.
|
|
@@ -1993,12 +2193,21 @@ export interface RestManager {
|
|
|
1993
2193
|
* @see {@link https://discord.com/developers/docs/resources/channel#remove-thread-member}
|
|
1994
2194
|
*/
|
|
1995
2195
|
removeThreadMember: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
2196
|
+
/**
|
|
2197
|
+
* Removes a member from a Group DM.
|
|
2198
|
+
*
|
|
2199
|
+
* @param channelId - The ID of the channel to remove the recipient user of.
|
|
2200
|
+
* @param userId - The user ID of the user to remove.
|
|
2201
|
+
*
|
|
2202
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient}
|
|
2203
|
+
*/
|
|
2204
|
+
removeDmRecipient: (channelId: BigString, userId: BigString) => Promise<void>;
|
|
1996
2205
|
/**
|
|
1997
2206
|
* Sends a message to a channel.
|
|
1998
2207
|
*
|
|
1999
2208
|
* @param channelId - The ID of the channel to send the message in.
|
|
2000
2209
|
* @param options - The parameters for the creation of the message.
|
|
2001
|
-
* @returns An instance of the created {@link
|
|
2210
|
+
* @returns An instance of the created {@link CamelizedDiscordMessage}.
|
|
2002
2211
|
*
|
|
2003
2212
|
* @remarks
|
|
2004
2213
|
* Requires that the bot user be able to see the contents of the channel the message is to be sent in.
|
|
@@ -2019,7 +2228,7 @@ export interface RestManager {
|
|
|
2019
2228
|
*
|
|
2020
2229
|
* @see {@link https://discord.com/developers/docs/resources/channel#create-message}
|
|
2021
2230
|
*/
|
|
2022
|
-
sendMessage: (channelId: BigString, options: CreateMessageOptions) => Promise<
|
|
2231
|
+
sendMessage: (channelId: BigString, options: CreateMessageOptions) => Promise<CamelizedDiscordMessage>;
|
|
2023
2232
|
/**
|
|
2024
2233
|
* Sends a follow-up message to an interaction.
|
|
2025
2234
|
*
|
|
@@ -2040,7 +2249,7 @@ export interface RestManager {
|
|
|
2040
2249
|
*
|
|
2041
2250
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message}
|
|
2042
2251
|
*/
|
|
2043
|
-
sendFollowupMessage: (token: string, options: InteractionCallbackData) => Promise<
|
|
2252
|
+
sendFollowupMessage: (token: string, options: InteractionCallbackData) => Promise<CamelizedDiscordMessage>;
|
|
2044
2253
|
/**
|
|
2045
2254
|
* Sends a response to an interaction.
|
|
2046
2255
|
*
|
|
@@ -2069,6 +2278,7 @@ export interface RestManager {
|
|
|
2069
2278
|
* @param channelId - The ID of the channel in which to create the thread.
|
|
2070
2279
|
* @param messageId - The ID of the message to use as the thread's point of origin.
|
|
2071
2280
|
* @param options - The parameters to use for the creation of the thread.
|
|
2281
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2072
2282
|
* @returns An instance of the created {@link Channel | Thread}.
|
|
2073
2283
|
*
|
|
2074
2284
|
* @remarks
|
|
@@ -2082,13 +2292,14 @@ export interface RestManager {
|
|
|
2082
2292
|
*
|
|
2083
2293
|
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-from-message}
|
|
2084
2294
|
*/
|
|
2085
|
-
startThreadWithMessage: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage) => Promise<
|
|
2295
|
+
startThreadWithMessage: (channelId: BigString, messageId: BigString, options: StartThreadWithMessage, reason?: string) => Promise<CamelizedDiscordChannel>;
|
|
2086
2296
|
/**
|
|
2087
2297
|
* Creates a thread without using a message as the thread's point of origin.
|
|
2088
2298
|
*
|
|
2089
2299
|
* @param channelId - The ID of the channel in which to create the thread.
|
|
2090
2300
|
* @param options - The parameters to use for the creation of the thread.
|
|
2091
|
-
* @
|
|
2301
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2302
|
+
* @returns An instance of the created {@link CamelizedDiscordChannel | Thread}.
|
|
2092
2303
|
*
|
|
2093
2304
|
* @remarks
|
|
2094
2305
|
* Creating a private thread requires the server to be boosted.
|
|
@@ -2097,7 +2308,7 @@ export interface RestManager {
|
|
|
2097
2308
|
*
|
|
2098
2309
|
* @see {@link https://discord.com/developers/docs/resources/channel#start-thread-without-message}
|
|
2099
2310
|
*/
|
|
2100
|
-
startThreadWithoutMessage: (channelId: BigString, options: StartThreadWithoutMessage) => Promise<
|
|
2311
|
+
startThreadWithoutMessage: (channelId: BigString, options: StartThreadWithoutMessage, reason?: string) => Promise<CamelizedDiscordChannel>;
|
|
2101
2312
|
/**
|
|
2102
2313
|
* Synchronises a template with the current state of a guild.
|
|
2103
2314
|
*
|
|
@@ -2111,7 +2322,7 @@ export interface RestManager {
|
|
|
2111
2322
|
*
|
|
2112
2323
|
* @see {@link https://discord.com/developers/docs/resources/guild-template#get-guild-templates}
|
|
2113
2324
|
*/
|
|
2114
|
-
syncGuildTemplate: (guildId: BigString) => Promise<
|
|
2325
|
+
syncGuildTemplate: (guildId: BigString) => Promise<CamelizedDiscordTemplate>;
|
|
2115
2326
|
/**
|
|
2116
2327
|
* Triggers a typing indicator for the bot user.
|
|
2117
2328
|
*
|
|
@@ -2129,6 +2340,7 @@ export interface RestManager {
|
|
|
2129
2340
|
* Re-registers the list of global application commands, overwriting the previous commands completely.
|
|
2130
2341
|
*
|
|
2131
2342
|
* @param commands - The list of commands to use to overwrite the previous list.
|
|
2343
|
+
* @param options - Additional options for the endpoint.
|
|
2132
2344
|
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
2133
2345
|
*
|
|
2134
2346
|
* @remarks
|
|
@@ -2136,14 +2348,18 @@ export interface RestManager {
|
|
|
2136
2348
|
*
|
|
2137
2349
|
* ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
|
|
2138
2350
|
*
|
|
2351
|
+
* When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
|
|
2352
|
+
* You will be able to update only your own application commands
|
|
2353
|
+
*
|
|
2139
2354
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands}
|
|
2140
2355
|
*/
|
|
2141
|
-
upsertGlobalApplicationCommands: (commands: CreateApplicationCommand[]) => Promise<
|
|
2356
|
+
upsertGlobalApplicationCommands: (commands: CreateApplicationCommand[], options?: UpsertGlobalApplicationCommandOptions) => Promise<CamelizedDiscordApplicationCommand[]>;
|
|
2142
2357
|
/**
|
|
2143
2358
|
* Re-registers the list of application commands registered in a guild, overwriting the previous commands completely.
|
|
2144
2359
|
*
|
|
2145
2360
|
* @param guildId - The ID of the guild whose list of commands to overwrite.
|
|
2146
2361
|
* @param commands - The list of commands to use to overwrite the previous list.
|
|
2362
|
+
* @param options - Additional options for the endpoint.
|
|
2147
2363
|
* @returns A collection of {@link ApplicationCommand} objects assorted by command ID.
|
|
2148
2364
|
*
|
|
2149
2365
|
* @remarks
|
|
@@ -2151,15 +2367,18 @@ export interface RestManager {
|
|
|
2151
2367
|
*
|
|
2152
2368
|
* ⚠️ Commands that do not already exist will count towards the daily limit of _200_ new commands.
|
|
2153
2369
|
*
|
|
2370
|
+
* When using the bearer token the token needs the `applications.commands.update` scope and must be a `Client grant` token.
|
|
2371
|
+
* You will be able to update only your own application commands
|
|
2372
|
+
*
|
|
2154
2373
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands}
|
|
2155
2374
|
*/
|
|
2156
|
-
upsertGuildApplicationCommands: (guildId: BigString, commands: CreateApplicationCommand[]) => Promise<
|
|
2375
|
+
upsertGuildApplicationCommands: (guildId: BigString, commands: CreateApplicationCommand[], options?: UpsertGuildApplicationCommandOptions) => Promise<CamelizedDiscordApplicationCommand[]>;
|
|
2157
2376
|
/**
|
|
2158
2377
|
* Bans a user from a guild.
|
|
2159
2378
|
*
|
|
2160
|
-
|
|
2161
2379
|
* @param guildId - The ID of the guild to ban the user from.
|
|
2162
2380
|
* @param userId - The ID of the user to ban from the guild.
|
|
2381
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2163
2382
|
* @param options - The parameters for the creation of the ban.
|
|
2164
2383
|
*
|
|
2165
2384
|
* @remarks
|
|
@@ -2169,25 +2388,27 @@ export interface RestManager {
|
|
|
2169
2388
|
*
|
|
2170
2389
|
* @see {@link https://discord.com/developers/docs/resources/guild#create-guild-ban}
|
|
2171
2390
|
*/
|
|
2172
|
-
banMember: (guildId: BigString, userId: BigString, options?: CreateGuildBan) => Promise<void>;
|
|
2391
|
+
banMember: (guildId: BigString, userId: BigString, options?: CreateGuildBan, reason?: string) => Promise<void>;
|
|
2173
2392
|
/**
|
|
2174
2393
|
* Edits the nickname of the bot user.
|
|
2175
2394
|
*
|
|
2176
2395
|
* @param guildId - The ID of the guild to edit the nickname of the bot user in.
|
|
2177
2396
|
* @param options - The parameters for the edit of the nickname.
|
|
2178
|
-
* @
|
|
2397
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2398
|
+
* @returns An instance of the edited {@link CamelizedDiscordMember}
|
|
2179
2399
|
*
|
|
2180
2400
|
* @remarks
|
|
2181
2401
|
* Fires a _Guild Member Update_ gateway event.
|
|
2182
2402
|
*
|
|
2183
2403
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-current-member}
|
|
2184
2404
|
*/
|
|
2185
|
-
editBotMember: (guildId: BigString, options: EditBotMemberOptions) => Promise<
|
|
2405
|
+
editBotMember: (guildId: BigString, options: EditBotMemberOptions, reason?: string) => Promise<CamelizedDiscordMember>;
|
|
2186
2406
|
/**
|
|
2187
2407
|
* Edits a member's properties.
|
|
2188
2408
|
*
|
|
2189
2409
|
* @param guildId - The ID of the guild to edit the member of.
|
|
2190
2410
|
* @param userId - The user ID of the member to edit.
|
|
2411
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2191
2412
|
* @param options - The parameters for the edit of the user.
|
|
2192
2413
|
*
|
|
2193
2414
|
* @remarks
|
|
@@ -2198,24 +2419,37 @@ export interface RestManager {
|
|
|
2198
2419
|
*
|
|
2199
2420
|
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild-member}
|
|
2200
2421
|
*/
|
|
2201
|
-
editMember: (guildId: BigString, userId: BigString, options: ModifyGuildMember) => Promise<
|
|
2422
|
+
editMember: (guildId: BigString, userId: BigString, options: ModifyGuildMember, reason?: string) => Promise<CamelizedDiscordMember>;
|
|
2202
2423
|
/**
|
|
2203
2424
|
* Gets the member object by user ID.
|
|
2204
2425
|
*
|
|
2205
2426
|
|
|
2206
2427
|
* @param guildId - The ID of the guild to get the member object for.
|
|
2207
2428
|
* @param userId - The ID of the user to get the member object for.
|
|
2208
|
-
* @returns An instance of {@link
|
|
2429
|
+
* @returns An instance of {@link CamelizedDiscordMemberWithUser}.
|
|
2209
2430
|
*
|
|
2210
2431
|
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-member}
|
|
2211
2432
|
*/
|
|
2212
|
-
getMember: (guildId: BigString, userId: BigString) => Promise<
|
|
2433
|
+
getMember: (guildId: BigString, userId: BigString) => Promise<CamelizedDiscordMemberWithUser>;
|
|
2434
|
+
/**
|
|
2435
|
+
* Gets the current member object.
|
|
2436
|
+
*
|
|
2437
|
+
* @param bearerToken - The access token of the user
|
|
2438
|
+
* @param guildId - The ID of the guild to get the member object for.
|
|
2439
|
+
* @returns An instance of {@link CamelizedDiscordMemberWithUser}.
|
|
2440
|
+
*
|
|
2441
|
+
* @remarks
|
|
2442
|
+
* The access tokens needs the `guilds.members.read` scope
|
|
2443
|
+
*
|
|
2444
|
+
* @see {@link https://discord.com/developers/docs/resources/user#get-current-user-guild-member}
|
|
2445
|
+
*/
|
|
2446
|
+
getCurrentMember: (guildId: BigString, bearerToken: string) => Promise<CamelizedDiscordMemberWithUser>;
|
|
2213
2447
|
/**
|
|
2214
2448
|
* Gets the list of members for a guild.
|
|
2215
2449
|
*
|
|
2216
2450
|
* @param guildId - The ID of the guild to get the list of members for.
|
|
2217
2451
|
* @param options - The parameters for the fetching of the members.
|
|
2218
|
-
* @returns A collection of {@link
|
|
2452
|
+
* @returns A collection of {@link CamelizedDiscordMemberWithUser} objects assorted by user ID.
|
|
2219
2453
|
*
|
|
2220
2454
|
* @remarks
|
|
2221
2455
|
* Requires the `GUILD_MEMBERS` intent.
|
|
@@ -2228,13 +2462,14 @@ export interface RestManager {
|
|
|
2228
2462
|
* @see {@link https://discord.com/developers/docs/topics/gateway#request-guild-members}
|
|
2229
2463
|
* @see {@link https://discord.com/developers/docs/topics/rate-limits#rate-limits}
|
|
2230
2464
|
*/
|
|
2231
|
-
getMembers: (guildId: BigString, options: ListGuildMembers) => Promise<
|
|
2465
|
+
getMembers: (guildId: BigString, options: ListGuildMembers) => Promise<CamelizedDiscordMemberWithUser[]>;
|
|
2232
2466
|
/**
|
|
2233
2467
|
* Kicks a member from a guild.
|
|
2234
2468
|
*
|
|
2235
2469
|
|
|
2236
2470
|
* @param guildId - The ID of the guild to kick the member from.
|
|
2237
2471
|
* @param userId - The user ID of the member to kick from the guild.
|
|
2472
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2238
2473
|
*
|
|
2239
2474
|
* @remarks
|
|
2240
2475
|
* Requires the `KICK_MEMBERS` permission.
|
|
@@ -2249,6 +2484,7 @@ export interface RestManager {
|
|
|
2249
2484
|
*
|
|
2250
2485
|
* @param channelId - The ID of the channel where the message is to be pinned.
|
|
2251
2486
|
* @param messageId - The ID of the message to pin.
|
|
2487
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2252
2488
|
*
|
|
2253
2489
|
* @remarks
|
|
2254
2490
|
* Requires that the bot user be able to see the contents of the channel in which the messages were posted.
|
|
@@ -2268,6 +2504,7 @@ export interface RestManager {
|
|
|
2268
2504
|
|
|
2269
2505
|
* @param guildId - The ID of the guild to prune the members of.
|
|
2270
2506
|
* @param options - The parameters for the pruning of members.
|
|
2507
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2271
2508
|
* @returns A number indicating how many members were pruned.
|
|
2272
2509
|
*
|
|
2273
2510
|
* @remarks
|
|
@@ -2281,7 +2518,7 @@ export interface RestManager {
|
|
|
2281
2518
|
*
|
|
2282
2519
|
* @see {@link https://discord.com/developers/docs/resources/guild#begin-guild-prune}
|
|
2283
2520
|
*/
|
|
2284
|
-
pruneMembers: (guildId: BigString, options: BeginGuildPrune) => Promise<{
|
|
2521
|
+
pruneMembers: (guildId: BigString, options: BeginGuildPrune, reason?: string) => Promise<{
|
|
2285
2522
|
pruned: number | null;
|
|
2286
2523
|
}>;
|
|
2287
2524
|
/**
|
|
@@ -2291,17 +2528,18 @@ export interface RestManager {
|
|
|
2291
2528
|
* @param guildId - The ID of the guild to search in.
|
|
2292
2529
|
* @param query - The string to match usernames or nicknames against.
|
|
2293
2530
|
* @param options - The parameters for searching through the members.
|
|
2294
|
-
* @returns A collection of {@link
|
|
2531
|
+
* @returns A collection of {@link CamelizedDiscordMember} objects assorted by user ID.
|
|
2295
2532
|
*
|
|
2296
2533
|
* @see {@link https://discord.com/developers/docs/resources/guild#search-guild-members}
|
|
2297
2534
|
*/
|
|
2298
|
-
searchMembers: (guildId: BigString, query: string, options?: Omit<SearchMembers, 'query'>) => Promise<
|
|
2535
|
+
searchMembers: (guildId: BigString, query: string, options?: Omit<SearchMembers, 'query'>) => Promise<CamelizedDiscordMemberWithUser[]>;
|
|
2299
2536
|
/**
|
|
2300
2537
|
* Unbans a user from a guild.
|
|
2301
2538
|
*
|
|
2302
2539
|
|
|
2303
2540
|
* @param guildId - The ID of the guild to unban the user in.
|
|
2304
2541
|
* @param userId - The ID of the user to unban.
|
|
2542
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2305
2543
|
*
|
|
2306
2544
|
* @remarks
|
|
2307
2545
|
* Requires the `BAN_MEMBERS` permission.
|
|
@@ -2310,12 +2548,13 @@ export interface RestManager {
|
|
|
2310
2548
|
*
|
|
2311
2549
|
* @see {@link https://discord.com/developers/docs/resources/guild#remove-guild-ban}
|
|
2312
2550
|
*/
|
|
2313
|
-
unbanMember: (guildId: BigString, userId: BigString) => Promise<void>;
|
|
2551
|
+
unbanMember: (guildId: BigString, userId: BigString, reason?: string) => Promise<void>;
|
|
2314
2552
|
/**
|
|
2315
2553
|
* Unpins a pinned message in a channel.
|
|
2316
2554
|
*
|
|
2317
2555
|
* @param channelId - The ID of the channel where the message is pinned.
|
|
2318
2556
|
* @param messageId - The ID of the message to unpin.
|
|
2557
|
+
* @param {string} [reason] - An optional reason for the action, to be included in the audit log.
|
|
2319
2558
|
*
|
|
2320
2559
|
* @remarks
|
|
2321
2560
|
* Requires that the bot user be able to see the contents of the channel in which the messages were posted.
|
|
@@ -2330,7 +2569,7 @@ export interface RestManager {
|
|
|
2330
2569
|
}
|
|
2331
2570
|
export type RequestMethods = 'GET' | 'POST' | 'DELETE' | 'PATCH' | 'PUT';
|
|
2332
2571
|
export type ApiVersions = 9 | 10;
|
|
2333
|
-
export interface CreateWebhook
|
|
2572
|
+
export interface CreateWebhook {
|
|
2334
2573
|
/** Name of the webhook (1-80 characters) */
|
|
2335
2574
|
name: string;
|
|
2336
2575
|
/** Image url for the default webhook avatar */
|
|
@@ -2338,23 +2577,22 @@ export interface CreateWebhook extends WithReason {
|
|
|
2338
2577
|
}
|
|
2339
2578
|
export interface CreateRequestBodyOptions {
|
|
2340
2579
|
headers?: Record<string, string>;
|
|
2341
|
-
|
|
2342
|
-
body?: Record<string, unknown>;
|
|
2580
|
+
body?: any;
|
|
2343
2581
|
unauthorized?: boolean;
|
|
2344
|
-
|
|
2582
|
+
reason?: string;
|
|
2583
|
+
files?: FileContent[];
|
|
2345
2584
|
}
|
|
2585
|
+
export type MakeRequestOptions = Omit<CreateRequestBodyOptions, 'method'> & Pick<SendRequestOptions, 'runThroughQueue'>;
|
|
2346
2586
|
export interface RequestBody {
|
|
2347
2587
|
headers: Record<string, string>;
|
|
2348
|
-
body
|
|
2588
|
+
body?: string | FormData;
|
|
2349
2589
|
method: RequestMethods;
|
|
2350
2590
|
}
|
|
2351
2591
|
export interface SendRequestOptions {
|
|
2352
|
-
/** The
|
|
2353
|
-
|
|
2354
|
-
/** The method to use
|
|
2592
|
+
/** The route to send the request to. */
|
|
2593
|
+
route: string;
|
|
2594
|
+
/** The method to use for sending the request. */
|
|
2355
2595
|
method: RequestMethods;
|
|
2356
|
-
/** The body to be sent in the request. */
|
|
2357
|
-
body?: Record<string, any>;
|
|
2358
2596
|
/** The amount of times this request has been retried. */
|
|
2359
2597
|
retryCount: number;
|
|
2360
2598
|
/** Handler to retry a request should it be rate limited. */
|
|
@@ -2366,7 +2604,12 @@ export interface SendRequestOptions {
|
|
|
2366
2604
|
/** If this request has a bucket id which it falls under for rate limit */
|
|
2367
2605
|
bucketId?: string;
|
|
2368
2606
|
/** Additional request options, used for things like overriding authorization header. */
|
|
2369
|
-
|
|
2607
|
+
requestBodyOptions?: CreateRequestBodyOptions;
|
|
2608
|
+
/**
|
|
2609
|
+
* Whether the request should be run through the queue.
|
|
2610
|
+
* Useful for routes which do not have any rate limits.
|
|
2611
|
+
*/
|
|
2612
|
+
runThroughQueue?: boolean;
|
|
2370
2613
|
}
|
|
2371
2614
|
export interface RestRateLimitedPath {
|
|
2372
2615
|
url: string;
|
|
@@ -2381,7 +2624,7 @@ export interface WebhookMessageEditor {
|
|
|
2381
2624
|
* @param token - The webhook token, used to edit the message.
|
|
2382
2625
|
* @param messageId - The ID of the message to edit.
|
|
2383
2626
|
* @param options - The parameters for the edit of the message.
|
|
2384
|
-
* @returns An instance of the edited {@link
|
|
2627
|
+
* @returns An instance of the edited {@link CamelizedDiscordMessage}.
|
|
2385
2628
|
*
|
|
2386
2629
|
* @remarks
|
|
2387
2630
|
* Fires a _Message Update_ gateway event.
|
|
@@ -2390,14 +2633,14 @@ export interface WebhookMessageEditor {
|
|
|
2390
2633
|
*/
|
|
2391
2634
|
(webhookId: BigString, token: string, messageId: BigString, options: InteractionCallbackData & {
|
|
2392
2635
|
threadId?: BigString;
|
|
2393
|
-
}): Promise<
|
|
2636
|
+
}): Promise<CamelizedDiscordMessage>;
|
|
2394
2637
|
/**
|
|
2395
2638
|
* Edits the original webhook message.
|
|
2396
2639
|
*
|
|
2397
2640
|
* @param webhookId - The ID of the webhook to edit the original message of.
|
|
2398
2641
|
* @param token - The webhook token, used to edit the message.
|
|
2399
2642
|
* @param options - The parameters for the edit of the message.
|
|
2400
|
-
* @returns An instance of the edited {@link
|
|
2643
|
+
* @returns An instance of the edited {@link CamelizedDiscordMessage}.
|
|
2401
2644
|
*
|
|
2402
2645
|
* @remarks
|
|
2403
2646
|
* Fires a _Message Update_ gateway event.
|
|
@@ -2406,7 +2649,7 @@ export interface WebhookMessageEditor {
|
|
|
2406
2649
|
*/
|
|
2407
2650
|
original: (webhookId: BigString, token: string, options: InteractionCallbackData & {
|
|
2408
2651
|
threadId?: BigString;
|
|
2409
|
-
}) => Promise<
|
|
2652
|
+
}) => Promise<CamelizedDiscordMessage>;
|
|
2410
2653
|
}
|
|
2411
2654
|
export interface RestRequestResponse {
|
|
2412
2655
|
ok: boolean;
|