@discordjs/core 3.0.0-dev.1733184836-bd7a99571 → 3.0.0-dev.1733400321-abf4b6103
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 +51 -39
- package/dist/http-only.d.ts +51 -39
- package/dist/http-only.js +7 -30
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +7 -30
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +51 -39
- package/dist/index.d.ts +51 -39
- package/dist/index.js +7 -30
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -30
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelThreadsJSONBody, APIThreadChannel, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPostAPIChannelWebhookJSONBody, RESTGetAPIChannelWebhooksResult, RESTPutAPIChannelPermissionJSONBody, RESTPostAPISoundboardSendSoundJSONBody, 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,
|
|
3
|
+
import { Snowflake, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, RESTPostAPIApplicationCommandsJSONBody, RESTPatchAPIApplicationCommandJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIApplicationGuildCommandsResult, RESTPostAPIApplicationGuildCommandsJSONBody, RESTPostAPIApplicationGuildCommandsResult, RESTGetAPIApplicationGuildCommandResult, RESTPatchAPIApplicationGuildCommandJSONBody, RESTPatchAPIApplicationGuildCommandResult, RESTPutAPIApplicationGuildCommandsJSONBody, RESTPutAPIApplicationGuildCommandsResult, RESTGetAPIGuildApplicationCommandsPermissionsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPatchCurrentApplicationJSONBody, RESTGetAPIApplicationEmojisResult, RESTPostAPIApplicationEmojiJSONBody, RESTPatchAPIApplicationEmojiJSONBody, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelThreadsJSONBody, APIThreadChannel, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPostAPIChannelWebhookJSONBody, RESTGetAPIChannelWebhooksResult, RESTPutAPIChannelPermissionJSONBody, RESTPostAPISoundboardSendSoundJSONBody, RESTPostAPIGuildStickerFormDataBody, 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, RESTPatchAPIGuildStickerJSONBody, RESTGetAPIAuditLogQuery, RESTGetAPIAutoModerationRulesResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleJSONBody, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTPatchAPIGuildMemberJSONBody, RESTPostAPIGuildTemplatesJSONBody, RESTGetAPIGuildWebhooksResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPutAPIGuildOnboardingJSONBody, RESTGetAPIGuildSoundboardSoundsResult, RESTPostAPIGuildSoundboardSoundJSONBody, RESTPatchAPIGuildSoundboardSoundJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, APIInteractionResponseCallbackData, RESTPostAPIInteractionCallbackQuery, APIInteractionResponseDeferredChannelMessageWithSource, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTPostAPIInteractionCallbackWithResponseResult, RESTGetAPIInviteQuery, RESTGetAPISKUsResult, RESTGetAPISKUSubscriptionsQuery, RESTGetAPISKUSubscriptionsResult, RESTGetAPIEntitlementsQuery, RESTGetAPIEntitlementsResult, RESTPostAPIEntitlementJSONBody, RESTOAuth2AuthorizationQuery, RESTPostOAuth2AccessTokenURLEncodedData, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2RefreshTokenURLEncodedData, RESTPostOAuth2ClientCredentialsURLEncodedData, RESTGetAPIOAuth2CurrentApplicationResult, RESTGetAPIOAuth2CurrentAuthorizationResult, RESTPostOAuth2TokenRevocationQuery, RESTGetAPIPollAnswerVotersQuery, RESTGetAPIPollAnswerVotersResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTGetAPISoundboardDefaultSoundsResult, RESTPostAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceJSONBody, RESTGetStickerPacksResult, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, 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, GatewayGuildStickersUpdateDispatchData, GatewayGuildUpdateDispatchData, GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntegrationUpdateDispatchData, GatewayInteractionCreateDispatchData, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageCreateDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessagePollVoteDispatchData, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData, GatewayPresenceUpdateDispatchData, GatewayReadyDispatchData, GatewayStageInstanceCreateDispatchData, GatewayStageInstanceDeleteDispatchData, GatewayStageInstanceUpdateDispatchData, GatewaySubscriptionCreateDispatchData, GatewaySubscriptionDeleteDispatchData, GatewaySubscriptionUpdateDispatchData, GatewayThreadCreateDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSyncDispatchData, GatewayThreadMemberUpdateDispatchData, GatewayThreadMembersUpdateDispatchData, GatewayThreadUpdateDispatchData, GatewayTypingStartDispatchData, GatewayUserUpdateDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GatewayRequestGuildMembersData, 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';
|
|
@@ -229,6 +229,12 @@ interface StartForumThreadOptions extends RESTPostAPIGuildForumThreadsJSONBody {
|
|
|
229
229
|
files?: RawFile[];
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
+
interface CreateMessageOptions extends RESTPostAPIChannelMessageJSONBody {
|
|
233
|
+
files?: RawFile[];
|
|
234
|
+
}
|
|
235
|
+
interface EditMessageOptions extends RESTPatchAPIChannelMessageJSONBody {
|
|
236
|
+
files?: RawFile[];
|
|
237
|
+
}
|
|
232
238
|
declare class ChannelsAPI {
|
|
233
239
|
private readonly rest;
|
|
234
240
|
constructor(rest: REST);
|
|
@@ -240,9 +246,7 @@ declare class ChannelsAPI {
|
|
|
240
246
|
* @param body - The data for sending the message
|
|
241
247
|
* @param options - The options for sending the message
|
|
242
248
|
*/
|
|
243
|
-
createMessage(channelId: Snowflake, { files, ...body }:
|
|
244
|
-
files?: RawFile[];
|
|
245
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
249
|
+
createMessage(channelId: Snowflake, { files, ...body }: CreateMessageOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
246
250
|
/**
|
|
247
251
|
* Edits a message
|
|
248
252
|
*
|
|
@@ -252,9 +256,7 @@ declare class ChannelsAPI {
|
|
|
252
256
|
* @param body - The data for editing the message
|
|
253
257
|
* @param options - The options for editing the message
|
|
254
258
|
*/
|
|
255
|
-
editMessage(channelId: Snowflake, messageId: Snowflake, { files, ...body }:
|
|
256
|
-
files?: RawFile[];
|
|
257
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
259
|
+
editMessage(channelId: Snowflake, messageId: Snowflake, { files, ...body }: EditMessageOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
258
260
|
/**
|
|
259
261
|
* Fetches the reactions for a message
|
|
260
262
|
*
|
|
@@ -572,6 +574,9 @@ declare class ChannelsAPI {
|
|
|
572
574
|
sendSoundboardSound(channelId: Snowflake, body: RESTPostAPISoundboardSendSoundJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APISoundboardSound>;
|
|
573
575
|
}
|
|
574
576
|
|
|
577
|
+
interface CreateStickerOptions extends Omit<RESTPostAPIGuildStickerFormDataBody, 'file'> {
|
|
578
|
+
file: RawFile;
|
|
579
|
+
}
|
|
575
580
|
declare class GuildsAPI {
|
|
576
581
|
private readonly rest;
|
|
577
582
|
constructor(rest: REST);
|
|
@@ -1072,9 +1077,7 @@ declare class GuildsAPI {
|
|
|
1072
1077
|
* @param body - The data for creating the sticker
|
|
1073
1078
|
* @param options - The options for creating the sticker
|
|
1074
1079
|
*/
|
|
1075
|
-
createSticker(guildId: Snowflake, { file, ...body }:
|
|
1076
|
-
file: RawFile;
|
|
1077
|
-
}, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APISticker>;
|
|
1080
|
+
createSticker(guildId: Snowflake, { file, ...body }: CreateStickerOptions, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APISticker>;
|
|
1078
1081
|
/**
|
|
1079
1082
|
* Edits a sticker for a guild
|
|
1080
1083
|
*
|
|
@@ -1303,6 +1306,13 @@ declare class GuildsAPI {
|
|
|
1303
1306
|
deleteSoundboardSound(guildId: Snowflake, soundId: Snowflake, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<void>;
|
|
1304
1307
|
}
|
|
1305
1308
|
|
|
1309
|
+
type CreateWebhookMessageOptions = RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & {
|
|
1310
|
+
files?: RawFile[];
|
|
1311
|
+
};
|
|
1312
|
+
type EditWebhookMessageOptions = RESTPatchAPIWebhookWithTokenMessageJSONBody & {
|
|
1313
|
+
files?: RawFile[];
|
|
1314
|
+
thread_id?: string;
|
|
1315
|
+
};
|
|
1306
1316
|
declare class WebhooksAPI {
|
|
1307
1317
|
private readonly rest;
|
|
1308
1318
|
constructor(rest: REST);
|
|
@@ -1349,8 +1359,7 @@ declare class WebhooksAPI {
|
|
|
1349
1359
|
* @param body - The data for executing the webhook
|
|
1350
1360
|
* @param options - The options for executing the webhook
|
|
1351
1361
|
*/
|
|
1352
|
-
execute(id: Snowflake, token: string, body:
|
|
1353
|
-
files?: RawFile[];
|
|
1362
|
+
execute(id: Snowflake, token: string, body: CreateWebhookMessageOptions & {
|
|
1354
1363
|
wait: true;
|
|
1355
1364
|
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIWebhookWithTokenWaitResult>;
|
|
1356
1365
|
/**
|
|
@@ -1362,8 +1371,7 @@ declare class WebhooksAPI {
|
|
|
1362
1371
|
* @param body - The data for executing the webhook
|
|
1363
1372
|
* @param options - The options for executing the webhook
|
|
1364
1373
|
*/
|
|
1365
|
-
execute(id: Snowflake, token: string, body:
|
|
1366
|
-
files?: RawFile[];
|
|
1374
|
+
execute(id: Snowflake, token: string, body: CreateWebhookMessageOptions & {
|
|
1367
1375
|
wait?: false;
|
|
1368
1376
|
}, options?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1369
1377
|
/**
|
|
@@ -1409,10 +1417,7 @@ declare class WebhooksAPI {
|
|
|
1409
1417
|
* @param body - The data for editing the message
|
|
1410
1418
|
* @param options - The options for editing the message
|
|
1411
1419
|
*/
|
|
1412
|
-
editMessage(id: Snowflake, token: string, messageId: Snowflake, { thread_id, files, ...body }:
|
|
1413
|
-
files?: RawFile[];
|
|
1414
|
-
thread_id?: string;
|
|
1415
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1420
|
+
editMessage(id: Snowflake, token: string, messageId: Snowflake, { thread_id, files, ...body }: EditWebhookMessageOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1416
1421
|
/**
|
|
1417
1422
|
* Deletes an associated message from a webhook
|
|
1418
1423
|
*
|
|
@@ -1428,6 +1433,21 @@ declare class WebhooksAPI {
|
|
|
1428
1433
|
}, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1429
1434
|
}
|
|
1430
1435
|
|
|
1436
|
+
interface CreateInteractionResponseOptions extends APIInteractionResponseCallbackData, RESTPostAPIInteractionCallbackQuery {
|
|
1437
|
+
files?: RawFile[];
|
|
1438
|
+
}
|
|
1439
|
+
type CreateInteractionDeferResponseOptions = APIInteractionResponseDeferredChannelMessageWithSource['data'] & RESTPostAPIInteractionCallbackQuery;
|
|
1440
|
+
type CreateInteractionFollowUpResponseOptions = APIInteractionResponseCallbackData & {
|
|
1441
|
+
files?: RawFile[];
|
|
1442
|
+
};
|
|
1443
|
+
type EditInteractionResponseOptions = APIInteractionResponseCallbackData & {
|
|
1444
|
+
files?: RawFile[];
|
|
1445
|
+
};
|
|
1446
|
+
type CreateInteractionUpdateMessageResponseOptions = APIInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & {
|
|
1447
|
+
files?: RawFile[];
|
|
1448
|
+
};
|
|
1449
|
+
type CreateAutocompleteResponseOptions = APICommandAutocompleteInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery;
|
|
1450
|
+
type CreateModalResponseOptions = APIModalInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery;
|
|
1431
1451
|
declare class InteractionsAPI {
|
|
1432
1452
|
private readonly rest;
|
|
1433
1453
|
private readonly webhooks;
|
|
@@ -1441,8 +1461,7 @@ declare class InteractionsAPI {
|
|
|
1441
1461
|
* @param body - The callback data for replying
|
|
1442
1462
|
* @param options - The options for replying
|
|
1443
1463
|
*/
|
|
1444
|
-
reply(interactionId: Snowflake, interactionToken: string, body:
|
|
1445
|
-
files?: RawFile[];
|
|
1464
|
+
reply(interactionId: Snowflake, interactionToken: string, body: CreateInteractionResponseOptions & {
|
|
1446
1465
|
with_response: true;
|
|
1447
1466
|
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1448
1467
|
/**
|
|
@@ -1454,8 +1473,7 @@ declare class InteractionsAPI {
|
|
|
1454
1473
|
* @param body - The callback data for replying
|
|
1455
1474
|
* @param options - The options for replying
|
|
1456
1475
|
*/
|
|
1457
|
-
reply(interactionId: Snowflake, interactionToken: string, body:
|
|
1458
|
-
files?: RawFile[];
|
|
1476
|
+
reply(interactionId: Snowflake, interactionToken: string, body: CreateInteractionResponseOptions & {
|
|
1459
1477
|
with_response?: false;
|
|
1460
1478
|
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1461
1479
|
/**
|
|
@@ -1467,7 +1485,7 @@ declare class InteractionsAPI {
|
|
|
1467
1485
|
* @param body - The callback data for deferring the reply
|
|
1468
1486
|
* @param options - The options for deferring
|
|
1469
1487
|
*/
|
|
1470
|
-
defer(interactionId: Snowflake, interactionToken: string, body:
|
|
1488
|
+
defer(interactionId: Snowflake, interactionToken: string, body: CreateInteractionDeferResponseOptions & {
|
|
1471
1489
|
with_response: true;
|
|
1472
1490
|
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1473
1491
|
/**
|
|
@@ -1479,7 +1497,7 @@ declare class InteractionsAPI {
|
|
|
1479
1497
|
* @param body - The callback data for deferring the reply
|
|
1480
1498
|
* @param options - The options for deferring
|
|
1481
1499
|
*/
|
|
1482
|
-
defer(interactionId: Snowflake, interactionToken: string, body?:
|
|
1500
|
+
defer(interactionId: Snowflake, interactionToken: string, body?: CreateInteractionDeferResponseOptions & {
|
|
1483
1501
|
with_response?: false;
|
|
1484
1502
|
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1485
1503
|
/**
|
|
@@ -1515,9 +1533,7 @@ declare class InteractionsAPI {
|
|
|
1515
1533
|
* @param body - The callback data for replying
|
|
1516
1534
|
* @param options - The options for replying
|
|
1517
1535
|
*/
|
|
1518
|
-
followUp(applicationId: Snowflake, interactionToken: string, body:
|
|
1519
|
-
files?: RawFile[];
|
|
1520
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1536
|
+
followUp(applicationId: Snowflake, interactionToken: string, body: CreateInteractionFollowUpResponseOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1521
1537
|
/**
|
|
1522
1538
|
* Edits the initial reply to an interaction
|
|
1523
1539
|
*
|
|
@@ -1529,9 +1545,7 @@ declare class InteractionsAPI {
|
|
|
1529
1545
|
* @param messageId - The id of the message to edit. If omitted, the original reply will be edited
|
|
1530
1546
|
* @param options - The options for editing the reply
|
|
1531
1547
|
*/
|
|
1532
|
-
editReply(applicationId: Snowflake, interactionToken: string, callbackData:
|
|
1533
|
-
files?: RawFile[];
|
|
1534
|
-
}, messageId?: Snowflake | '@original', { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1548
|
+
editReply(applicationId: Snowflake, interactionToken: string, callbackData: EditInteractionResponseOptions, messageId?: Snowflake | '@original', { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1535
1549
|
/**
|
|
1536
1550
|
* Fetches the initial reply to an interaction
|
|
1537
1551
|
*
|
|
@@ -1561,8 +1575,7 @@ declare class InteractionsAPI {
|
|
|
1561
1575
|
* @param callbackData - The callback data for updating the interaction
|
|
1562
1576
|
* @param options - The options for updating the interaction
|
|
1563
1577
|
*/
|
|
1564
|
-
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1565
|
-
files?: RawFile[];
|
|
1578
|
+
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData: CreateInteractionUpdateMessageResponseOptions & {
|
|
1566
1579
|
with_response: true;
|
|
1567
1580
|
}, options: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1568
1581
|
/**
|
|
@@ -1574,8 +1587,7 @@ declare class InteractionsAPI {
|
|
|
1574
1587
|
* @param callbackData - The callback data for updating the interaction
|
|
1575
1588
|
* @param options - The options for updating the interaction
|
|
1576
1589
|
*/
|
|
1577
|
-
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1578
|
-
files?: RawFile[];
|
|
1590
|
+
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData: CreateInteractionUpdateMessageResponseOptions & {
|
|
1579
1591
|
with_response?: false;
|
|
1580
1592
|
}, options: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1581
1593
|
/**
|
|
@@ -1587,7 +1599,7 @@ declare class InteractionsAPI {
|
|
|
1587
1599
|
* @param callbackData - The callback data for the autocomplete response
|
|
1588
1600
|
* @param options - The options for sending the autocomplete response
|
|
1589
1601
|
*/
|
|
1590
|
-
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1602
|
+
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData: CreateAutocompleteResponseOptions & {
|
|
1591
1603
|
with_response: true;
|
|
1592
1604
|
}, options?: Pick<RequestData, 'signal'>): Promise<APICommandAutocompleteInteractionResponseCallbackData>;
|
|
1593
1605
|
/**
|
|
@@ -1599,7 +1611,7 @@ declare class InteractionsAPI {
|
|
|
1599
1611
|
* @param callbackData - The callback data for the autocomplete response
|
|
1600
1612
|
* @param options - The options for sending the autocomplete response
|
|
1601
1613
|
*/
|
|
1602
|
-
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1614
|
+
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData: CreateAutocompleteResponseOptions & {
|
|
1603
1615
|
with_response?: false;
|
|
1604
1616
|
}, options: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1605
1617
|
/**
|
|
@@ -1611,7 +1623,7 @@ declare class InteractionsAPI {
|
|
|
1611
1623
|
* @param callbackData - The modal callback data to send
|
|
1612
1624
|
* @param options - The options for sending the modal
|
|
1613
1625
|
*/
|
|
1614
|
-
createModal(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1626
|
+
createModal(interactionId: Snowflake, interactionToken: string, callbackData: CreateModalResponseOptions & {
|
|
1615
1627
|
with_response: true;
|
|
1616
1628
|
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1617
1629
|
/**
|
|
@@ -1623,7 +1635,7 @@ declare class InteractionsAPI {
|
|
|
1623
1635
|
* @param callbackData - The modal callback data to send
|
|
1624
1636
|
* @param options - The options for sending the modal
|
|
1625
1637
|
*/
|
|
1626
|
-
createModal(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1638
|
+
createModal(interactionId: Snowflake, interactionToken: string, callbackData: CreateModalResponseOptions & {
|
|
1627
1639
|
with_response?: false;
|
|
1628
1640
|
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1629
1641
|
/**
|
|
@@ -2354,4 +2366,4 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
2354
2366
|
*/
|
|
2355
2367
|
declare const version: string;
|
|
2356
2368
|
|
|
2357
|
-
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, Client, type ClientOptions, type DescriptiveRawFile, type Gateway, 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 };
|
|
2369
|
+
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, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelThreadsJSONBody, APIThreadChannel, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPostAPIChannelWebhookJSONBody, RESTGetAPIChannelWebhooksResult, RESTPutAPIChannelPermissionJSONBody, RESTPostAPISoundboardSendSoundJSONBody, 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,
|
|
3
|
+
import { Snowflake, RESTGetAPIApplicationCommandsQuery, RESTGetAPIApplicationCommandsResult, RESTPostAPIApplicationCommandsJSONBody, RESTPatchAPIApplicationCommandJSONBody, RESTPutAPIApplicationCommandsJSONBody, RESTPutAPIApplicationCommandsResult, RESTGetAPIApplicationGuildCommandsQuery, RESTGetAPIApplicationGuildCommandsResult, RESTPostAPIApplicationGuildCommandsJSONBody, RESTPostAPIApplicationGuildCommandsResult, RESTGetAPIApplicationGuildCommandResult, RESTPatchAPIApplicationGuildCommandJSONBody, RESTPatchAPIApplicationGuildCommandResult, RESTPutAPIApplicationGuildCommandsJSONBody, RESTPutAPIApplicationGuildCommandsResult, RESTGetAPIGuildApplicationCommandsPermissionsResult, RESTPutAPIApplicationCommandPermissionsJSONBody, RESTPatchCurrentApplicationJSONBody, RESTGetAPIApplicationEmojisResult, RESTPostAPIApplicationEmojiJSONBody, RESTPatchAPIApplicationEmojiJSONBody, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelThreadsJSONBody, APIThreadChannel, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPostAPIChannelWebhookJSONBody, RESTGetAPIChannelWebhooksResult, RESTPutAPIChannelPermissionJSONBody, RESTPostAPISoundboardSendSoundJSONBody, RESTPostAPIGuildStickerFormDataBody, 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, RESTPatchAPIGuildStickerJSONBody, RESTGetAPIAuditLogQuery, RESTGetAPIAutoModerationRulesResult, RESTPostAPIAutoModerationRuleJSONBody, RESTPatchAPIAutoModerationRuleJSONBody, RESTGetAPIGuildMembersSearchQuery, RESTGetAPIGuildMembersSearchResult, RESTPatchAPIGuildMemberJSONBody, RESTPostAPIGuildTemplatesJSONBody, RESTGetAPIGuildWebhooksResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPutAPIGuildOnboardingJSONBody, RESTGetAPIGuildSoundboardSoundsResult, RESTPostAPIGuildSoundboardSoundJSONBody, RESTPatchAPIGuildSoundboardSoundJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, APIInteractionResponseCallbackData, RESTPostAPIInteractionCallbackQuery, APIInteractionResponseDeferredChannelMessageWithSource, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTPostAPIInteractionCallbackWithResponseResult, RESTGetAPIInviteQuery, RESTGetAPISKUsResult, RESTGetAPISKUSubscriptionsQuery, RESTGetAPISKUSubscriptionsResult, RESTGetAPIEntitlementsQuery, RESTGetAPIEntitlementsResult, RESTPostAPIEntitlementJSONBody, RESTOAuth2AuthorizationQuery, RESTPostOAuth2AccessTokenURLEncodedData, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2RefreshTokenURLEncodedData, RESTPostOAuth2ClientCredentialsURLEncodedData, RESTGetAPIOAuth2CurrentApplicationResult, RESTGetAPIOAuth2CurrentAuthorizationResult, RESTPostOAuth2TokenRevocationQuery, RESTGetAPIPollAnswerVotersQuery, RESTGetAPIPollAnswerVotersResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTGetAPISoundboardDefaultSoundsResult, RESTPostAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceJSONBody, RESTGetStickerPacksResult, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, 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, GatewayGuildStickersUpdateDispatchData, GatewayGuildUpdateDispatchData, GatewayIntegrationCreateDispatchData, GatewayIntegrationDeleteDispatchData, GatewayIntegrationUpdateDispatchData, GatewayInteractionCreateDispatchData, GatewayInviteCreateDispatchData, GatewayInviteDeleteDispatchData, GatewayMessageCreateDispatchData, GatewayMessageDeleteDispatchData, GatewayMessageDeleteBulkDispatchData, GatewayMessagePollVoteDispatchData, GatewayMessageReactionAddDispatchData, GatewayMessageReactionRemoveDispatchData, GatewayMessageReactionRemoveAllDispatchData, GatewayMessageReactionRemoveEmojiDispatchData, GatewayMessageUpdateDispatchData, GatewayPresenceUpdateDispatchData, GatewayReadyDispatchData, GatewayStageInstanceCreateDispatchData, GatewayStageInstanceDeleteDispatchData, GatewayStageInstanceUpdateDispatchData, GatewaySubscriptionCreateDispatchData, GatewaySubscriptionDeleteDispatchData, GatewaySubscriptionUpdateDispatchData, GatewayThreadCreateDispatchData, GatewayThreadDeleteDispatchData, GatewayThreadListSyncDispatchData, GatewayThreadMemberUpdateDispatchData, GatewayThreadMembersUpdateDispatchData, GatewayThreadUpdateDispatchData, GatewayTypingStartDispatchData, GatewayUserUpdateDispatchData, GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData, GatewayWebhooksUpdateDispatchData, GatewayRequestGuildMembersData, 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';
|
|
@@ -229,6 +229,12 @@ interface StartForumThreadOptions extends RESTPostAPIGuildForumThreadsJSONBody {
|
|
|
229
229
|
files?: RawFile[];
|
|
230
230
|
};
|
|
231
231
|
}
|
|
232
|
+
interface CreateMessageOptions extends RESTPostAPIChannelMessageJSONBody {
|
|
233
|
+
files?: RawFile[];
|
|
234
|
+
}
|
|
235
|
+
interface EditMessageOptions extends RESTPatchAPIChannelMessageJSONBody {
|
|
236
|
+
files?: RawFile[];
|
|
237
|
+
}
|
|
232
238
|
declare class ChannelsAPI {
|
|
233
239
|
private readonly rest;
|
|
234
240
|
constructor(rest: REST);
|
|
@@ -240,9 +246,7 @@ declare class ChannelsAPI {
|
|
|
240
246
|
* @param body - The data for sending the message
|
|
241
247
|
* @param options - The options for sending the message
|
|
242
248
|
*/
|
|
243
|
-
createMessage(channelId: Snowflake, { files, ...body }:
|
|
244
|
-
files?: RawFile[];
|
|
245
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
249
|
+
createMessage(channelId: Snowflake, { files, ...body }: CreateMessageOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
246
250
|
/**
|
|
247
251
|
* Edits a message
|
|
248
252
|
*
|
|
@@ -252,9 +256,7 @@ declare class ChannelsAPI {
|
|
|
252
256
|
* @param body - The data for editing the message
|
|
253
257
|
* @param options - The options for editing the message
|
|
254
258
|
*/
|
|
255
|
-
editMessage(channelId: Snowflake, messageId: Snowflake, { files, ...body }:
|
|
256
|
-
files?: RawFile[];
|
|
257
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
259
|
+
editMessage(channelId: Snowflake, messageId: Snowflake, { files, ...body }: EditMessageOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
258
260
|
/**
|
|
259
261
|
* Fetches the reactions for a message
|
|
260
262
|
*
|
|
@@ -572,6 +574,9 @@ declare class ChannelsAPI {
|
|
|
572
574
|
sendSoundboardSound(channelId: Snowflake, body: RESTPostAPISoundboardSendSoundJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APISoundboardSound>;
|
|
573
575
|
}
|
|
574
576
|
|
|
577
|
+
interface CreateStickerOptions extends Omit<RESTPostAPIGuildStickerFormDataBody, 'file'> {
|
|
578
|
+
file: RawFile;
|
|
579
|
+
}
|
|
575
580
|
declare class GuildsAPI {
|
|
576
581
|
private readonly rest;
|
|
577
582
|
constructor(rest: REST);
|
|
@@ -1072,9 +1077,7 @@ declare class GuildsAPI {
|
|
|
1072
1077
|
* @param body - The data for creating the sticker
|
|
1073
1078
|
* @param options - The options for creating the sticker
|
|
1074
1079
|
*/
|
|
1075
|
-
createSticker(guildId: Snowflake, { file, ...body }:
|
|
1076
|
-
file: RawFile;
|
|
1077
|
-
}, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APISticker>;
|
|
1080
|
+
createSticker(guildId: Snowflake, { file, ...body }: CreateStickerOptions, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APISticker>;
|
|
1078
1081
|
/**
|
|
1079
1082
|
* Edits a sticker for a guild
|
|
1080
1083
|
*
|
|
@@ -1303,6 +1306,13 @@ declare class GuildsAPI {
|
|
|
1303
1306
|
deleteSoundboardSound(guildId: Snowflake, soundId: Snowflake, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<void>;
|
|
1304
1307
|
}
|
|
1305
1308
|
|
|
1309
|
+
type CreateWebhookMessageOptions = RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & {
|
|
1310
|
+
files?: RawFile[];
|
|
1311
|
+
};
|
|
1312
|
+
type EditWebhookMessageOptions = RESTPatchAPIWebhookWithTokenMessageJSONBody & {
|
|
1313
|
+
files?: RawFile[];
|
|
1314
|
+
thread_id?: string;
|
|
1315
|
+
};
|
|
1306
1316
|
declare class WebhooksAPI {
|
|
1307
1317
|
private readonly rest;
|
|
1308
1318
|
constructor(rest: REST);
|
|
@@ -1349,8 +1359,7 @@ declare class WebhooksAPI {
|
|
|
1349
1359
|
* @param body - The data for executing the webhook
|
|
1350
1360
|
* @param options - The options for executing the webhook
|
|
1351
1361
|
*/
|
|
1352
|
-
execute(id: Snowflake, token: string, body:
|
|
1353
|
-
files?: RawFile[];
|
|
1362
|
+
execute(id: Snowflake, token: string, body: CreateWebhookMessageOptions & {
|
|
1354
1363
|
wait: true;
|
|
1355
1364
|
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIWebhookWithTokenWaitResult>;
|
|
1356
1365
|
/**
|
|
@@ -1362,8 +1371,7 @@ declare class WebhooksAPI {
|
|
|
1362
1371
|
* @param body - The data for executing the webhook
|
|
1363
1372
|
* @param options - The options for executing the webhook
|
|
1364
1373
|
*/
|
|
1365
|
-
execute(id: Snowflake, token: string, body:
|
|
1366
|
-
files?: RawFile[];
|
|
1374
|
+
execute(id: Snowflake, token: string, body: CreateWebhookMessageOptions & {
|
|
1367
1375
|
wait?: false;
|
|
1368
1376
|
}, options?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1369
1377
|
/**
|
|
@@ -1409,10 +1417,7 @@ declare class WebhooksAPI {
|
|
|
1409
1417
|
* @param body - The data for editing the message
|
|
1410
1418
|
* @param options - The options for editing the message
|
|
1411
1419
|
*/
|
|
1412
|
-
editMessage(id: Snowflake, token: string, messageId: Snowflake, { thread_id, files, ...body }:
|
|
1413
|
-
files?: RawFile[];
|
|
1414
|
-
thread_id?: string;
|
|
1415
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1420
|
+
editMessage(id: Snowflake, token: string, messageId: Snowflake, { thread_id, files, ...body }: EditWebhookMessageOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1416
1421
|
/**
|
|
1417
1422
|
* Deletes an associated message from a webhook
|
|
1418
1423
|
*
|
|
@@ -1428,6 +1433,21 @@ declare class WebhooksAPI {
|
|
|
1428
1433
|
}, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1429
1434
|
}
|
|
1430
1435
|
|
|
1436
|
+
interface CreateInteractionResponseOptions extends APIInteractionResponseCallbackData, RESTPostAPIInteractionCallbackQuery {
|
|
1437
|
+
files?: RawFile[];
|
|
1438
|
+
}
|
|
1439
|
+
type CreateInteractionDeferResponseOptions = APIInteractionResponseDeferredChannelMessageWithSource['data'] & RESTPostAPIInteractionCallbackQuery;
|
|
1440
|
+
type CreateInteractionFollowUpResponseOptions = APIInteractionResponseCallbackData & {
|
|
1441
|
+
files?: RawFile[];
|
|
1442
|
+
};
|
|
1443
|
+
type EditInteractionResponseOptions = APIInteractionResponseCallbackData & {
|
|
1444
|
+
files?: RawFile[];
|
|
1445
|
+
};
|
|
1446
|
+
type CreateInteractionUpdateMessageResponseOptions = APIInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery & {
|
|
1447
|
+
files?: RawFile[];
|
|
1448
|
+
};
|
|
1449
|
+
type CreateAutocompleteResponseOptions = APICommandAutocompleteInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery;
|
|
1450
|
+
type CreateModalResponseOptions = APIModalInteractionResponseCallbackData & RESTPostAPIInteractionCallbackQuery;
|
|
1431
1451
|
declare class InteractionsAPI {
|
|
1432
1452
|
private readonly rest;
|
|
1433
1453
|
private readonly webhooks;
|
|
@@ -1441,8 +1461,7 @@ declare class InteractionsAPI {
|
|
|
1441
1461
|
* @param body - The callback data for replying
|
|
1442
1462
|
* @param options - The options for replying
|
|
1443
1463
|
*/
|
|
1444
|
-
reply(interactionId: Snowflake, interactionToken: string, body:
|
|
1445
|
-
files?: RawFile[];
|
|
1464
|
+
reply(interactionId: Snowflake, interactionToken: string, body: CreateInteractionResponseOptions & {
|
|
1446
1465
|
with_response: true;
|
|
1447
1466
|
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1448
1467
|
/**
|
|
@@ -1454,8 +1473,7 @@ declare class InteractionsAPI {
|
|
|
1454
1473
|
* @param body - The callback data for replying
|
|
1455
1474
|
* @param options - The options for replying
|
|
1456
1475
|
*/
|
|
1457
|
-
reply(interactionId: Snowflake, interactionToken: string, body:
|
|
1458
|
-
files?: RawFile[];
|
|
1476
|
+
reply(interactionId: Snowflake, interactionToken: string, body: CreateInteractionResponseOptions & {
|
|
1459
1477
|
with_response?: false;
|
|
1460
1478
|
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1461
1479
|
/**
|
|
@@ -1467,7 +1485,7 @@ declare class InteractionsAPI {
|
|
|
1467
1485
|
* @param body - The callback data for deferring the reply
|
|
1468
1486
|
* @param options - The options for deferring
|
|
1469
1487
|
*/
|
|
1470
|
-
defer(interactionId: Snowflake, interactionToken: string, body:
|
|
1488
|
+
defer(interactionId: Snowflake, interactionToken: string, body: CreateInteractionDeferResponseOptions & {
|
|
1471
1489
|
with_response: true;
|
|
1472
1490
|
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1473
1491
|
/**
|
|
@@ -1479,7 +1497,7 @@ declare class InteractionsAPI {
|
|
|
1479
1497
|
* @param body - The callback data for deferring the reply
|
|
1480
1498
|
* @param options - The options for deferring
|
|
1481
1499
|
*/
|
|
1482
|
-
defer(interactionId: Snowflake, interactionToken: string, body?:
|
|
1500
|
+
defer(interactionId: Snowflake, interactionToken: string, body?: CreateInteractionDeferResponseOptions & {
|
|
1483
1501
|
with_response?: false;
|
|
1484
1502
|
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1485
1503
|
/**
|
|
@@ -1515,9 +1533,7 @@ declare class InteractionsAPI {
|
|
|
1515
1533
|
* @param body - The callback data for replying
|
|
1516
1534
|
* @param options - The options for replying
|
|
1517
1535
|
*/
|
|
1518
|
-
followUp(applicationId: Snowflake, interactionToken: string, body:
|
|
1519
|
-
files?: RawFile[];
|
|
1520
|
-
}, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1536
|
+
followUp(applicationId: Snowflake, interactionToken: string, body: CreateInteractionFollowUpResponseOptions, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1521
1537
|
/**
|
|
1522
1538
|
* Edits the initial reply to an interaction
|
|
1523
1539
|
*
|
|
@@ -1529,9 +1545,7 @@ declare class InteractionsAPI {
|
|
|
1529
1545
|
* @param messageId - The id of the message to edit. If omitted, the original reply will be edited
|
|
1530
1546
|
* @param options - The options for editing the reply
|
|
1531
1547
|
*/
|
|
1532
|
-
editReply(applicationId: Snowflake, interactionToken: string, callbackData:
|
|
1533
|
-
files?: RawFile[];
|
|
1534
|
-
}, messageId?: Snowflake | '@original', { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1548
|
+
editReply(applicationId: Snowflake, interactionToken: string, callbackData: EditInteractionResponseOptions, messageId?: Snowflake | '@original', { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1535
1549
|
/**
|
|
1536
1550
|
* Fetches the initial reply to an interaction
|
|
1537
1551
|
*
|
|
@@ -1561,8 +1575,7 @@ declare class InteractionsAPI {
|
|
|
1561
1575
|
* @param callbackData - The callback data for updating the interaction
|
|
1562
1576
|
* @param options - The options for updating the interaction
|
|
1563
1577
|
*/
|
|
1564
|
-
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1565
|
-
files?: RawFile[];
|
|
1578
|
+
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData: CreateInteractionUpdateMessageResponseOptions & {
|
|
1566
1579
|
with_response: true;
|
|
1567
1580
|
}, options: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1568
1581
|
/**
|
|
@@ -1574,8 +1587,7 @@ declare class InteractionsAPI {
|
|
|
1574
1587
|
* @param callbackData - The callback data for updating the interaction
|
|
1575
1588
|
* @param options - The options for updating the interaction
|
|
1576
1589
|
*/
|
|
1577
|
-
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1578
|
-
files?: RawFile[];
|
|
1590
|
+
updateMessage(interactionId: Snowflake, interactionToken: string, callbackData: CreateInteractionUpdateMessageResponseOptions & {
|
|
1579
1591
|
with_response?: false;
|
|
1580
1592
|
}, options: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1581
1593
|
/**
|
|
@@ -1587,7 +1599,7 @@ declare class InteractionsAPI {
|
|
|
1587
1599
|
* @param callbackData - The callback data for the autocomplete response
|
|
1588
1600
|
* @param options - The options for sending the autocomplete response
|
|
1589
1601
|
*/
|
|
1590
|
-
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1602
|
+
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData: CreateAutocompleteResponseOptions & {
|
|
1591
1603
|
with_response: true;
|
|
1592
1604
|
}, options?: Pick<RequestData, 'signal'>): Promise<APICommandAutocompleteInteractionResponseCallbackData>;
|
|
1593
1605
|
/**
|
|
@@ -1599,7 +1611,7 @@ declare class InteractionsAPI {
|
|
|
1599
1611
|
* @param callbackData - The callback data for the autocomplete response
|
|
1600
1612
|
* @param options - The options for sending the autocomplete response
|
|
1601
1613
|
*/
|
|
1602
|
-
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1614
|
+
createAutocompleteResponse(interactionId: Snowflake, interactionToken: string, callbackData: CreateAutocompleteResponseOptions & {
|
|
1603
1615
|
with_response?: false;
|
|
1604
1616
|
}, options: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1605
1617
|
/**
|
|
@@ -1611,7 +1623,7 @@ declare class InteractionsAPI {
|
|
|
1611
1623
|
* @param callbackData - The modal callback data to send
|
|
1612
1624
|
* @param options - The options for sending the modal
|
|
1613
1625
|
*/
|
|
1614
|
-
createModal(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1626
|
+
createModal(interactionId: Snowflake, interactionToken: string, callbackData: CreateModalResponseOptions & {
|
|
1615
1627
|
with_response: true;
|
|
1616
1628
|
}, options?: Pick<RequestData, 'signal'>): Promise<RESTPostAPIInteractionCallbackWithResponseResult>;
|
|
1617
1629
|
/**
|
|
@@ -1623,7 +1635,7 @@ declare class InteractionsAPI {
|
|
|
1623
1635
|
* @param callbackData - The modal callback data to send
|
|
1624
1636
|
* @param options - The options for sending the modal
|
|
1625
1637
|
*/
|
|
1626
|
-
createModal(interactionId: Snowflake, interactionToken: string, callbackData:
|
|
1638
|
+
createModal(interactionId: Snowflake, interactionToken: string, callbackData: CreateModalResponseOptions & {
|
|
1627
1639
|
with_response?: false;
|
|
1628
1640
|
}, options?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1629
1641
|
/**
|
|
@@ -2354,4 +2366,4 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
2354
2366
|
*/
|
|
2355
2367
|
declare const version: string;
|
|
2356
2368
|
|
|
2357
|
-
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, Client, type ClientOptions, type DescriptiveRawFile, type Gateway, 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 };
|
|
2369
|
+
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, 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 };
|