@discordjs/core 2.3.0 → 2.5.0
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/http-only.d.mts +349 -53
- package/dist/http-only.d.ts +349 -53
- package/dist/http-only.js +272 -150
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +274 -151
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +394 -53
- package/dist/index.d.ts +394 -53
- package/dist/index.js +387 -171
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +381 -165
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -14
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { REST, RequestData, RawFile } from '@discordjs/rest';
|
|
2
2
|
import * as discord_api_types_v10 from 'discord-api-types/v10';
|
|
3
|
-
import { Snowflake, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, RESTPostAPIApplicationCommandsJSONBody, RESTPatchAPIApplicationCommandJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIApplicationGuildCommandsResult, RESTPostAPIApplicationGuildCommandsJSONBody, RESTPostAPIApplicationGuildCommandsResult, RESTGetAPIApplicationGuildCommandResult, RESTPatchAPIApplicationGuildCommandJSONBody, RESTPatchAPIApplicationGuildCommandResult, RESTPutAPIApplicationGuildCommandsJSONBody, RESTPutAPIApplicationGuildCommandsResult, RESTGetAPIGuildApplicationCommandsPermissionsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPatchCurrentApplicationJSONBody, RESTGetAPIApplicationEmojisResult, RESTPostAPIApplicationEmojiJSONBody, RESTPatchAPIApplicationEmojiJSONBody,
|
|
3
|
+
import { Snowflake, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, RESTPostAPIApplicationCommandsJSONBody, RESTPatchAPIApplicationCommandJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIApplicationGuildCommandsResult, RESTPostAPIApplicationGuildCommandsJSONBody, RESTPostAPIApplicationGuildCommandsResult, RESTGetAPIApplicationGuildCommandResult, RESTPatchAPIApplicationGuildCommandJSONBody, RESTPatchAPIApplicationGuildCommandResult, RESTPutAPIApplicationGuildCommandsJSONBody, RESTPutAPIApplicationGuildCommandsResult, RESTGetAPIGuildApplicationCommandsPermissionsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPatchCurrentApplicationJSONBody, RESTGetAPIApplicationEmojisResult, RESTPostAPIApplicationEmojiJSONBody, RESTPatchAPIApplicationEmojiJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelThreadsJSONBody, RESTPostAPIChannelThreadsResult, RESTPostAPIGuildForumThreadsJSONBody, APIThreadChannel, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPostAPIChannelWebhookJSONBody, RESTGetAPIChannelWebhooksResult, RESTPutAPIChannelPermissionJSONBody, RESTPostAPISoundboardSendSoundJSONBody, RESTPutAPIChannelRecipientJSONBody, RESTGetAPIGuildResult, RESTGetAPIGuildQuery, RESTPostAPIGuildsJSONBody, RESTPatchAPIGuildJSONBody, RESTPutAPIGuildMemberJSONBody, RESTPutAPIGuildMemberResult, RESTGetAPIGuildMembersQuery, RESTGetAPIGuildMembersResult, RESTGetAPIGuildChannelsResult, RESTPostAPIGuildChannelJSONBody, RESTPatchAPIGuildChannelPositionsJSONBody, RESTGetAPIGuildBansQuery, RESTGetAPIGuildBansResult, RESTPutAPIGuildBanJSONBody, RESTPostAPIGuildBulkBanJSONBody, RESTPostAPIGuildBulkBanResult, RESTGetAPIGuildRolesResult, RESTPostAPIGuildRoleJSONBody, RESTPatchAPIGuildRolePositionsJSONBody, RESTPatchAPIGuildRolePositionsResult, RESTPatchAPIGuildRoleJSONBody, GuildMFALevel, RESTGetAPIGuildPruneCountQuery, RESTGetAPIGuildPruneCountResult, RESTPostAPIGuildPruneJSONBody, RESTPostAPIGuildPruneResult, RESTGetAPIGuildVoiceRegionsResult, RESTGetAPIGuildInvitesResult, RESTGetAPIGuildIntegrationsResult, RESTPatchAPIGuildWidgetSettingsJSONBody, RESTGetAPIGuildVanityUrlResult, GuildWidgetStyle, RESTPatchAPIGuildWelcomeScreenJSONBody, RESTPatchAPIGuildVoiceStateUserJSONBody, RESTGetAPIGuildEmojisResult, RESTPostAPIGuildEmojiJSONBody, RESTPatchAPIGuildEmojiJSONBody, RESTGetAPIGuildScheduledEventsQuery, RESTGetAPIGuildScheduledEventsResult, RESTPostAPIGuildScheduledEventJSONBody, RESTGetAPIGuildScheduledEventQuery, RESTPatchAPIGuildScheduledEventJSONBody, RESTGetAPIGuildScheduledEventUsersQuery, RESTGetAPIGuildScheduledEventUsersResult, RESTGetAPIGuildTemplatesResult, RESTPatchAPIGuildTemplateJSONBody, RESTGetAPIGuildStickersResult, RESTPostAPIGuildStickerFormDataBody, RESTPatchAPIGuildStickerJSONBody, RESTGetAPIAuditLogQuery, RESTGetAPIAutoModerationRulesResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleJSONBody, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTGetAPIGuildMessagesSearchQuery, RESTGetAPIGuildMessagesSearchResult, RESTPatchAPIGuildMemberJSONBody, RESTPostAPIGuildTemplatesJSONBody, RESTGetAPIGuildWebhooksResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPutAPIGuildOnboardingJSONBody, RESTGetAPIGuildSoundboardSoundsResult, RESTPostAPIGuildSoundboardSoundJSONBody, RESTPatchAPIGuildSoundboardSoundJSONBody, RESTPutAPIGuildIncidentActionsJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, RESTPatchAPIWebhookWithTokenMessageQuery, APIInteractionResponseCallbackData, RESTPostAPIInteractionCallbackQuery, RESTPostAPIInteractionCallbackWithResponseResult, APIInteractionResponseDeferredChannelMessageWithSource, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTGetAPIInviteQuery, RESTGetAPISKUsResult, RESTGetAPISKUSubscriptionsQuery, RESTGetAPISKUSubscriptionsResult, RESTGetAPIEntitlementsQuery, RESTGetAPIEntitlementsResult, RESTPostAPIEntitlementJSONBody, RESTOAuth2AuthorizationQuery, RESTPostOAuth2AccessTokenURLEncodedData, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2RefreshTokenURLEncodedData, RESTPostOAuth2ClientCredentialsURLEncodedData, RESTGetAPIOAuth2CurrentAuthorizationResult, RESTPostOAuth2TokenRevocationQuery, RESTGetAPIPollAnswerVotersQuery, RESTGetAPIPollAnswerVotersResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTGetAPISoundboardDefaultSoundsResult, RESTPostAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceJSONBody, RESTGetStickerPacksResult, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, RESTPatchAPICurrentGuildMemberJSONBody, RESTGetAPICurrentUserConnectionsResult, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTGetAPIVoiceRegionsResult, GatewaySendPayload, GatewayDispatchEvents, GatewayApplicationCommandPermissionsUpdateDispatchData, GatewayAutoModerationActionExecutionDispatchData, GatewayAutoModerationRuleCreateDispatchData, GatewayAutoModerationRuleDeleteDispatchData, GatewayAutoModerationRuleUpdateDispatchData, GatewayChannelCreateDispatchData, GatewayChannelDeleteDispatchData, GatewayChannelPinsUpdateDispatchData, GatewayChannelUpdateDispatchData, GatewayEntitlementCreateDispatchData, GatewayEntitlementDeleteDispatchData, GatewayEntitlementUpdateDispatchData, GatewayGuildAuditLogEntryCreateDispatchData, GatewayGuildBanAddDispatchData, GatewayGuildBanRemoveDispatchData, GatewayGuildCreateDispatchData, GatewayGuildDeleteDispatchData, GatewayGuildEmojisUpdateDispatchData, GatewayGuildIntegrationsUpdateDispatchData, GatewayGuildMemberAddDispatchData, GatewayGuildMemberRemoveDispatchData, GatewayGuildMemberUpdateDispatchData, GatewayGuildMembersChunkDispatchData, GatewayGuildRoleCreateDispatchData, GatewayGuildRoleDeleteDispatchData, GatewayGuildRoleUpdateDispatchData, GatewayGuildScheduledEventCreateDispatchData, GatewayGuildScheduledEventDeleteDispatchData, GatewayGuildScheduledEventUpdateDispatchData, GatewayGuildScheduledEventUserAddDispatchData, GatewayGuildScheduledEventUserRemoveDispatchData, GatewayGuildSoundboardSoundCreateDispatch, GatewayGuildSoundboardSoundDeleteDispatch, GatewayGuildSoundboardSoundUpdateDispatch, GatewayGuildSoundboardSoundsUpdateDispatch, GatewaySoundboardSoundsDispatchData, GatewayGuildStickersUpdateDispatchData, GatewayGuildUpdateDispatchData, GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntegrationUpdateDispatchData, GatewayInteractionCreateDispatchData, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageCreateDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessagePollVoteDispatchData, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData, GatewayPresenceUpdateDispatchData, GatewayRateLimitedDispatchData, GatewayReadyDispatchData, GatewayStageInstanceCreateDispatchData, GatewayStageInstanceDeleteDispatchData, GatewayStageInstanceUpdateDispatchData, GatewaySubscriptionCreateDispatchData, GatewaySubscriptionDeleteDispatchData, GatewaySubscriptionUpdateDispatchData, GatewayThreadCreateDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSyncDispatchData, GatewayThreadMemberUpdateDispatchData, GatewayThreadMembersUpdateDispatchData, GatewayThreadUpdateDispatchData, GatewayTypingStartDispatchData, GatewayUserUpdateDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GatewayRequestGuildMembersData, GatewayRequestSoundboardSoundsData, GatewayVoiceStateUpdateData, GatewayPresenceUpdateData } from 'discord-api-types/v10';
|
|
4
4
|
export * from 'discord-api-types/v10';
|
|
5
5
|
import { AsyncEventEmitter } from '@vladfrangu/async_event_emitter';
|
|
6
6
|
import { Awaitable } from '@discordjs/util';
|
|
7
|
+
export { GatewayRateLimitError } from '@discordjs/util';
|
|
7
8
|
import { WebSocketShardEvents, ManagerShardEventsMap as ManagerShardEventsMap$1 } from '@discordjs/ws';
|
|
8
9
|
import * as discord_api_types_globals from 'discord-api-types/globals';
|
|
9
10
|
|
|
@@ -229,6 +230,12 @@ interface StartForumThreadOptions extends RESTPostAPIGuildForumThreadsJSONBody {
|
|
|
229
230
|
files?: RawFile[];
|
|
230
231
|
};
|
|
231
232
|
}
|
|
233
|
+
interface CreateMessageOptions extends RESTPostAPIChannelMessageJSONBody {
|
|
234
|
+
files?: RawFile[];
|
|
235
|
+
}
|
|
236
|
+
interface EditMessageOptions extends RESTPatchAPIChannelMessageJSONBody {
|
|
237
|
+
files?: RawFile[];
|
|
238
|
+
}
|
|
232
239
|
declare class ChannelsAPI {
|
|
233
240
|
private readonly rest;
|
|
234
241
|
constructor(rest: REST);
|
|
@@ -240,9 +247,7 @@ declare class ChannelsAPI {
|
|
|
240
247
|
* @param body - The data for sending the message
|
|
241
248
|
* @param options - The options for sending the message
|
|
242
249
|
*/
|
|
243
|
-
createMessage(channelId: Snowflake, { files, ...body }:
|
|
244
|
-
files?: RawFile[];
|
|
245
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
250
|
+
createMessage(channelId: Snowflake, { files, ...body }: CreateMessageOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
246
251
|
/**
|
|
247
252
|
* Edits a message
|
|
248
253
|
*
|
|
@@ -252,9 +257,7 @@ declare class ChannelsAPI {
|
|
|
252
257
|
* @param body - The data for editing the message
|
|
253
258
|
* @param options - The options for editing the message
|
|
254
259
|
*/
|
|
255
|
-
editMessage(channelId: Snowflake, messageId: Snowflake, { files, ...body }:
|
|
256
|
-
files?: RawFile[];
|
|
257
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
260
|
+
editMessage(channelId: Snowflake, messageId: Snowflake, { files, ...body }: EditMessageOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
258
261
|
/**
|
|
259
262
|
* Fetches the reactions for a message
|
|
260
263
|
*
|
|
@@ -521,6 +524,15 @@ declare class ChannelsAPI {
|
|
|
521
524
|
* @param options - The options for deleting the permission overwrite
|
|
522
525
|
*/
|
|
523
526
|
deletePermissionOverwrite(channelId: Snowflake, overwriteId: Snowflake, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<void>;
|
|
527
|
+
/**
|
|
528
|
+
* Sends a soundboard sound in a channel
|
|
529
|
+
*
|
|
530
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound}
|
|
531
|
+
* @param channelId - The id of the channel to send the soundboard sound in
|
|
532
|
+
* @param body - The data for sending the soundboard sound
|
|
533
|
+
* @param options - The options for sending the soundboard sound
|
|
534
|
+
*/
|
|
535
|
+
sendSoundboardSound(channelId: Snowflake, body: RESTPostAPISoundboardSendSoundJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<never>;
|
|
524
536
|
/**
|
|
525
537
|
* Adds a recipient to a group DM channel
|
|
526
538
|
*
|
|
@@ -561,6 +573,9 @@ declare class GatewayAPI {
|
|
|
561
573
|
getBot({ signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIGatewayBotInfo>;
|
|
562
574
|
}
|
|
563
575
|
|
|
576
|
+
interface CreateStickerOptions extends Omit<RESTPostAPIGuildStickerFormDataBody, 'file'> {
|
|
577
|
+
file: RawFile;
|
|
578
|
+
}
|
|
564
579
|
declare class GuildsAPI {
|
|
565
580
|
private readonly rest;
|
|
566
581
|
constructor(rest: REST);
|
|
@@ -628,7 +643,7 @@ declare class GuildsAPI {
|
|
|
628
643
|
*/
|
|
629
644
|
addMember(guildId: Snowflake, userId: Snowflake, body: RESTPutAPIGuildMemberJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTPutAPIGuildMemberResult>;
|
|
630
645
|
/**
|
|
631
|
-
* Fetches
|
|
646
|
+
* Fetches members of a guild.
|
|
632
647
|
*
|
|
633
648
|
* @see {@link https://discord.com/developers/docs/resources/guild#list-guild-members}
|
|
634
649
|
* @param guildId - The id of the guild
|
|
@@ -1064,9 +1079,7 @@ declare class GuildsAPI {
|
|
|
1064
1079
|
* @param body - The data for creating the sticker
|
|
1065
1080
|
* @param options - The options for creating the sticker
|
|
1066
1081
|
*/
|
|
1067
|
-
createSticker(guildId: Snowflake, { file, ...body }:
|
|
1068
|
-
file: RawFile;
|
|
1069
|
-
}, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APISticker>;
|
|
1082
|
+
createSticker(guildId: Snowflake, { file, ...body }: CreateStickerOptions, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APISticker>;
|
|
1070
1083
|
/**
|
|
1071
1084
|
* Edits a sticker for a guild
|
|
1072
1085
|
*
|
|
@@ -1158,6 +1171,15 @@ declare class GuildsAPI {
|
|
|
1158
1171
|
* @param options - The options for searching for guild members
|
|
1159
1172
|
*/
|
|
1160
1173
|
searchForMembers(guildId: Snowflake, query: RESTGetAPIGuildMembersSearchQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildMembersSearchResult>;
|
|
1174
|
+
/**
|
|
1175
|
+
* Searches for messages.
|
|
1176
|
+
*
|
|
1177
|
+
* @see {@link https://docs.discord.com/developers/resources/message#search-guild-messages}
|
|
1178
|
+
* @param guildId - The id of the guild to search in
|
|
1179
|
+
* @param query - The query to search for
|
|
1180
|
+
* @param options - The options for searching for messages
|
|
1181
|
+
*/
|
|
1182
|
+
searchForMessages(guildId: Snowflake, query: RESTGetAPIGuildMessagesSearchQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildMessagesSearchResult>;
|
|
1161
1183
|
/**
|
|
1162
1184
|
* Edits a guild member
|
|
1163
1185
|
*
|
|
@@ -1248,6 +1270,51 @@ declare class GuildsAPI {
|
|
|
1248
1270
|
* @param options - The options for editing the guild onboarding
|
|
1249
1271
|
*/
|
|
1250
1272
|
editOnboarding(guildId: Snowflake, body: RESTPutAPIGuildOnboardingJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIGuildOnboarding>;
|
|
1273
|
+
/**
|
|
1274
|
+
* Fetches all the soundboard sounds for a guild
|
|
1275
|
+
*
|
|
1276
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds}
|
|
1277
|
+
* @param guildId - The id of the guild to fetch the soundboard sounds for
|
|
1278
|
+
* @param options - The options for fetching the soundboard sounds
|
|
1279
|
+
*/
|
|
1280
|
+
getSoundboardSounds(guildId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildSoundboardSoundsResult>;
|
|
1281
|
+
/**
|
|
1282
|
+
* Fetches a soundboard sound for a guild
|
|
1283
|
+
*
|
|
1284
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound}
|
|
1285
|
+
* @param guildId - The id of the guild to fetch the soundboard sound for
|
|
1286
|
+
* @param soundId - The id of the soundboard sound to fetch
|
|
1287
|
+
* @param options - The options for fetching the soundboard sound
|
|
1288
|
+
*/
|
|
1289
|
+
getSoundboardSound(guildId: Snowflake, soundId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APISoundboardSound>;
|
|
1290
|
+
/**
|
|
1291
|
+
* Creates a new soundboard sound for a guild
|
|
1292
|
+
*
|
|
1293
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound}
|
|
1294
|
+
* @param guildId - The id of the guild to create the soundboard sound for
|
|
1295
|
+
* @param body - The data for creating the soundboard sound
|
|
1296
|
+
* @param options - The options for creating the soundboard sound
|
|
1297
|
+
*/
|
|
1298
|
+
createSoundboardSound(guildId: Snowflake, body: RESTPostAPIGuildSoundboardSoundJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APISoundboardSound>;
|
|
1299
|
+
/**
|
|
1300
|
+
* Edits a soundboard sound for a guild
|
|
1301
|
+
*
|
|
1302
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound}
|
|
1303
|
+
* @param guildId - The id of the guild to edit the soundboard sound for
|
|
1304
|
+
* @param soundId - The id of the soundboard sound to edit
|
|
1305
|
+
* @param body - The data for editing the soundboard sound
|
|
1306
|
+
* @param options - The options for editing the soundboard sound
|
|
1307
|
+
*/
|
|
1308
|
+
editSoundboardSound(guildId: Snowflake, soundId: Snowflake, body: RESTPatchAPIGuildSoundboardSoundJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APISoundboardSound>;
|
|
1309
|
+
/**
|
|
1310
|
+
* Deletes a soundboard sound for a guild
|
|
1311
|
+
*
|
|
1312
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound}
|
|
1313
|
+
* @param guildId - The id of the guild to delete the soundboard sound for
|
|
1314
|
+
* @param soundId - The id of the soundboard sound to delete
|
|
1315
|
+
* @param options - The options for deleting the soundboard sound
|
|
1316
|
+
*/
|
|
1317
|
+
deleteSoundboardSound(guildId: Snowflake, soundId: Snowflake, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<void>;
|
|
1251
1318
|
/**
|
|
1252
1319
|
* Modifies incident actions for a guild.
|
|
1253
1320
|
*
|
|
@@ -1259,6 +1326,13 @@ declare class GuildsAPI {
|
|
|
1259
1326
|
editIncidentActions(guildId: Snowflake, body: RESTPutAPIGuildIncidentActionsJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIIncidentsData>;
|
|
1260
1327
|
}
|
|
1261
1328
|
|
|
1329
|
+
type CreateWebhookMessageOptions = RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & {
|
|
1330
|
+
files?: RawFile[];
|
|
1331
|
+
};
|
|
1332
|
+
type EditWebhookMessageOptions = RESTPatchAPIWebhookWithTokenMessageJSONBody & RESTPatchAPIWebhookWithTokenMessageQuery & {
|
|
1333
|
+
files?: RawFile[];
|
|
1334
|
+
thread_id?: string;
|
|
1335
|
+
};
|
|
1262
1336
|
declare class WebhooksAPI {
|
|
1263
1337
|
private readonly rest;
|
|
1264
1338
|
constructor(rest: REST);
|
|
@@ -1305,8 +1379,7 @@ declare class WebhooksAPI {
|
|
|
1305
1379
|
* @param body - The data for executing the webhook
|
|
1306
1380
|
* @param options - The options for executing the webhook
|
|
1307
1381
|
*/
|
|
1308
|
-
execute(id: Snowflake, token: string, body:
|
|
1309
|
-
files?: RawFile[];
|
|
1382
|
+
execute(id: Snowflake, token: string, body: CreateWebhookMessageOptions & {
|
|
1310
1383
|
wait: true;
|
|
1311
1384
|
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIWebhookWithTokenWaitResult>;
|
|
1312
1385
|
/**
|
|
@@ -1318,8 +1391,7 @@ declare class WebhooksAPI {
|
|
|
1318
1391
|
* @param body - The data for executing the webhook
|
|
1319
1392
|
* @param options - The options for executing the webhook
|
|
1320
1393
|
*/
|
|
1321
|
-
execute(id: Snowflake, token: string, body:
|
|
1322
|
-
files?: RawFile[];
|
|
1394
|
+
execute(id: Snowflake, token: string, body: CreateWebhookMessageOptions & {
|
|
1323
1395
|
wait?: false;
|
|
1324
1396
|
}, options?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1325
1397
|
/**
|
|
@@ -1365,9 +1437,7 @@ declare class WebhooksAPI {
|
|
|
1365
1437
|
* @param body - The data for editing the message
|
|
1366
1438
|
* @param options - The options for editing the message
|
|
1367
1439
|
*/
|
|
1368
|
-
editMessage(id: Snowflake, token: string, messageId: Snowflake, { thread_id, with_components, files, ...body }:
|
|
1369
|
-
files?: RawFile[];
|
|
1370
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1440
|
+
editMessage(id: Snowflake, token: string, messageId: Snowflake, { thread_id, with_components, files, ...body }: EditWebhookMessageOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1371
1441
|
/**
|
|
1372
1442
|
* Deletes an associated message from a webhook
|
|
1373
1443
|
*
|
|
@@ -1383,10 +1453,37 @@ declare class WebhooksAPI {
|
|
|
1383
1453
|
}, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1384
1454
|
}
|
|
1385
1455
|
|
|
1456
|
+
interface CreateInteractionResponseOptions extends APIInteractionResponseCallbackData, RESTPostAPIInteractionCallbackQuery {
|
|
1457
|
+
files?: RawFile[];
|
|
1458
|
+
}
|
|
1459
|
+
type CreateInteractionDeferResponseOptions = APIInteractionResponseDeferredChannelMessageWithSource['data'] & RESTPostAPIInteractionCallbackQuery;
|
|
1460
|
+
type CreateInteractionFollowUpResponseOptions = APIInteractionResponseCallbackData & {
|
|
1461
|
+
files?: RawFile[];
|
|
1462
|
+
};
|
|
1463
|
+
type EditInteractionResponseOptions = APIInteractionResponseCallbackData & {
|
|
1464
|
+
files?: RawFile[];
|
|
1465
|
+
};
|
|
1466
|
+
type CreateInteractionUpdateMessageResponseOptions = APIInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & {
|
|
1467
|
+
files?: RawFile[];
|
|
1468
|
+
};
|
|
1469
|
+
type CreateAutocompleteResponseOptions = APICommandAutocompleteInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery;
|
|
1470
|
+
type CreateModalResponseOptions = APIModalInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery;
|
|
1386
1471
|
declare class InteractionsAPI {
|
|
1387
1472
|
private readonly rest;
|
|
1388
1473
|
private readonly webhooks;
|
|
1389
1474
|
constructor(rest: REST, webhooks: WebhooksAPI);
|
|
1475
|
+
/**
|
|
1476
|
+
* Replies to an interaction and returns an interaction callback object
|
|
1477
|
+
*
|
|
1478
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1479
|
+
* @param interactionId - The id of the interaction
|
|
1480
|
+
* @param interactionToken - The token of the interaction
|
|
1481
|
+
* @param body - The callback data for replying
|
|
1482
|
+
* @param options - The options for replying
|
|
1483
|
+
*/
|
|
1484
|
+
reply(interactionId: Snowflake, interactionToken: string, body: CreateInteractionResponseOptions & {
|
|
1485
|
+
with_response: true;
|
|
1486
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1390
1487
|
/**
|
|
1391
1488
|
* Replies to an interaction
|
|
1392
1489
|
*
|
|
@@ -1396,28 +1493,87 @@ declare class InteractionsAPI {
|
|
|
1396
1493
|
* @param body - The callback data for replying
|
|
1397
1494
|
* @param options - The options for replying
|
|
1398
1495
|
*/
|
|
1399
|
-
reply(interactionId: Snowflake, interactionToken: string,
|
|
1400
|
-
|
|
1401
|
-
},
|
|
1496
|
+
reply(interactionId: Snowflake, interactionToken: string, body: CreateInteractionResponseOptions & {
|
|
1497
|
+
with_response?: false;
|
|
1498
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1499
|
+
/**
|
|
1500
|
+
* Replies to an interaction
|
|
1501
|
+
*
|
|
1502
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1503
|
+
* @param interactionId - The id of the interaction
|
|
1504
|
+
* @param interactionToken - The token of the interaction
|
|
1505
|
+
* @param body - The callback data for replying
|
|
1506
|
+
* @param options - The options for replying
|
|
1507
|
+
*/
|
|
1508
|
+
reply(interactionId: Snowflake, interactionToken: string, body: CreateInteractionResponseOptions, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
|
|
1509
|
+
/**
|
|
1510
|
+
* Defers the reply to an interaction and returns an interaction callback object
|
|
1511
|
+
*
|
|
1512
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1513
|
+
* @param interactionId - The id of the interaction
|
|
1514
|
+
* @param interactionToken - The token of the interaction
|
|
1515
|
+
* @param body - The callback data for deferring the reply
|
|
1516
|
+
* @param options - The options for deferring
|
|
1517
|
+
*/
|
|
1518
|
+
defer(interactionId: Snowflake, interactionToken: string, body: CreateInteractionDeferResponseOptions & {
|
|
1519
|
+
with_response: true;
|
|
1520
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1521
|
+
/**
|
|
1522
|
+
* Defers the reply to an interaction
|
|
1523
|
+
*
|
|
1524
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1525
|
+
* @param interactionId - The id of the interaction
|
|
1526
|
+
* @param interactionToken - The token of the interaction
|
|
1527
|
+
* @param body - The callback data for deferring the reply
|
|
1528
|
+
* @param options - The options for deferring
|
|
1529
|
+
*/
|
|
1530
|
+
defer(interactionId: Snowflake, interactionToken: string, body?: CreateInteractionDeferResponseOptions & {
|
|
1531
|
+
with_response?: false;
|
|
1532
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1402
1533
|
/**
|
|
1403
1534
|
* Defers the reply to an interaction
|
|
1404
1535
|
*
|
|
1405
1536
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1406
1537
|
* @param interactionId - The id of the interaction
|
|
1407
1538
|
* @param interactionToken - The token of the interaction
|
|
1408
|
-
* @param
|
|
1539
|
+
* @param body - The callback data for deferring the reply
|
|
1540
|
+
* @param options - The options for deferring
|
|
1541
|
+
*/
|
|
1542
|
+
defer(interactionId: Snowflake, interactionToken: string, body?: CreateInteractionDeferResponseOptions, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
|
|
1543
|
+
/**
|
|
1544
|
+
* Defers an update from a message component interaction and returns an interaction callback object
|
|
1545
|
+
*
|
|
1546
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1547
|
+
* @param interactionId - The id of the interaction
|
|
1548
|
+
* @param interactionToken - The token of the interaction
|
|
1549
|
+
* @param body - The callback data for deferring the update
|
|
1550
|
+
* @param options - The options for deferring
|
|
1551
|
+
*/
|
|
1552
|
+
deferMessageUpdate(interactionId: Snowflake, interactionToken: string, body: RESTPostAPIInteractionCallbackQuery & {
|
|
1553
|
+
with_response: true;
|
|
1554
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1555
|
+
/**
|
|
1556
|
+
* Defers an update from a message component interaction
|
|
1557
|
+
*
|
|
1558
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1559
|
+
* @param interactionId - The id of the interaction
|
|
1560
|
+
* @param interactionToken - The token of the interaction
|
|
1561
|
+
* @param body - The callback data for deferring the update
|
|
1409
1562
|
* @param options - The options for deferring
|
|
1410
1563
|
*/
|
|
1411
|
-
|
|
1564
|
+
deferMessageUpdate(interactionId: Snowflake, interactionToken: string, body?: RESTPostAPIInteractionCallbackQuery & {
|
|
1565
|
+
with_response?: false;
|
|
1566
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1412
1567
|
/**
|
|
1413
1568
|
* Defers an update from a message component interaction
|
|
1414
1569
|
*
|
|
1415
1570
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1416
1571
|
* @param interactionId - The id of the interaction
|
|
1417
1572
|
* @param interactionToken - The token of the interaction
|
|
1573
|
+
* @param body - The callback data for deferring the update
|
|
1418
1574
|
* @param options - The options for deferring
|
|
1419
1575
|
*/
|
|
1420
|
-
deferMessageUpdate(interactionId: Snowflake, interactionToken: string,
|
|
1576
|
+
deferMessageUpdate(interactionId: Snowflake, interactionToken: string, body?: RESTPostAPIInteractionCallbackQuery, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
|
|
1421
1577
|
/**
|
|
1422
1578
|
* Reply to a deferred interaction
|
|
1423
1579
|
*
|
|
@@ -1427,9 +1583,7 @@ declare class InteractionsAPI {
|
|
|
1427
1583
|
* @param body - The callback data for replying
|
|
1428
1584
|
* @param options - The options for replying
|
|
1429
1585
|
*/
|
|
1430
|
-
followUp(applicationId: Snowflake, interactionToken: string, body:
|
|
1431
|
-
files?: RawFile[];
|
|
1432
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1586
|
+
followUp(applicationId: Snowflake, interactionToken: string, body: CreateInteractionFollowUpResponseOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1433
1587
|
/**
|
|
1434
1588
|
* Edits the initial reply to an interaction
|
|
1435
1589
|
*
|
|
@@ -1441,9 +1595,7 @@ declare class InteractionsAPI {
|
|
|
1441
1595
|
* @param messageId - The id of the message to edit. If omitted, the original reply will be edited
|
|
1442
1596
|
* @param options - The options for editing the reply
|
|
1443
1597
|
*/
|
|
1444
|
-
editReply(applicationId: Snowflake, interactionToken: string, callbackData:
|
|
1445
|
-
files?: RawFile[];
|
|
1446
|
-
}, messageId?: Snowflake | '@original', { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1598
|
+
editReply(applicationId: Snowflake, interactionToken: string, callbackData: EditInteractionResponseOptions, messageId?: Snowflake | '@original', { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1447
1599
|
/**
|
|
1448
1600
|
* Fetches the initial reply to an interaction
|
|
1449
1601
|
*
|
|
@@ -1464,6 +1616,18 @@ declare class InteractionsAPI {
|
|
|
1464
1616
|
* @param options - The options for deleting the reply
|
|
1465
1617
|
*/
|
|
1466
1618
|
deleteReply(applicationId: Snowflake, interactionToken: string, messageId?: Snowflake | '@original', { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1619
|
+
/**
|
|
1620
|
+
* Updates the message the component interaction was triggered on and returns an interaction callback object
|
|
1621
|
+
*
|
|
1622
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1623
|
+
* @param interactionId - The id of the interaction
|
|
1624
|
+
* @param interactionToken - The token of the interaction
|
|
1625
|
+
* @param callbackData - The callback data for updating the interaction
|
|
1626
|
+
* @param options - The options for updating the interaction
|
|
1627
|
+
*/
|
|
1628
|
+
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData: CreateInteractionUpdateMessageResponseOptions & {
|
|
1629
|
+
with_response: true;
|
|
1630
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1467
1631
|
/**
|
|
1468
1632
|
* Updates the message the component interaction was triggered on
|
|
1469
1633
|
*
|
|
@@ -1473,9 +1637,43 @@ declare class InteractionsAPI {
|
|
|
1473
1637
|
* @param callbackData - The callback data for updating the interaction
|
|
1474
1638
|
* @param options - The options for updating the interaction
|
|
1475
1639
|
*/
|
|
1476
|
-
updateMessage(interactionId: Snowflake, interactionToken: string,
|
|
1477
|
-
|
|
1478
|
-
},
|
|
1640
|
+
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData: CreateInteractionUpdateMessageResponseOptions & {
|
|
1641
|
+
with_response?: false;
|
|
1642
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1643
|
+
/**
|
|
1644
|
+
* Updates the message the component interaction was triggered on
|
|
1645
|
+
*
|
|
1646
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1647
|
+
* @param interactionId - The id of the interaction
|
|
1648
|
+
* @param interactionToken - The token of the interaction
|
|
1649
|
+
* @param callbackData - The callback data for updating the interaction
|
|
1650
|
+
* @param options - The options for updating the interaction
|
|
1651
|
+
*/
|
|
1652
|
+
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData: CreateInteractionUpdateMessageResponseOptions, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
|
|
1653
|
+
/**
|
|
1654
|
+
* Sends an autocomplete response to an interaction and returns an interaction callback object
|
|
1655
|
+
*
|
|
1656
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1657
|
+
* @param interactionId - The id of the interaction
|
|
1658
|
+
* @param interactionToken - The token of the interaction
|
|
1659
|
+
* @param callbackData - The callback data for the autocomplete response
|
|
1660
|
+
* @param options - The options for sending the autocomplete response
|
|
1661
|
+
*/
|
|
1662
|
+
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData: CreateAutocompleteResponseOptions & {
|
|
1663
|
+
with_response: true;
|
|
1664
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1665
|
+
/**
|
|
1666
|
+
* Sends an autocomplete response to an interaction
|
|
1667
|
+
*
|
|
1668
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1669
|
+
* @param interactionId - The id of the interaction
|
|
1670
|
+
* @param interactionToken - The token of the interaction
|
|
1671
|
+
* @param callbackData - The callback data for the autocomplete response
|
|
1672
|
+
* @param options - The options for sending the autocomplete response
|
|
1673
|
+
*/
|
|
1674
|
+
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData: CreateAutocompleteResponseOptions & {
|
|
1675
|
+
with_response?: false;
|
|
1676
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1479
1677
|
/**
|
|
1480
1678
|
* Sends an autocomplete response to an interaction
|
|
1481
1679
|
*
|
|
@@ -1485,7 +1683,19 @@ declare class InteractionsAPI {
|
|
|
1485
1683
|
* @param callbackData - The callback data for the autocomplete response
|
|
1486
1684
|
* @param options - The options for sending the autocomplete response
|
|
1487
1685
|
*/
|
|
1488
|
-
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1686
|
+
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData: CreateAutocompleteResponseOptions, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
|
|
1687
|
+
/**
|
|
1688
|
+
* Sends a modal response to an interaction and returns an interaction callback object
|
|
1689
|
+
*
|
|
1690
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1691
|
+
* @param interactionId - The id of the interaction
|
|
1692
|
+
* @param interactionToken - The token of the interaction
|
|
1693
|
+
* @param callbackData - The modal callback data to send
|
|
1694
|
+
* @param options - The options for sending the modal
|
|
1695
|
+
*/
|
|
1696
|
+
createModal(interactionId: Snowflake, interactionToken: string, callbackData: CreateModalResponseOptions & {
|
|
1697
|
+
with_response: true;
|
|
1698
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1489
1699
|
/**
|
|
1490
1700
|
* Sends a modal response to an interaction
|
|
1491
1701
|
*
|
|
@@ -1495,9 +1705,21 @@ declare class InteractionsAPI {
|
|
|
1495
1705
|
* @param callbackData - The modal callback data to send
|
|
1496
1706
|
* @param options - The options for sending the modal
|
|
1497
1707
|
*/
|
|
1498
|
-
createModal(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1708
|
+
createModal(interactionId: Snowflake, interactionToken: string, callbackData: CreateModalResponseOptions & {
|
|
1709
|
+
with_response?: false;
|
|
1710
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1499
1711
|
/**
|
|
1500
|
-
* Sends a
|
|
1712
|
+
* Sends a modal response to an interaction
|
|
1713
|
+
*
|
|
1714
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1715
|
+
* @param interactionId - The id of the interaction
|
|
1716
|
+
* @param interactionToken - The token of the interaction
|
|
1717
|
+
* @param callbackData - The modal callback data to send
|
|
1718
|
+
* @param options - The options for sending the modal
|
|
1719
|
+
*/
|
|
1720
|
+
createModal(interactionId: Snowflake, interactionToken: string, callbackData: CreateModalResponseOptions, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
|
|
1721
|
+
/**
|
|
1722
|
+
* Launches an activity and returns an interaction callback object
|
|
1501
1723
|
*
|
|
1502
1724
|
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1503
1725
|
* @param interactionId - The id of the interaction
|
|
@@ -1506,6 +1728,40 @@ declare class InteractionsAPI {
|
|
|
1506
1728
|
* @deprecated Sending a premium-style button is the new Discord behavior.
|
|
1507
1729
|
*/
|
|
1508
1730
|
sendPremiumRequired(interactionId: Snowflake, interactionToken: string, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1731
|
+
/**
|
|
1732
|
+
* Launches an activity and returns an interaction callback object
|
|
1733
|
+
*
|
|
1734
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1735
|
+
* @param interactionId - The id of the interaction
|
|
1736
|
+
* @param interactionToken - The token of the interaction
|
|
1737
|
+
* @param body - The callback data for launching the activity
|
|
1738
|
+
* @param options - The options for launching the activity
|
|
1739
|
+
*/
|
|
1740
|
+
launchActivity(interactionId: Snowflake, interactionToken: string, body: RESTPostAPIInteractionCallbackQuery & {
|
|
1741
|
+
with_response: true;
|
|
1742
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1743
|
+
/**
|
|
1744
|
+
* Launches an activity
|
|
1745
|
+
*
|
|
1746
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1747
|
+
* @param interactionId - The id of the interaction
|
|
1748
|
+
* @param interactionToken - The token of the interaction
|
|
1749
|
+
* @param body - The callback data for launching the activity
|
|
1750
|
+
* @param options - The options for launching the activity
|
|
1751
|
+
*/
|
|
1752
|
+
launchActivity(interactionId: Snowflake, interactionToken: string, body?: RESTPostAPIInteractionCallbackQuery & {
|
|
1753
|
+
with_response?: false;
|
|
1754
|
+
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1755
|
+
/**
|
|
1756
|
+
* Launches an activity
|
|
1757
|
+
*
|
|
1758
|
+
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response}
|
|
1759
|
+
* @param interactionId - The id of the interaction
|
|
1760
|
+
* @param interactionToken - The token of the interaction
|
|
1761
|
+
* @param body - The callback data for launching the activity
|
|
1762
|
+
* @param options - The options for launching the activity
|
|
1763
|
+
*/
|
|
1764
|
+
launchActivity(interactionId: Snowflake, interactionToken: string, body?: RESTPostAPIInteractionCallbackQuery, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult | undefined>;
|
|
1509
1765
|
}
|
|
1510
1766
|
|
|
1511
1767
|
declare class InvitesAPI {
|
|
@@ -1527,7 +1783,7 @@ declare class InvitesAPI {
|
|
|
1527
1783
|
* @param code - The invite code
|
|
1528
1784
|
* @param options - The options for deleting the invite
|
|
1529
1785
|
*/
|
|
1530
|
-
delete(code: string, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<
|
|
1786
|
+
delete(code: string, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIInvite>;
|
|
1531
1787
|
}
|
|
1532
1788
|
|
|
1533
1789
|
declare class MonetizationAPI {
|
|
@@ -1536,23 +1792,51 @@ declare class MonetizationAPI {
|
|
|
1536
1792
|
/**
|
|
1537
1793
|
* Fetches the SKUs for an application.
|
|
1538
1794
|
*
|
|
1539
|
-
* @see {@link https://discord.com/developers/docs/
|
|
1795
|
+
* @see {@link https://discord.com/developers/docs/resources/sku#list-skus}
|
|
1796
|
+
* @param applicationId - The application id to fetch SKUs for
|
|
1540
1797
|
* @param options - The options for fetching the SKUs.
|
|
1541
1798
|
*/
|
|
1542
1799
|
getSKUs(applicationId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPISKUsResult>;
|
|
1800
|
+
/**
|
|
1801
|
+
* Fetches subscriptions for an SKU.
|
|
1802
|
+
*
|
|
1803
|
+
* @see {@link https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions}
|
|
1804
|
+
* @param skuId - The SKU id to fetch subscriptions for
|
|
1805
|
+
* @param query - The query options for fetching subscriptions
|
|
1806
|
+
* @param options - The options for fetching subscriptions
|
|
1807
|
+
*/
|
|
1808
|
+
getSKUSubscriptions(skuId: Snowflake, query?: RESTGetAPISKUSubscriptionsQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPISKUSubscriptionsResult>;
|
|
1809
|
+
/**
|
|
1810
|
+
* Fetches a subscription for an SKU.
|
|
1811
|
+
*
|
|
1812
|
+
* @see {@link https://discord.com/developers/docs/resources/subscription#get-sku-subscription}
|
|
1813
|
+
* @param skuId - The SKU id to fetch subscription for
|
|
1814
|
+
* @param subscriptionId - The subscription id to fetch
|
|
1815
|
+
* @param options - The options for fetching the subscription
|
|
1816
|
+
*/
|
|
1817
|
+
getSKUSubscription(skuId: Snowflake, subscriptionId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APISubscription>;
|
|
1543
1818
|
/**
|
|
1544
1819
|
* Fetches the entitlements for an application.
|
|
1545
1820
|
*
|
|
1546
|
-
* @see {@link https://discord.com/developers/docs/
|
|
1821
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#list-entitlements}
|
|
1547
1822
|
* @param applicationId - The application id to fetch entitlements for
|
|
1548
1823
|
* @param query - The query options for fetching entitlements
|
|
1549
1824
|
* @param options - The options for fetching entitlements
|
|
1550
1825
|
*/
|
|
1551
|
-
getEntitlements(applicationId: Snowflake, query
|
|
1826
|
+
getEntitlements(applicationId: Snowflake, query?: RESTGetAPIEntitlementsQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIEntitlementsResult>;
|
|
1827
|
+
/**
|
|
1828
|
+
* Fetches an entitlement for an application.
|
|
1829
|
+
*
|
|
1830
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#get-entitlement}
|
|
1831
|
+
* @param applicationId - The application id to fetch the entitlement for
|
|
1832
|
+
* @param entitlementId - The entitlement id to fetch
|
|
1833
|
+
* @param options - The options for fetching the entitlement
|
|
1834
|
+
*/
|
|
1835
|
+
getEntitlement(applicationId: Snowflake, entitlementId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIEntitlement>;
|
|
1552
1836
|
/**
|
|
1553
1837
|
* Creates a test entitlement for an application's SKU.
|
|
1554
1838
|
*
|
|
1555
|
-
* @see {@link https://discord.com/developers/docs/
|
|
1839
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#create-test-entitlement}
|
|
1556
1840
|
* @param applicationId - The application id to create the entitlement for
|
|
1557
1841
|
* @param body - The data for creating the entitlement
|
|
1558
1842
|
* @param options - The options for creating the entitlement
|
|
@@ -1561,7 +1845,7 @@ declare class MonetizationAPI {
|
|
|
1561
1845
|
/**
|
|
1562
1846
|
* Deletes a test entitlement for an application's SKU.
|
|
1563
1847
|
*
|
|
1564
|
-
* @see {@link https://discord.com/developers/docs/
|
|
1848
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement}
|
|
1565
1849
|
* @param applicationId - The application id to delete the entitlement for
|
|
1566
1850
|
* @param entitlementId - The entitlement id to delete
|
|
1567
1851
|
* @param options - The options for deleting the entitlement
|
|
@@ -1570,7 +1854,7 @@ declare class MonetizationAPI {
|
|
|
1570
1854
|
/**
|
|
1571
1855
|
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
1572
1856
|
*
|
|
1573
|
-
* @see {@link https://discord.com/developers/docs/
|
|
1857
|
+
* @see {@link https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement}
|
|
1574
1858
|
* @param applicationId - The application id to consume the entitlement for
|
|
1575
1859
|
* @param entitlementId - The entitlement id to consume
|
|
1576
1860
|
* @param options - The options for consuming the entitlement
|
|
@@ -1620,7 +1904,7 @@ declare class OAuth2API {
|
|
|
1620
1904
|
* @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information}
|
|
1621
1905
|
* @param options - The options for the current bot application information request
|
|
1622
1906
|
*/
|
|
1623
|
-
getCurrentBotApplicationInformation({ signal }?: Pick<RequestData, 'signal'>): Promise<
|
|
1907
|
+
getCurrentBotApplicationInformation({ signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplication>;
|
|
1624
1908
|
/**
|
|
1625
1909
|
* Fetches the current authorization information
|
|
1626
1910
|
*
|
|
@@ -1653,7 +1937,7 @@ declare class PollAPI {
|
|
|
1653
1937
|
* @param query - The query for getting the list of voters
|
|
1654
1938
|
* @param options - The options for getting the list of voters
|
|
1655
1939
|
*/
|
|
1656
|
-
getAnswerVoters(channelId: Snowflake, messageId: Snowflake, answerId: number, query
|
|
1940
|
+
getAnswerVoters(channelId: Snowflake, messageId: Snowflake, answerId: number, query?: RESTGetAPIPollAnswerVotersQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIPollAnswerVotersResult>;
|
|
1657
1941
|
/**
|
|
1658
1942
|
* Immediately expires (i.e. ends) a poll
|
|
1659
1943
|
*
|
|
@@ -1687,6 +1971,18 @@ declare class RoleConnectionsAPI {
|
|
|
1687
1971
|
updateMetadataRecords(applicationId: Snowflake, body: RESTPutAPIApplicationRoleConnectionMetadataJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTPutAPIApplicationRoleConnectionMetadataResult>;
|
|
1688
1972
|
}
|
|
1689
1973
|
|
|
1974
|
+
declare class SoundboardSoundsAPI {
|
|
1975
|
+
private readonly rest;
|
|
1976
|
+
constructor(rest: REST);
|
|
1977
|
+
/**
|
|
1978
|
+
* Fetches all the soundboard default sounds.
|
|
1979
|
+
*
|
|
1980
|
+
* @see {@link https://discord.com/developers/docs/resources/soundboard#list-default-soundboard-sounds}
|
|
1981
|
+
* @param options - The options for fetching the soundboard default sounds.
|
|
1982
|
+
*/
|
|
1983
|
+
getSoundboardDefaultSounds({ signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPISoundboardDefaultSoundsResult>;
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1690
1986
|
declare class StageInstancesAPI {
|
|
1691
1987
|
private readonly rest;
|
|
1692
1988
|
constructor(rest: REST);
|
|
@@ -1968,6 +2264,7 @@ declare class API {
|
|
|
1968
2264
|
readonly oauth2: OAuth2API;
|
|
1969
2265
|
readonly poll: PollAPI;
|
|
1970
2266
|
readonly roleConnections: RoleConnectionsAPI;
|
|
2267
|
+
readonly soundboardSounds: SoundboardSoundsAPI;
|
|
1971
2268
|
readonly stageInstances: StageInstancesAPI;
|
|
1972
2269
|
readonly stickers: StickersAPI;
|
|
1973
2270
|
readonly threads: ThreadsAPI;
|
|
@@ -2039,6 +2336,11 @@ interface MappedEvents {
|
|
|
2039
2336
|
[GatewayDispatchEvents.GuildScheduledEventUserRemove]: [
|
|
2040
2337
|
ToEventProps<GatewayGuildScheduledEventUserRemoveDispatchData>
|
|
2041
2338
|
];
|
|
2339
|
+
[GatewayDispatchEvents.GuildSoundboardSoundCreate]: [ToEventProps<GatewayGuildSoundboardSoundCreateDispatch>];
|
|
2340
|
+
[GatewayDispatchEvents.GuildSoundboardSoundDelete]: [ToEventProps<GatewayGuildSoundboardSoundDeleteDispatch>];
|
|
2341
|
+
[GatewayDispatchEvents.GuildSoundboardSoundUpdate]: [ToEventProps<GatewayGuildSoundboardSoundUpdateDispatch>];
|
|
2342
|
+
[GatewayDispatchEvents.GuildSoundboardSoundsUpdate]: [ToEventProps<GatewayGuildSoundboardSoundsUpdateDispatch>];
|
|
2343
|
+
[GatewayDispatchEvents.SoundboardSounds]: [ToEventProps<GatewaySoundboardSoundsDispatchData>];
|
|
2042
2344
|
[GatewayDispatchEvents.GuildStickersUpdate]: [ToEventProps<GatewayGuildStickersUpdateDispatchData>];
|
|
2043
2345
|
[GatewayDispatchEvents.GuildUpdate]: [ToEventProps<GatewayGuildUpdateDispatchData>];
|
|
2044
2346
|
[GatewayDispatchEvents.IntegrationCreate]: [ToEventProps<GatewayIntegrationCreateDispatchData>];
|
|
@@ -2058,11 +2360,15 @@ interface MappedEvents {
|
|
|
2058
2360
|
[GatewayDispatchEvents.MessageReactionRemoveEmoji]: [ToEventProps<GatewayMessageReactionRemoveEmojiDispatchData>];
|
|
2059
2361
|
[GatewayDispatchEvents.MessageUpdate]: [ToEventProps<GatewayMessageUpdateDispatchData>];
|
|
2060
2362
|
[GatewayDispatchEvents.PresenceUpdate]: [ToEventProps<GatewayPresenceUpdateDispatchData>];
|
|
2363
|
+
[GatewayDispatchEvents.RateLimited]: [ToEventProps<GatewayRateLimitedDispatchData>];
|
|
2061
2364
|
[GatewayDispatchEvents.Ready]: [ToEventProps<GatewayReadyDispatchData>];
|
|
2062
2365
|
[GatewayDispatchEvents.Resumed]: [ToEventProps<never>];
|
|
2063
2366
|
[GatewayDispatchEvents.StageInstanceCreate]: [ToEventProps<GatewayStageInstanceCreateDispatchData>];
|
|
2064
2367
|
[GatewayDispatchEvents.StageInstanceDelete]: [ToEventProps<GatewayStageInstanceDeleteDispatchData>];
|
|
2065
2368
|
[GatewayDispatchEvents.StageInstanceUpdate]: [ToEventProps<GatewayStageInstanceUpdateDispatchData>];
|
|
2369
|
+
[GatewayDispatchEvents.SubscriptionCreate]: [ToEventProps<GatewaySubscriptionCreateDispatchData>];
|
|
2370
|
+
[GatewayDispatchEvents.SubscriptionDelete]: [ToEventProps<GatewaySubscriptionDeleteDispatchData>];
|
|
2371
|
+
[GatewayDispatchEvents.SubscriptionUpdate]: [ToEventProps<GatewaySubscriptionUpdateDispatchData>];
|
|
2066
2372
|
[GatewayDispatchEvents.ThreadCreate]: [ToEventProps<GatewayThreadCreateDispatchData>];
|
|
2067
2373
|
[GatewayDispatchEvents.ThreadDelete]: [ToEventProps<GatewayThreadDeleteDispatchData>];
|
|
2068
2374
|
[GatewayDispatchEvents.ThreadListSync]: [ToEventProps<GatewayThreadListSyncDispatchData>];
|
|
@@ -2132,6 +2438,41 @@ declare class Client extends AsyncEventEmitter<MappedEvents> {
|
|
|
2132
2438
|
notFound: unknown[];
|
|
2133
2439
|
presences: discord_api_types_v10.GatewayGuildMembersChunkPresence[];
|
|
2134
2440
|
}>;
|
|
2441
|
+
/**
|
|
2442
|
+
* Requests soundboard sounds from the gateway and returns an async iterator that yields the data from each soundboard sounds event.
|
|
2443
|
+
*
|
|
2444
|
+
* @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds}
|
|
2445
|
+
* @param options - The options for the request
|
|
2446
|
+
* @param timeout - The timeout for waiting for each soundboard sounds
|
|
2447
|
+
* @example
|
|
2448
|
+
* Requesting soundboard sounds for specific guilds
|
|
2449
|
+
* ```ts
|
|
2450
|
+
* for await (const { guildId, soundboardSounds } of this.requestSoundboardSoundsIterator({
|
|
2451
|
+
* guild_ids: ['1234567890', '9876543210'],
|
|
2452
|
+
* })) {
|
|
2453
|
+
* console.log(`Soundboard sounds for guild ${guildId}:`, soundboardSounds);
|
|
2454
|
+
* }
|
|
2455
|
+
* ```
|
|
2456
|
+
*/
|
|
2457
|
+
requestSoundboardSoundsIterator(options: GatewayRequestSoundboardSoundsData, timeout?: number): AsyncGenerator<{
|
|
2458
|
+
guildId: string;
|
|
2459
|
+
soundboardSounds: discord_api_types_v10.APISoundboardSound[];
|
|
2460
|
+
}, void, unknown>;
|
|
2461
|
+
/**
|
|
2462
|
+
* Requests soundboard sounds from the gateway.
|
|
2463
|
+
*
|
|
2464
|
+
* @see {@link https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds}
|
|
2465
|
+
* @param options - The options for the request
|
|
2466
|
+
* @param timeout - The timeout for waiting for each soundboard sounds event
|
|
2467
|
+
* @example
|
|
2468
|
+
* Requesting soundboard sounds for specific guilds
|
|
2469
|
+
* ```ts
|
|
2470
|
+
* const soundboardSounds = await client.requestSoundboardSounds({ guild_ids: ['1234567890', '9876543210'], });
|
|
2471
|
+
*
|
|
2472
|
+
* console.log(soundboardSounds.get('1234567890'));
|
|
2473
|
+
* ```
|
|
2474
|
+
*/
|
|
2475
|
+
requestSoundboardSounds(options: GatewayRequestSoundboardSoundsData, timeout?: number): Promise<Map<string, discord_api_types_v10.APISoundboardSound[]>>;
|
|
2135
2476
|
/**
|
|
2136
2477
|
* Updates the voice state of the bot user
|
|
2137
2478
|
*
|
|
@@ -2165,18 +2506,18 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
2165
2506
|
description: string | undefined;
|
|
2166
2507
|
}[];
|
|
2167
2508
|
flags?: discord_api_types_v10.MessageFlags | undefined;
|
|
2168
|
-
content?: string | undefined;
|
|
2169
|
-
tts?: boolean | undefined;
|
|
2170
|
-
embeds?: discord_api_types_v10.APIEmbed[] | undefined;
|
|
2509
|
+
content?: string | undefined | undefined;
|
|
2510
|
+
tts?: boolean | undefined | undefined;
|
|
2511
|
+
embeds?: discord_api_types_v10.APIEmbed[] | undefined | undefined;
|
|
2171
2512
|
allowed_mentions?: discord_api_types_v10.APIAllowedMentions | undefined;
|
|
2172
|
-
components?: discord_api_types_v10.APIMessageTopLevelComponent[] | undefined;
|
|
2513
|
+
components?: discord_api_types_v10.APIMessageTopLevelComponent[] | undefined | undefined;
|
|
2173
2514
|
poll?: discord_api_types_v10.RESTAPIPoll | undefined;
|
|
2174
|
-
applied_tags?: discord_api_types_globals.Snowflake[] | undefined;
|
|
2175
|
-
thread_name?: string | undefined;
|
|
2515
|
+
applied_tags?: discord_api_types_globals.Snowflake[] | undefined | undefined;
|
|
2516
|
+
thread_name?: string | undefined | undefined;
|
|
2176
2517
|
};
|
|
2177
2518
|
files: {
|
|
2178
2519
|
name: string;
|
|
2179
|
-
data: string | number | boolean | Uint8Array | Buffer
|
|
2520
|
+
data: string | number | boolean | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>;
|
|
2180
2521
|
}[];
|
|
2181
2522
|
};
|
|
2182
2523
|
|
|
@@ -2186,4 +2527,4 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
2186
2527
|
*/
|
|
2187
2528
|
declare const version: string;
|
|
2188
2529
|
|
|
2189
|
-
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, Client, type ClientOptions, type DescriptiveRawFile, type Gateway, GatewayAPI, GuildsAPI, InteractionsAPI, type IntrinsicProps, InvitesAPI, type ManagerShardEventsMap, type MappedEvents, MonetizationAPI, OAuth2API, PollAPI, type RequestGuildMembersResult, RoleConnectionsAPI, StageInstancesAPI, type StartForumThreadOptions, StickersAPI, ThreadsAPI, type ToEventProps, UsersAPI, VoiceAPI, WebhooksAPI, version, withFiles };
|
|
2530
|
+
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, Client, type ClientOptions, type CreateAutocompleteResponseOptions, type CreateInteractionDeferResponseOptions, type CreateInteractionFollowUpResponseOptions, type CreateInteractionResponseOptions, type CreateInteractionUpdateMessageResponseOptions, type CreateMessageOptions, type CreateModalResponseOptions, type CreateStickerOptions, type CreateWebhookMessageOptions, type DescriptiveRawFile, type EditInteractionResponseOptions, type EditMessageOptions, type EditWebhookMessageOptions, type Gateway, GatewayAPI, GuildsAPI, InteractionsAPI, type IntrinsicProps, InvitesAPI, type ManagerShardEventsMap, type MappedEvents, MonetizationAPI, OAuth2API, PollAPI, type RequestGuildMembersResult, RoleConnectionsAPI, SoundboardSoundsAPI, StageInstancesAPI, type StartForumThreadOptions, StickersAPI, ThreadsAPI, type ToEventProps, UsersAPI, VoiceAPI, WebhooksAPI, version, withFiles };
|