@discordeno/rest 19.0.0-next.4d0b7b2 → 19.0.0-next.5b20015
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manager.d.ts +442 -1
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +2 -2
- package/package.json +3 -3
package/dist/manager.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Queue } from './queue.js';
|
|
2
|
-
import type { ApplicationCommandPermissions, BigString, Camelize, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuild, CreateGuildChannel, CreateGuildEmoji, CreateGuildRole, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, DeleteWebhookMessageOptions, DiscordActiveThreads, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordArchivedThreads, DiscordAutoModerationRule, DiscordChannel, DiscordEmoji, DiscordFollowedChannel, DiscordGetGatewayBot, DiscordGuild, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordRole, DiscordScheduledEvent, DiscordStageInstance, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordWebhook, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditMessage, EditScheduledEvent, EditStageInstanceOptions, ExecuteWebhook, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, ModifyChannel, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyRolePositions, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason } from '@discordeno/types';
|
|
2
|
+
import type { ApplicationCommandPermissions, AtLeastOne, BigString, Camelize, CreateApplicationCommand, CreateAutoModerationRuleOptions, CreateChannelInvite, CreateForumPostWithMessage, CreateGuild, CreateGuildChannel, CreateGuildEmoji, CreateGuildRole, CreateGuildStickerOptions, CreateMessageOptions, CreateScheduledEvent, CreateStageInstance, DeleteWebhookMessageOptions, DiscordActiveThreads, DiscordApplication, DiscordApplicationCommand, DiscordApplicationCommandPermissions, DiscordArchivedThreads, DiscordAuditLog, DiscordAutoModerationRule, DiscordBan, DiscordChannel, DiscordEmoji, DiscordFollowedChannel, DiscordGetGatewayBot, DiscordGuild, DiscordIntegration, DiscordInvite, DiscordInviteMetadata, DiscordMember, DiscordMemberWithUser, DiscordMessage, DiscordRole, DiscordScheduledEvent, DiscordStageInstance, DiscordSticker, DiscordStickerPack, DiscordTemplate, DiscordThreadMember, DiscordUser, DiscordVanityUrl, DiscordVoiceRegion, DiscordWebhook, EditAutoModerationRuleOptions, EditChannelPermissionOverridesOptions, EditGuildRole, EditGuildStickerOptions, EditMessage, EditScheduledEvent, EditStageInstanceOptions, ExecuteWebhook, GetBans, GetGuildAuditLog, GetGuildPruneCountQuery, GetInvite, GetMessagesOptions, GetScheduledEvents, GetScheduledEventUsers, GetWebhookMessageOptions, InteractionCallbackData, InteractionResponse, ListArchivedThreads, ListGuildMembers, ModifyChannel, ModifyGuild, ModifyGuildChannelPositions, ModifyGuildEmoji, ModifyRolePositions, ModifyWebhook, SearchMembers, StartThreadWithMessage, StartThreadWithoutMessage, WithReason } from '@discordeno/types';
|
|
3
3
|
import type { InvalidRequestBucket } from './invalidBucket.js';
|
|
4
4
|
export declare function createRestManager(options: CreateRestManagerOptions): RestManager;
|
|
5
5
|
export interface CreateRestManagerOptions {
|
|
@@ -129,11 +129,18 @@ export interface RestManager {
|
|
|
129
129
|
};
|
|
130
130
|
/** Route for handling typing indicators in a c«hannel. */
|
|
131
131
|
typing: (channelId: BigString) => string;
|
|
132
|
+
/** Routes for handling reactions on a message. */
|
|
133
|
+
reactions: {
|
|
134
|
+
/** Route for handling a bots reaction. */
|
|
135
|
+
bot: (channelId: BigString, messageId: BigString, emoji: string) => string;
|
|
136
|
+
};
|
|
132
137
|
};
|
|
133
138
|
/** Routes for guild related endpoints. */
|
|
134
139
|
guilds: {
|
|
135
140
|
/** Routes for handling a non-specific guild. */
|
|
136
141
|
all: () => string;
|
|
142
|
+
/** Route for handling audit logs in a guild. */
|
|
143
|
+
auditlogs: (guildId: BigString, options?: GetGuildAuditLog) => string;
|
|
137
144
|
/** Routes for a guilds automoderation. */
|
|
138
145
|
automod: {
|
|
139
146
|
/** Route for handling a guild's automoderation. */
|
|
@@ -172,6 +179,8 @@ export interface RestManager {
|
|
|
172
179
|
members: {
|
|
173
180
|
/** Route for handling a specific guild member's ban. */
|
|
174
181
|
ban: (guildId: BigString, userId: BigString) => string;
|
|
182
|
+
/** Route for handling non-specific bans in a guild. */
|
|
183
|
+
bans: (guildId: BigString, options?: GetBans) => string;
|
|
175
184
|
/** Route for handling a the bot guild member. */
|
|
176
185
|
bot: (guildId: BigString) => string;
|
|
177
186
|
/** Route for handling a specific guild member. */
|
|
@@ -194,6 +203,10 @@ export interface RestManager {
|
|
|
194
203
|
/** Route for handling non-specific guild's templates. */
|
|
195
204
|
all: (guildId: BigString) => string;
|
|
196
205
|
};
|
|
206
|
+
/** Route for handling a guild's vanity url. */
|
|
207
|
+
vanity: (guildId: BigString) => string;
|
|
208
|
+
/** Route for handling a guild's regions. */
|
|
209
|
+
regions: (guildId: BigString) => string;
|
|
197
210
|
/** Routes for handling a guild's roles. */
|
|
198
211
|
roles: {
|
|
199
212
|
/** Route for handling a specific guild role. */
|
|
@@ -203,6 +216,10 @@ export interface RestManager {
|
|
|
203
216
|
/** Route for handling a members roles in a guild. */
|
|
204
217
|
member: (guildId: BigString, memberId: BigString, roleId: BigString) => string;
|
|
205
218
|
};
|
|
219
|
+
/** Route for handling a specific guild sticker. */
|
|
220
|
+
stickers: (guildId: BigString) => string;
|
|
221
|
+
/** Route for handling non-specific guild stickers. */
|
|
222
|
+
sticker: (guildId: BigString, stickerId: BigString) => string;
|
|
206
223
|
};
|
|
207
224
|
/** Routes for interaction related endpoints. */
|
|
208
225
|
interactions: {
|
|
@@ -234,6 +251,8 @@ export interface RestManager {
|
|
|
234
251
|
message: (applicationId: BigString, token: string, messageId: BigString) => string;
|
|
235
252
|
};
|
|
236
253
|
};
|
|
254
|
+
/** Route for handling a sticker. */
|
|
255
|
+
sticker: (stickerId: BigString) => string;
|
|
237
256
|
};
|
|
238
257
|
/** Check the rate limits for a url or a bucket. */
|
|
239
258
|
checkRateLimits: (url: string) => number | false;
|
|
@@ -345,6 +364,47 @@ export interface RestManager {
|
|
|
345
364
|
* @see {@link https://discord.com/developers/docs/resources/channel#delete-message}
|
|
346
365
|
*/
|
|
347
366
|
delete: (channelId: BigString, messageId: BigString, reason?: string) => Promise<void>;
|
|
367
|
+
/** Handlers related to reactions on a message. */
|
|
368
|
+
reactions: {
|
|
369
|
+
/**
|
|
370
|
+
* Adds a reaction to a message.
|
|
371
|
+
*
|
|
372
|
+
* @param channelId - The ID of the channel the message to add a reaction to is in.
|
|
373
|
+
* @param messageId - The ID of the message to add a reaction to.
|
|
374
|
+
* @param reaction - The reaction to add to the message.
|
|
375
|
+
* @returns
|
|
376
|
+
*
|
|
377
|
+
* @remarks
|
|
378
|
+
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
379
|
+
*
|
|
380
|
+
* If nobody else has reacted to the message:
|
|
381
|
+
* - Requires the `ADD_REACTIONS` permission.
|
|
382
|
+
*
|
|
383
|
+
* Fires a _Message Reaction Add_ gateway event.
|
|
384
|
+
*
|
|
385
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#create-reaction}
|
|
386
|
+
*/
|
|
387
|
+
add: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
|
|
388
|
+
/**
|
|
389
|
+
* Adds multiple a reaction to a message.
|
|
390
|
+
*
|
|
391
|
+
* This function uses the `addReaction()` helper behind the scenes.
|
|
392
|
+
*
|
|
393
|
+
* @param channelId - The ID of the channel the message to add reactions to is in.
|
|
394
|
+
* @param messageId - The ID of the message to add the reactions to.
|
|
395
|
+
* @param reactions - The reactions to add to the message.
|
|
396
|
+
* @param ordered - Whether the reactions must be added in order or not.
|
|
397
|
+
*
|
|
398
|
+
* @remarks
|
|
399
|
+
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
400
|
+
*
|
|
401
|
+
* If nobody else has reacted to the message:
|
|
402
|
+
* - Requires the `ADD_REACTIONS` permission.
|
|
403
|
+
*
|
|
404
|
+
* Fires a _Message Reaction Add_ gateway event for every reaction added.
|
|
405
|
+
*/
|
|
406
|
+
bulk: (channelId: BigString, messageId: BigString, reactions: string[], ordered?: boolean) => Promise<void>;
|
|
407
|
+
};
|
|
348
408
|
};
|
|
349
409
|
/**
|
|
350
410
|
* Gets a channel by its ID.
|
|
@@ -839,6 +899,19 @@ export interface RestManager {
|
|
|
839
899
|
};
|
|
840
900
|
/** Guild related helper methods */
|
|
841
901
|
guilds: {
|
|
902
|
+
/**
|
|
903
|
+
* Gets a guild's audit log.
|
|
904
|
+
*
|
|
905
|
+
* @param guildId - The ID of the guild to get the audit log of.
|
|
906
|
+
* @param options - The parameters for the fetching of the audit log.
|
|
907
|
+
* @returns An instance of {@link AuditLog}.
|
|
908
|
+
*
|
|
909
|
+
* @remarks
|
|
910
|
+
* Requires the `VIEW_AUDIT_LOG` permission.
|
|
911
|
+
*
|
|
912
|
+
* @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
|
|
913
|
+
*/
|
|
914
|
+
auditlogs: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
|
|
842
915
|
automod: {
|
|
843
916
|
/**
|
|
844
917
|
* Creates an automod rule in a guild.
|
|
@@ -914,6 +987,34 @@ export interface RestManager {
|
|
|
914
987
|
rules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
|
|
915
988
|
};
|
|
916
989
|
};
|
|
990
|
+
/**
|
|
991
|
+
* Gets a ban by user ID.
|
|
992
|
+
*
|
|
993
|
+
* @param guildId - The ID of the guild to get the ban from.
|
|
994
|
+
* @param userId - The ID of the user to get the ban for.
|
|
995
|
+
* @returns An instance of {@link DiscordBan}.
|
|
996
|
+
*
|
|
997
|
+
* @remarks
|
|
998
|
+
* Requires the `BAN_MEMBERS` permission.
|
|
999
|
+
*
|
|
1000
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
|
|
1001
|
+
*/
|
|
1002
|
+
ban: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
|
|
1003
|
+
/**
|
|
1004
|
+
* Gets the list of bans for a guild.
|
|
1005
|
+
*
|
|
1006
|
+
* @param guildId - The ID of the guild to get the list of bans for.
|
|
1007
|
+
* @param options - The parameters for the fetching of the list of bans.
|
|
1008
|
+
* @returns A collection of {@link DiscordBan} objects assorted by user ID.
|
|
1009
|
+
*
|
|
1010
|
+
* @remarks
|
|
1011
|
+
* Requires the `BAN_MEMBERS` permission.
|
|
1012
|
+
*
|
|
1013
|
+
* Users are ordered by their IDs in _ascending_ order.
|
|
1014
|
+
*
|
|
1015
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
|
|
1016
|
+
*/
|
|
1017
|
+
bans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan[]>>;
|
|
917
1018
|
/**
|
|
918
1019
|
* Creates a guild.
|
|
919
1020
|
*
|
|
@@ -953,6 +1054,25 @@ export interface RestManager {
|
|
|
953
1054
|
* @see {@link https://discord.com/developers/docs/resources/guild#delete-guild}
|
|
954
1055
|
*/
|
|
955
1056
|
delete: (guildId: BigString) => Promise<void>;
|
|
1057
|
+
/**
|
|
1058
|
+
* Edits a guild's settings.
|
|
1059
|
+
*
|
|
1060
|
+
* @param guildId - The ID of the guild to edit.
|
|
1061
|
+
* @param shardId - The ID of the shard the guild is in.
|
|
1062
|
+
* @param options - The parameters for the edit of the guild.
|
|
1063
|
+
* @returns An instance of the edited {@link Guild}.
|
|
1064
|
+
*
|
|
1065
|
+
* @remarks
|
|
1066
|
+
* Requires the `MANAGE_GUILD` permission.
|
|
1067
|
+
*
|
|
1068
|
+
* If attempting to add or remove the {@link GuildFeatures.Community} feature:
|
|
1069
|
+
* - Requires the `ADMINISTRATOR` permission.
|
|
1070
|
+
*
|
|
1071
|
+
* Fires a _Guild Update_ gateway event.
|
|
1072
|
+
*
|
|
1073
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
|
|
1074
|
+
*/
|
|
1075
|
+
edit: (guildId: BigString, options: ModifyGuild) => Promise<Camelize<DiscordGuild>>;
|
|
956
1076
|
/**
|
|
957
1077
|
* Gets the list of emojis for a guild.
|
|
958
1078
|
*
|
|
@@ -1059,6 +1179,18 @@ export interface RestManager {
|
|
|
1059
1179
|
}>>;
|
|
1060
1180
|
};
|
|
1061
1181
|
};
|
|
1182
|
+
/**
|
|
1183
|
+
* Gets a guild by its ID.
|
|
1184
|
+
*
|
|
1185
|
+
* @param guildId - The ID of the guild to get.
|
|
1186
|
+
* @param options - The parameters for the fetching of the guild.
|
|
1187
|
+
* @returns An instance of {@link Guild}.
|
|
1188
|
+
*
|
|
1189
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
|
|
1190
|
+
*/
|
|
1191
|
+
get: (guildId: BigString, options?: {
|
|
1192
|
+
counts?: boolean;
|
|
1193
|
+
}) => Promise<Camelize<DiscordGuild>>;
|
|
1062
1194
|
/** Methods related to a guild's integrations. */
|
|
1063
1195
|
integrations: {
|
|
1064
1196
|
/**
|
|
@@ -1147,6 +1279,75 @@ export interface RestManager {
|
|
|
1147
1279
|
*/
|
|
1148
1280
|
list: (guildId: BigString) => Promise<Camelize<DiscordInviteMetadata[]>>;
|
|
1149
1281
|
};
|
|
1282
|
+
/** Methods related to stickers in a guild. */
|
|
1283
|
+
stickers: {
|
|
1284
|
+
/**
|
|
1285
|
+
* Create a new sticker for the guild.
|
|
1286
|
+
*
|
|
1287
|
+
* @param guildId The ID of the guild to get
|
|
1288
|
+
* @return A {@link DiscordSticker}
|
|
1289
|
+
*
|
|
1290
|
+
* @remarks
|
|
1291
|
+
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1292
|
+
* Fires a Guild Stickers Update Gateway event.
|
|
1293
|
+
* Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
|
|
1294
|
+
* Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
|
|
1295
|
+
*
|
|
1296
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
|
|
1297
|
+
*/
|
|
1298
|
+
create: (guildId: BigString, options: CreateGuildStickerOptions) => Promise<Camelize<DiscordSticker>>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Delete a new sticker for the guild.
|
|
1301
|
+
*
|
|
1302
|
+
* @param guildId The ID of the guild to get
|
|
1303
|
+
* @return A {@link DiscordSticker}
|
|
1304
|
+
*
|
|
1305
|
+
* @remarks
|
|
1306
|
+
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1307
|
+
* Fires a Guild Stickers Update Gateway event.
|
|
1308
|
+
* Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
|
|
1309
|
+
* Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
|
|
1310
|
+
*
|
|
1311
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
|
|
1312
|
+
*/
|
|
1313
|
+
delete: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
|
|
1314
|
+
/**
|
|
1315
|
+
* Edit the given sticker.
|
|
1316
|
+
*
|
|
1317
|
+
* @param guildId The ID of the guild to get
|
|
1318
|
+
* @return A {@link DiscordSticker}
|
|
1319
|
+
*
|
|
1320
|
+
* @remarks
|
|
1321
|
+
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1322
|
+
* Fires a Guild Stickers Update Gateway event.
|
|
1323
|
+
*
|
|
1324
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
|
|
1325
|
+
*/
|
|
1326
|
+
edit: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>) => Promise<Camelize<DiscordSticker>>;
|
|
1327
|
+
/**
|
|
1328
|
+
* Returns a sticker object for the given guild and sticker IDs.
|
|
1329
|
+
*
|
|
1330
|
+
* @param guildId The ID of the guild to get
|
|
1331
|
+
* @param stickerId The ID of the sticker to get
|
|
1332
|
+
* @return A {@link DiscordSticker}
|
|
1333
|
+
*
|
|
1334
|
+
* @remarks Includes the user field if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1335
|
+
*
|
|
1336
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
|
|
1337
|
+
*/
|
|
1338
|
+
sticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
|
|
1339
|
+
/**
|
|
1340
|
+
* Returns an array of sticker objects for the given guild.
|
|
1341
|
+
*
|
|
1342
|
+
* @param guildId The ID of the guild to get
|
|
1343
|
+
* @returns A collection of {@link DiscordSticker} objects assorted by sticker ID.
|
|
1344
|
+
*
|
|
1345
|
+
* @remarks Includes user fields if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
1346
|
+
*
|
|
1347
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
|
|
1348
|
+
*/
|
|
1349
|
+
stickers: (guildId: BigString) => Promise<Camelize<DiscordSticker[]>>;
|
|
1350
|
+
};
|
|
1150
1351
|
/** Methods related to a guild's templates. */
|
|
1151
1352
|
templates: {
|
|
1152
1353
|
/**
|
|
@@ -1825,7 +2026,39 @@ export interface RestManager {
|
|
|
1825
2026
|
*/
|
|
1826
2027
|
remove: (guildId: BigString, userId: BigString, roleId: BigString, reason?: string) => Promise<void>;
|
|
1827
2028
|
};
|
|
2029
|
+
/**
|
|
2030
|
+
* Gets information about the vanity url of a guild.
|
|
2031
|
+
*
|
|
2032
|
+
* @param guildId - The ID of the guild to get the vanity url information for.
|
|
2033
|
+
* @returns An instance of {@link VanityUrl}.
|
|
2034
|
+
*
|
|
2035
|
+
* @remarks
|
|
2036
|
+
* Requires the `MANAGE_GUILD` permission.
|
|
2037
|
+
*
|
|
2038
|
+
* The `code` property will be `null` if the guild does not have a set vanity url.
|
|
2039
|
+
*
|
|
2040
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
|
|
2041
|
+
*/
|
|
2042
|
+
vanity: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
|
|
2043
|
+
/**
|
|
2044
|
+
* Gets the list of voice regions for a guild.
|
|
2045
|
+
*
|
|
2046
|
+
* @param guildId - The ID of the guild to get the voice regions for.
|
|
2047
|
+
* @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
|
|
2048
|
+
*
|
|
2049
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
|
|
2050
|
+
*/
|
|
2051
|
+
regions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion[]>>;
|
|
1828
2052
|
};
|
|
2053
|
+
/**
|
|
2054
|
+
* Returns a sticker object for the given sticker ID.
|
|
2055
|
+
*
|
|
2056
|
+
* @param stickerId The ID of the sticker to get
|
|
2057
|
+
* @returns A {@link DiscordSticker}
|
|
2058
|
+
*
|
|
2059
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
|
|
2060
|
+
*/
|
|
2061
|
+
sticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
|
|
1829
2062
|
/** Webhook related helper methods. */
|
|
1830
2063
|
webhooks: {
|
|
1831
2064
|
/**
|
|
@@ -2018,6 +2251,44 @@ export interface RestManager {
|
|
|
2018
2251
|
*/
|
|
2019
2252
|
channel: (userId: BigString) => Promise<Camelize<DiscordChannel>>;
|
|
2020
2253
|
};
|
|
2254
|
+
/**
|
|
2255
|
+
* Adds a reaction to a message.
|
|
2256
|
+
*
|
|
2257
|
+
* @param channelId - The ID of the channel the message to add a reaction to is in.
|
|
2258
|
+
* @param messageId - The ID of the message to add a reaction to.
|
|
2259
|
+
* @param reaction - The reaction to add to the message.
|
|
2260
|
+
* @returns
|
|
2261
|
+
*
|
|
2262
|
+
* @remarks
|
|
2263
|
+
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
2264
|
+
*
|
|
2265
|
+
* If nobody else has reacted to the message:
|
|
2266
|
+
* - Requires the `ADD_REACTIONS` permission.
|
|
2267
|
+
*
|
|
2268
|
+
* Fires a _Message Reaction Add_ gateway event.
|
|
2269
|
+
*
|
|
2270
|
+
* @see {@link https://discord.com/developers/docs/resources/channel#create-reaction}
|
|
2271
|
+
*/
|
|
2272
|
+
addReaction: (channelId: BigString, messageId: BigString, reaction: string) => Promise<void>;
|
|
2273
|
+
/**
|
|
2274
|
+
* Adds multiple a reaction to a message.
|
|
2275
|
+
*
|
|
2276
|
+
* This function uses the `addReaction()` helper behind the scenes.
|
|
2277
|
+
*
|
|
2278
|
+
* @param channelId - The ID of the channel the message to add reactions to is in.
|
|
2279
|
+
* @param messageId - The ID of the message to add the reactions to.
|
|
2280
|
+
* @param reactions - The reactions to add to the message.
|
|
2281
|
+
* @param ordered - Whether the reactions must be added in order or not.
|
|
2282
|
+
*
|
|
2283
|
+
* @remarks
|
|
2284
|
+
* Requires the `READ_MESSAGE_HISTORY` permission.
|
|
2285
|
+
*
|
|
2286
|
+
* If nobody else has reacted to the message:
|
|
2287
|
+
* - Requires the `ADD_REACTIONS` permission.
|
|
2288
|
+
*
|
|
2289
|
+
* Fires a _Message Reaction Add_ gateway event for every reaction added.
|
|
2290
|
+
*/
|
|
2291
|
+
addReactions: (channelId: BigString, messageId: BigString, reactions: string[], ordered?: boolean) => Promise<void>;
|
|
2021
2292
|
/**
|
|
2022
2293
|
* Adds a role to a member.
|
|
2023
2294
|
*
|
|
@@ -2159,6 +2430,21 @@ export interface RestManager {
|
|
|
2159
2430
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command}
|
|
2160
2431
|
*/
|
|
2161
2432
|
createGuildApplicationCommand: (command: CreateApplicationCommand, guildId: BigString) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
2433
|
+
/**
|
|
2434
|
+
* Create a new sticker for the guild.
|
|
2435
|
+
*
|
|
2436
|
+
* @param guildId The ID of the guild to get
|
|
2437
|
+
* @return A {@link DiscordSticker}
|
|
2438
|
+
*
|
|
2439
|
+
* @remarks
|
|
2440
|
+
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
2441
|
+
* Fires a Guild Stickers Update Gateway event.
|
|
2442
|
+
* Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
|
|
2443
|
+
* Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
|
|
2444
|
+
*
|
|
2445
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#create-guild-sticker}
|
|
2446
|
+
*/
|
|
2447
|
+
createGuildSticker: (guildId: BigString, options: CreateGuildStickerOptions) => Promise<Camelize<DiscordSticker>>;
|
|
2162
2448
|
/**
|
|
2163
2449
|
* Creates a template from a guild.
|
|
2164
2450
|
*
|
|
@@ -2366,6 +2652,21 @@ export interface RestManager {
|
|
|
2366
2652
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command}
|
|
2367
2653
|
*/
|
|
2368
2654
|
deleteGuildApplicationCommand: (commandId: BigString, guildId: BigString) => Promise<void>;
|
|
2655
|
+
/**
|
|
2656
|
+
* Delete a new sticker for the guild.
|
|
2657
|
+
*
|
|
2658
|
+
* @param guildId The ID of the guild to get
|
|
2659
|
+
* @return A {@link DiscordSticker}
|
|
2660
|
+
*
|
|
2661
|
+
* @remarks
|
|
2662
|
+
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
2663
|
+
* Fires a Guild Stickers Update Gateway event.
|
|
2664
|
+
* Every guilds has five free sticker slots by default, and each Boost level will grant access to more slots.
|
|
2665
|
+
* Lottie stickers can only be uploaded on guilds that have either the `VERIFIED` and/or the `PARTNERED` guild feature.
|
|
2666
|
+
*
|
|
2667
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#delete-guild-sticker}
|
|
2668
|
+
*/
|
|
2669
|
+
deleteGuildSticker: (guildId: BigString, stickerId: BigString, reason?: string) => Promise<void>;
|
|
2369
2670
|
/**
|
|
2370
2671
|
* Deletes a template from a guild.
|
|
2371
2672
|
*
|
|
@@ -2661,6 +2962,25 @@ export interface RestManager {
|
|
|
2661
2962
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-global-application-command}
|
|
2662
2963
|
*/
|
|
2663
2964
|
editGlobalApplicationCommand: (commandId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
2965
|
+
/**
|
|
2966
|
+
* Edits a guild's settings.
|
|
2967
|
+
*
|
|
2968
|
+
* @param guildId - The ID of the guild to edit.
|
|
2969
|
+
* @param shardId - The ID of the shard the guild is in.
|
|
2970
|
+
* @param options - The parameters for the edit of the guild.
|
|
2971
|
+
* @returns An instance of the edited {@link Guild}.
|
|
2972
|
+
*
|
|
2973
|
+
* @remarks
|
|
2974
|
+
* Requires the `MANAGE_GUILD` permission.
|
|
2975
|
+
*
|
|
2976
|
+
* If attempting to add or remove the {@link GuildFeatures.Community} feature:
|
|
2977
|
+
* - Requires the `ADMINISTRATOR` permission.
|
|
2978
|
+
*
|
|
2979
|
+
* Fires a _Guild Update_ gateway event.
|
|
2980
|
+
*
|
|
2981
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#modify-guild}
|
|
2982
|
+
*/
|
|
2983
|
+
editGuild: (guildId: BigString, options: ModifyGuild) => Promise<Camelize<DiscordGuild>>;
|
|
2664
2984
|
/**
|
|
2665
2985
|
* Edits an application command registered in a guild.
|
|
2666
2986
|
*
|
|
@@ -2672,6 +2992,19 @@ export interface RestManager {
|
|
|
2672
2992
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command}
|
|
2673
2993
|
*/
|
|
2674
2994
|
editGuildApplicationCommand: (commandId: BigString, guildId: BigString, options: CreateApplicationCommand) => Promise<Camelize<DiscordApplicationCommand>>;
|
|
2995
|
+
/**
|
|
2996
|
+
* Edit the given sticker.
|
|
2997
|
+
*
|
|
2998
|
+
* @param guildId The ID of the guild to get
|
|
2999
|
+
* @return A {@link DiscordSticker}
|
|
3000
|
+
*
|
|
3001
|
+
* @remarks
|
|
3002
|
+
* Requires the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
3003
|
+
* Fires a Guild Stickers Update Gateway event.
|
|
3004
|
+
*
|
|
3005
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#modify-guild-sticker}
|
|
3006
|
+
*/
|
|
3007
|
+
editGuildSticker: (guildId: BigString, stickerId: BigString, options: AtLeastOne<EditGuildStickerOptions>) => Promise<Camelize<DiscordSticker>>;
|
|
2675
3008
|
/**
|
|
2676
3009
|
* Edits a template's settings.
|
|
2677
3010
|
*
|
|
@@ -2913,6 +3246,19 @@ export interface RestManager {
|
|
|
2913
3246
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-guild-application-command-permissions}
|
|
2914
3247
|
*/
|
|
2915
3248
|
getApplicationCommandPermissions: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommandPermissions[]>>;
|
|
3249
|
+
/**
|
|
3250
|
+
* Gets a guild's audit log.
|
|
3251
|
+
*
|
|
3252
|
+
* @param guildId - The ID of the guild to get the audit log of.
|
|
3253
|
+
* @param options - The parameters for the fetching of the audit log.
|
|
3254
|
+
* @returns An instance of {@link AuditLog}.
|
|
3255
|
+
*
|
|
3256
|
+
* @remarks
|
|
3257
|
+
* Requires the `VIEW_AUDIT_LOG` permission.
|
|
3258
|
+
*
|
|
3259
|
+
* @see {@link https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log}
|
|
3260
|
+
*/
|
|
3261
|
+
getAuditLog: (guildId: BigString, options?: GetGuildAuditLog) => Promise<Camelize<DiscordAuditLog>>;
|
|
2916
3262
|
/**
|
|
2917
3263
|
* Gets an automod rule by its ID.
|
|
2918
3264
|
*
|
|
@@ -2938,6 +3284,34 @@ export interface RestManager {
|
|
|
2938
3284
|
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild}
|
|
2939
3285
|
*/
|
|
2940
3286
|
getAutomodRules: (guildId: BigString) => Promise<Camelize<DiscordAutoModerationRule[]>>;
|
|
3287
|
+
/**
|
|
3288
|
+
* Gets a ban by user ID.
|
|
3289
|
+
*
|
|
3290
|
+
* @param guildId - The ID of the guild to get the ban from.
|
|
3291
|
+
* @param userId - The ID of the user to get the ban for.
|
|
3292
|
+
* @returns An instance of {@link DiscordBan}.
|
|
3293
|
+
*
|
|
3294
|
+
* @remarks
|
|
3295
|
+
* Requires the `BAN_MEMBERS` permission.
|
|
3296
|
+
*
|
|
3297
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-ban}
|
|
3298
|
+
*/
|
|
3299
|
+
getBan: (guildId: BigString, userId: BigString) => Promise<Camelize<DiscordBan>>;
|
|
3300
|
+
/**
|
|
3301
|
+
* Gets the list of bans for a guild.
|
|
3302
|
+
*
|
|
3303
|
+
* @param guildId - The ID of the guild to get the list of bans for.
|
|
3304
|
+
* @param options - The parameters for the fetching of the list of bans.
|
|
3305
|
+
* @returns A collection of {@link DiscordBan} objects assorted by user ID.
|
|
3306
|
+
*
|
|
3307
|
+
* @remarks
|
|
3308
|
+
* Requires the `BAN_MEMBERS` permission.
|
|
3309
|
+
*
|
|
3310
|
+
* Users are ordered by their IDs in _ascending_ order.
|
|
3311
|
+
*
|
|
3312
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-bans}
|
|
3313
|
+
*/
|
|
3314
|
+
getBans: (guildId: BigString, options?: GetBans) => Promise<Camelize<DiscordBan[]>>;
|
|
2941
3315
|
/**
|
|
2942
3316
|
* Gets a channel by its ID.
|
|
2943
3317
|
*
|
|
@@ -3052,6 +3426,18 @@ export interface RestManager {
|
|
|
3052
3426
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands}
|
|
3053
3427
|
*/
|
|
3054
3428
|
getGlobalApplicationCommands: () => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
3429
|
+
/**
|
|
3430
|
+
* Gets a guild by its ID.
|
|
3431
|
+
*
|
|
3432
|
+
* @param guildId - The ID of the guild to get.
|
|
3433
|
+
* @param options - The parameters for the fetching of the guild.
|
|
3434
|
+
* @returns An instance of {@link Guild}.
|
|
3435
|
+
*
|
|
3436
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild}
|
|
3437
|
+
*/
|
|
3438
|
+
getGuild: (guildId: BigString, options?: {
|
|
3439
|
+
counts?: boolean;
|
|
3440
|
+
}) => Promise<Camelize<DiscordGuild>>;
|
|
3055
3441
|
/**
|
|
3056
3442
|
* Gets a guild application command by its ID.
|
|
3057
3443
|
*
|
|
@@ -3071,6 +3457,29 @@ export interface RestManager {
|
|
|
3071
3457
|
* @see {@link https://discord.com/developers/docs/interactions/application-commands#get-global-application-commandss}
|
|
3072
3458
|
*/
|
|
3073
3459
|
getGuildApplicationCommands: (guildId: BigString) => Promise<Camelize<DiscordApplicationCommand[]>>;
|
|
3460
|
+
/**
|
|
3461
|
+
* Returns a sticker object for the given guild and sticker IDs.
|
|
3462
|
+
*
|
|
3463
|
+
* @param guildId The ID of the guild to get
|
|
3464
|
+
* @param stickerId The ID of the sticker to get
|
|
3465
|
+
* @return A {@link DiscordSticker}
|
|
3466
|
+
*
|
|
3467
|
+
* @remarks Includes the user field if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
3468
|
+
*
|
|
3469
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#get-guild-sticker}
|
|
3470
|
+
*/
|
|
3471
|
+
getGuildSticker: (guildId: BigString, stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
|
|
3472
|
+
/**
|
|
3473
|
+
* Returns an array of sticker objects for the given guild.
|
|
3474
|
+
*
|
|
3475
|
+
* @param guildId The ID of the guild to get
|
|
3476
|
+
* @returns A collection of {@link DiscordSticker} objects assorted by sticker ID.
|
|
3477
|
+
*
|
|
3478
|
+
* @remarks Includes user fields if the bot has the `MANAGE_EMOJIS_AND_STICKERS` permission.
|
|
3479
|
+
*
|
|
3480
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#list-guild-stickers}
|
|
3481
|
+
*/
|
|
3482
|
+
getGuildStickers: (guildId: BigString) => Promise<Camelize<DiscordSticker[]>>;
|
|
3074
3483
|
/**
|
|
3075
3484
|
* Gets a template by its code.
|
|
3076
3485
|
*
|
|
@@ -3284,6 +3693,15 @@ export interface RestManager {
|
|
|
3284
3693
|
* @see {@link https://discord.com/developers/docs/resources/stage-instance#get-stage-instance}
|
|
3285
3694
|
*/
|
|
3286
3695
|
getStageInstance: (channelId: BigString) => Promise<Camelize<DiscordStageInstance>>;
|
|
3696
|
+
/**
|
|
3697
|
+
* Returns a sticker object for the given sticker ID.
|
|
3698
|
+
*
|
|
3699
|
+
* @param stickerId The ID of the sticker to get
|
|
3700
|
+
* @returns A {@link DiscordSticker}
|
|
3701
|
+
*
|
|
3702
|
+
* @see {@link https://discord.com/developers/docs/resources/sticker#get-sticker}
|
|
3703
|
+
*/
|
|
3704
|
+
getSticker: (stickerId: BigString) => Promise<Camelize<DiscordSticker>>;
|
|
3287
3705
|
/**
|
|
3288
3706
|
* Gets a thread member by their user ID.
|
|
3289
3707
|
*
|
|
@@ -3313,6 +3731,29 @@ export interface RestManager {
|
|
|
3313
3731
|
* @returns {Camelize<DiscordUser>}
|
|
3314
3732
|
*/
|
|
3315
3733
|
getUser: (id: BigString) => Promise<Camelize<DiscordUser>>;
|
|
3734
|
+
/**
|
|
3735
|
+
* Gets information about the vanity url of a guild.
|
|
3736
|
+
*
|
|
3737
|
+
* @param guildId - The ID of the guild to get the vanity url information for.
|
|
3738
|
+
* @returns An instance of {@link VanityUrl}.
|
|
3739
|
+
*
|
|
3740
|
+
* @remarks
|
|
3741
|
+
* Requires the `MANAGE_GUILD` permission.
|
|
3742
|
+
*
|
|
3743
|
+
* The `code` property will be `null` if the guild does not have a set vanity url.
|
|
3744
|
+
*
|
|
3745
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-vanity-url}
|
|
3746
|
+
*/
|
|
3747
|
+
getVanityUrl: (guildId: BigString) => Promise<Camelize<DiscordVanityUrl>>;
|
|
3748
|
+
/**
|
|
3749
|
+
* Gets the list of voice regions for a guild.
|
|
3750
|
+
*
|
|
3751
|
+
* @param guildId - The ID of the guild to get the voice regions for.
|
|
3752
|
+
* @returns A collection of {@link VoiceRegions | VoiceRegion} objects assorted by voice region ID.
|
|
3753
|
+
*
|
|
3754
|
+
* @see {@link https://discord.com/developers/docs/resources/guild#get-guild-voice-regions}
|
|
3755
|
+
*/
|
|
3756
|
+
getVoiceRegions: (guildId: BigString) => Promise<Camelize<DiscordVoiceRegion[]>>;
|
|
3316
3757
|
/**
|
|
3317
3758
|
* Gets a webhook by its ID.
|
|
3318
3759
|
*
|