@discordjs/core 2.4.0 → 2.6.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/README.md +9 -8
- package/dist/http-only.d.mts +42 -16
- package/dist/http-only.d.ts +42 -16
- package/dist/http-only.js +62 -3
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +65 -4
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +42 -16
- package/dist/index.d.ts +42 -16
- package/dist/index.js +62 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -12
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,
|
|
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, 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, RESTGetAPIGuildRoleMemberCountsResult, 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';
|
|
@@ -223,6 +223,15 @@ declare class ApplicationsAPI {
|
|
|
223
223
|
* @param options - The options for deleting the emoji
|
|
224
224
|
*/
|
|
225
225
|
deleteEmoji(applicationId: Snowflake, emojiId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
226
|
+
/**
|
|
227
|
+
* Fetches an activity instance of an application
|
|
228
|
+
*
|
|
229
|
+
* @see {@link https://docs.discord.com/developers/resources/application#get-application-activity-instance}
|
|
230
|
+
* @param applicationId - The id of the application to fetch the activity instance of
|
|
231
|
+
* @param instanceId - The id of the activity instance to fetch
|
|
232
|
+
* @param options - The options for fetching the activity instance
|
|
233
|
+
*/
|
|
234
|
+
getActivityInstance(applicationId: Snowflake, instanceId: string, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIActivityInstance>;
|
|
226
235
|
}
|
|
227
236
|
|
|
228
237
|
interface StartForumThreadOptions extends RESTPostAPIGuildForumThreadsJSONBody {
|
|
@@ -468,7 +477,7 @@ declare class ChannelsAPI {
|
|
|
468
477
|
* @param body - The data for starting the thread
|
|
469
478
|
* @param options - The options for starting the thread
|
|
470
479
|
*/
|
|
471
|
-
createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<
|
|
480
|
+
createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<RESTPostAPIChannelThreadsResult>;
|
|
472
481
|
/**
|
|
473
482
|
* Fetches the archived threads of a channel
|
|
474
483
|
*
|
|
@@ -532,7 +541,7 @@ declare class ChannelsAPI {
|
|
|
532
541
|
* @param body - The data for sending the soundboard sound
|
|
533
542
|
* @param options - The options for sending the soundboard sound
|
|
534
543
|
*/
|
|
535
|
-
sendSoundboardSound(channelId: Snowflake, body: RESTPostAPISoundboardSendSoundJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<
|
|
544
|
+
sendSoundboardSound(channelId: Snowflake, body: RESTPostAPISoundboardSendSoundJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
536
545
|
/**
|
|
537
546
|
* Adds a recipient to a group DM channel
|
|
538
547
|
*
|
|
@@ -915,7 +924,7 @@ declare class GuildsAPI {
|
|
|
915
924
|
* @param options - The options for editing the voice state
|
|
916
925
|
* @deprecated Use {@link VoiceAPI.editUserVoiceState} instead
|
|
917
926
|
*/
|
|
918
|
-
editUserVoiceState(guildId: Snowflake, userId: Snowflake, body: RESTPatchAPIGuildVoiceStateUserJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<
|
|
927
|
+
editUserVoiceState(guildId: Snowflake, userId: Snowflake, body: RESTPatchAPIGuildVoiceStateUserJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<undefined>;
|
|
919
928
|
/**
|
|
920
929
|
* Fetches all emojis for a guild
|
|
921
930
|
*
|
|
@@ -1171,6 +1180,15 @@ declare class GuildsAPI {
|
|
|
1171
1180
|
* @param options - The options for searching for guild members
|
|
1172
1181
|
*/
|
|
1173
1182
|
searchForMembers(guildId: Snowflake, query: RESTGetAPIGuildMembersSearchQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildMembersSearchResult>;
|
|
1183
|
+
/**
|
|
1184
|
+
* Searches for messages.
|
|
1185
|
+
*
|
|
1186
|
+
* @see {@link https://docs.discord.com/developers/resources/message#search-guild-messages}
|
|
1187
|
+
* @param guildId - The id of the guild to search in
|
|
1188
|
+
* @param query - The query to search for
|
|
1189
|
+
* @param options - The options for searching for messages
|
|
1190
|
+
*/
|
|
1191
|
+
searchForMessages(guildId: Snowflake, query: RESTGetAPIGuildMessagesSearchQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildMessagesSearchResult>;
|
|
1174
1192
|
/**
|
|
1175
1193
|
* Edits a guild member
|
|
1176
1194
|
*
|
|
@@ -1243,7 +1261,7 @@ declare class GuildsAPI {
|
|
|
1243
1261
|
* @param options - The options for setting the voice state
|
|
1244
1262
|
* @deprecated Use {@link VoiceAPI.editVoiceState} instead
|
|
1245
1263
|
*/
|
|
1246
|
-
setVoiceState(guildId: Snowflake, body?: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<
|
|
1264
|
+
setVoiceState(guildId: Snowflake, body?: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1247
1265
|
/**
|
|
1248
1266
|
* Fetches a guild onboarding
|
|
1249
1267
|
*
|
|
@@ -1315,6 +1333,14 @@ declare class GuildsAPI {
|
|
|
1315
1333
|
* @param options - The options for modifying guild incident actions
|
|
1316
1334
|
*/
|
|
1317
1335
|
editIncidentActions(guildId: Snowflake, body: RESTPutAPIGuildIncidentActionsJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIIncidentsData>;
|
|
1336
|
+
/**
|
|
1337
|
+
* Fetches role member counts for a guild.
|
|
1338
|
+
*
|
|
1339
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role-member-counts}
|
|
1340
|
+
* @param guildId - The id of the guild to fetch role member counts for
|
|
1341
|
+
* @param options - The options for fetching role member counts
|
|
1342
|
+
*/
|
|
1343
|
+
getRoleMemberCounts(guildId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildRoleMemberCountsResult>;
|
|
1318
1344
|
}
|
|
1319
1345
|
|
|
1320
1346
|
type CreateWebhookMessageOptions = RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & {
|
|
@@ -1774,7 +1800,7 @@ declare class InvitesAPI {
|
|
|
1774
1800
|
* @param code - The invite code
|
|
1775
1801
|
* @param options - The options for deleting the invite
|
|
1776
1802
|
*/
|
|
1777
|
-
delete(code: string, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<
|
|
1803
|
+
delete(code: string, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIInvite>;
|
|
1778
1804
|
}
|
|
1779
1805
|
|
|
1780
1806
|
declare class MonetizationAPI {
|
|
@@ -1895,7 +1921,7 @@ declare class OAuth2API {
|
|
|
1895
1921
|
* @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information}
|
|
1896
1922
|
* @param options - The options for the current bot application information request
|
|
1897
1923
|
*/
|
|
1898
|
-
getCurrentBotApplicationInformation({ signal }?: Pick<RequestData, 'signal'>): Promise<
|
|
1924
|
+
getCurrentBotApplicationInformation({ signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplication>;
|
|
1899
1925
|
/**
|
|
1900
1926
|
* Fetches the current authorization information
|
|
1901
1927
|
*
|
|
@@ -2230,7 +2256,7 @@ declare class VoiceAPI {
|
|
|
2230
2256
|
* @param body - The data for editing the voice state
|
|
2231
2257
|
* @param options - The options for editing the voice state
|
|
2232
2258
|
*/
|
|
2233
|
-
editUserVoiceState(guildId: Snowflake, userId: Snowflake, body: RESTPatchAPIGuildVoiceStateUserJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<
|
|
2259
|
+
editUserVoiceState(guildId: Snowflake, userId: Snowflake, body: RESTPatchAPIGuildVoiceStateUserJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<undefined>;
|
|
2234
2260
|
/**
|
|
2235
2261
|
* Edits the voice state for the current user
|
|
2236
2262
|
*
|
|
@@ -2239,7 +2265,7 @@ declare class VoiceAPI {
|
|
|
2239
2265
|
* @param body - The data for editing the voice state
|
|
2240
2266
|
* @param options - The options for editing the voice state
|
|
2241
2267
|
*/
|
|
2242
|
-
editVoiceState(guildId: Snowflake, body?: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<
|
|
2268
|
+
editVoiceState(guildId: Snowflake, body?: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
2243
2269
|
}
|
|
2244
2270
|
|
|
2245
2271
|
declare class API {
|
|
@@ -2497,18 +2523,18 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
2497
2523
|
description: string | undefined;
|
|
2498
2524
|
}[];
|
|
2499
2525
|
flags?: discord_api_types_v10.MessageFlags | undefined;
|
|
2500
|
-
content?: string | undefined;
|
|
2501
|
-
tts?: boolean | undefined;
|
|
2502
|
-
embeds?: discord_api_types_v10.APIEmbed[] | undefined;
|
|
2526
|
+
content?: string | undefined | undefined;
|
|
2527
|
+
tts?: boolean | undefined | undefined;
|
|
2528
|
+
embeds?: discord_api_types_v10.APIEmbed[] | undefined | undefined;
|
|
2503
2529
|
allowed_mentions?: discord_api_types_v10.APIAllowedMentions | undefined;
|
|
2504
|
-
components?: discord_api_types_v10.APIMessageTopLevelComponent[] | undefined;
|
|
2530
|
+
components?: discord_api_types_v10.APIMessageTopLevelComponent[] | undefined | undefined;
|
|
2505
2531
|
poll?: discord_api_types_v10.RESTAPIPoll | undefined;
|
|
2506
|
-
applied_tags?: discord_api_types_globals.Snowflake[] | undefined;
|
|
2507
|
-
thread_name?: string | undefined;
|
|
2532
|
+
applied_tags?: discord_api_types_globals.Snowflake[] | undefined | undefined;
|
|
2533
|
+
thread_name?: string | undefined | undefined;
|
|
2508
2534
|
};
|
|
2509
2535
|
files: {
|
|
2510
2536
|
name: string;
|
|
2511
|
-
data: string | number | boolean | Uint8Array | Buffer
|
|
2537
|
+
data: string | number | boolean | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>;
|
|
2512
2538
|
}[];
|
|
2513
2539
|
};
|
|
2514
2540
|
|
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,
|
|
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, 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, RESTGetAPIGuildRoleMemberCountsResult, 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';
|
|
@@ -223,6 +223,15 @@ declare class ApplicationsAPI {
|
|
|
223
223
|
* @param options - The options for deleting the emoji
|
|
224
224
|
*/
|
|
225
225
|
deleteEmoji(applicationId: Snowflake, emojiId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
226
|
+
/**
|
|
227
|
+
* Fetches an activity instance of an application
|
|
228
|
+
*
|
|
229
|
+
* @see {@link https://docs.discord.com/developers/resources/application#get-application-activity-instance}
|
|
230
|
+
* @param applicationId - The id of the application to fetch the activity instance of
|
|
231
|
+
* @param instanceId - The id of the activity instance to fetch
|
|
232
|
+
* @param options - The options for fetching the activity instance
|
|
233
|
+
*/
|
|
234
|
+
getActivityInstance(applicationId: Snowflake, instanceId: string, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIActivityInstance>;
|
|
226
235
|
}
|
|
227
236
|
|
|
228
237
|
interface StartForumThreadOptions extends RESTPostAPIGuildForumThreadsJSONBody {
|
|
@@ -468,7 +477,7 @@ declare class ChannelsAPI {
|
|
|
468
477
|
* @param body - The data for starting the thread
|
|
469
478
|
* @param options - The options for starting the thread
|
|
470
479
|
*/
|
|
471
|
-
createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<
|
|
480
|
+
createForumThread(channelId: Snowflake, { message, ...optionsBody }: StartForumThreadOptions, { signal, reason }?: Pick<RequestData, 'reason' | 'signal'>): Promise<RESTPostAPIChannelThreadsResult>;
|
|
472
481
|
/**
|
|
473
482
|
* Fetches the archived threads of a channel
|
|
474
483
|
*
|
|
@@ -532,7 +541,7 @@ declare class ChannelsAPI {
|
|
|
532
541
|
* @param body - The data for sending the soundboard sound
|
|
533
542
|
* @param options - The options for sending the soundboard sound
|
|
534
543
|
*/
|
|
535
|
-
sendSoundboardSound(channelId: Snowflake, body: RESTPostAPISoundboardSendSoundJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<
|
|
544
|
+
sendSoundboardSound(channelId: Snowflake, body: RESTPostAPISoundboardSendSoundJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
536
545
|
/**
|
|
537
546
|
* Adds a recipient to a group DM channel
|
|
538
547
|
*
|
|
@@ -915,7 +924,7 @@ declare class GuildsAPI {
|
|
|
915
924
|
* @param options - The options for editing the voice state
|
|
916
925
|
* @deprecated Use {@link VoiceAPI.editUserVoiceState} instead
|
|
917
926
|
*/
|
|
918
|
-
editUserVoiceState(guildId: Snowflake, userId: Snowflake, body: RESTPatchAPIGuildVoiceStateUserJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<
|
|
927
|
+
editUserVoiceState(guildId: Snowflake, userId: Snowflake, body: RESTPatchAPIGuildVoiceStateUserJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<undefined>;
|
|
919
928
|
/**
|
|
920
929
|
* Fetches all emojis for a guild
|
|
921
930
|
*
|
|
@@ -1171,6 +1180,15 @@ declare class GuildsAPI {
|
|
|
1171
1180
|
* @param options - The options for searching for guild members
|
|
1172
1181
|
*/
|
|
1173
1182
|
searchForMembers(guildId: Snowflake, query: RESTGetAPIGuildMembersSearchQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildMembersSearchResult>;
|
|
1183
|
+
/**
|
|
1184
|
+
* Searches for messages.
|
|
1185
|
+
*
|
|
1186
|
+
* @see {@link https://docs.discord.com/developers/resources/message#search-guild-messages}
|
|
1187
|
+
* @param guildId - The id of the guild to search in
|
|
1188
|
+
* @param query - The query to search for
|
|
1189
|
+
* @param options - The options for searching for messages
|
|
1190
|
+
*/
|
|
1191
|
+
searchForMessages(guildId: Snowflake, query: RESTGetAPIGuildMessagesSearchQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildMessagesSearchResult>;
|
|
1174
1192
|
/**
|
|
1175
1193
|
* Edits a guild member
|
|
1176
1194
|
*
|
|
@@ -1243,7 +1261,7 @@ declare class GuildsAPI {
|
|
|
1243
1261
|
* @param options - The options for setting the voice state
|
|
1244
1262
|
* @deprecated Use {@link VoiceAPI.editVoiceState} instead
|
|
1245
1263
|
*/
|
|
1246
|
-
setVoiceState(guildId: Snowflake, body?: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<
|
|
1264
|
+
setVoiceState(guildId: Snowflake, body?: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1247
1265
|
/**
|
|
1248
1266
|
* Fetches a guild onboarding
|
|
1249
1267
|
*
|
|
@@ -1315,6 +1333,14 @@ declare class GuildsAPI {
|
|
|
1315
1333
|
* @param options - The options for modifying guild incident actions
|
|
1316
1334
|
*/
|
|
1317
1335
|
editIncidentActions(guildId: Snowflake, body: RESTPutAPIGuildIncidentActionsJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIIncidentsData>;
|
|
1336
|
+
/**
|
|
1337
|
+
* Fetches role member counts for a guild.
|
|
1338
|
+
*
|
|
1339
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role-member-counts}
|
|
1340
|
+
* @param guildId - The id of the guild to fetch role member counts for
|
|
1341
|
+
* @param options - The options for fetching role member counts
|
|
1342
|
+
*/
|
|
1343
|
+
getRoleMemberCounts(guildId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIGuildRoleMemberCountsResult>;
|
|
1318
1344
|
}
|
|
1319
1345
|
|
|
1320
1346
|
type CreateWebhookMessageOptions = RESTPostAPIWebhookWithTokenJSONBody & RESTPostAPIWebhookWithTokenQuery & {
|
|
@@ -1774,7 +1800,7 @@ declare class InvitesAPI {
|
|
|
1774
1800
|
* @param code - The invite code
|
|
1775
1801
|
* @param options - The options for deleting the invite
|
|
1776
1802
|
*/
|
|
1777
|
-
delete(code: string, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<
|
|
1803
|
+
delete(code: string, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIInvite>;
|
|
1778
1804
|
}
|
|
1779
1805
|
|
|
1780
1806
|
declare class MonetizationAPI {
|
|
@@ -1895,7 +1921,7 @@ declare class OAuth2API {
|
|
|
1895
1921
|
* @see {@link https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information}
|
|
1896
1922
|
* @param options - The options for the current bot application information request
|
|
1897
1923
|
*/
|
|
1898
|
-
getCurrentBotApplicationInformation({ signal }?: Pick<RequestData, 'signal'>): Promise<
|
|
1924
|
+
getCurrentBotApplicationInformation({ signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIApplication>;
|
|
1899
1925
|
/**
|
|
1900
1926
|
* Fetches the current authorization information
|
|
1901
1927
|
*
|
|
@@ -2230,7 +2256,7 @@ declare class VoiceAPI {
|
|
|
2230
2256
|
* @param body - The data for editing the voice state
|
|
2231
2257
|
* @param options - The options for editing the voice state
|
|
2232
2258
|
*/
|
|
2233
|
-
editUserVoiceState(guildId: Snowflake, userId: Snowflake, body: RESTPatchAPIGuildVoiceStateUserJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<
|
|
2259
|
+
editUserVoiceState(guildId: Snowflake, userId: Snowflake, body: RESTPatchAPIGuildVoiceStateUserJSONBody, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<undefined>;
|
|
2234
2260
|
/**
|
|
2235
2261
|
* Edits the voice state for the current user
|
|
2236
2262
|
*
|
|
@@ -2239,7 +2265,7 @@ declare class VoiceAPI {
|
|
|
2239
2265
|
* @param body - The data for editing the voice state
|
|
2240
2266
|
* @param options - The options for editing the voice state
|
|
2241
2267
|
*/
|
|
2242
|
-
editVoiceState(guildId: Snowflake, body?: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<
|
|
2268
|
+
editVoiceState(guildId: Snowflake, body?: RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, { signal }?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
2243
2269
|
}
|
|
2244
2270
|
|
|
2245
2271
|
declare class API {
|
|
@@ -2497,18 +2523,18 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
2497
2523
|
description: string | undefined;
|
|
2498
2524
|
}[];
|
|
2499
2525
|
flags?: discord_api_types_v10.MessageFlags | undefined;
|
|
2500
|
-
content?: string | undefined;
|
|
2501
|
-
tts?: boolean | undefined;
|
|
2502
|
-
embeds?: discord_api_types_v10.APIEmbed[] | undefined;
|
|
2526
|
+
content?: string | undefined | undefined;
|
|
2527
|
+
tts?: boolean | undefined | undefined;
|
|
2528
|
+
embeds?: discord_api_types_v10.APIEmbed[] | undefined | undefined;
|
|
2503
2529
|
allowed_mentions?: discord_api_types_v10.APIAllowedMentions | undefined;
|
|
2504
|
-
components?: discord_api_types_v10.APIMessageTopLevelComponent[] | undefined;
|
|
2530
|
+
components?: discord_api_types_v10.APIMessageTopLevelComponent[] | undefined | undefined;
|
|
2505
2531
|
poll?: discord_api_types_v10.RESTAPIPoll | undefined;
|
|
2506
|
-
applied_tags?: discord_api_types_globals.Snowflake[] | undefined;
|
|
2507
|
-
thread_name?: string | undefined;
|
|
2532
|
+
applied_tags?: discord_api_types_globals.Snowflake[] | undefined | undefined;
|
|
2533
|
+
thread_name?: string | undefined | undefined;
|
|
2508
2534
|
};
|
|
2509
2535
|
files: {
|
|
2510
2536
|
name: string;
|
|
2511
|
-
data: string | number | boolean | Uint8Array | Buffer
|
|
2537
|
+
data: string | number | boolean | Uint8Array<ArrayBufferLike> | Buffer<ArrayBufferLike>;
|
|
2512
2538
|
}[];
|
|
2513
2539
|
};
|
|
2514
2540
|
|
package/dist/index.js
CHANGED
|
@@ -55,6 +55,7 @@ var ApplicationCommandsAPI = class {
|
|
|
55
55
|
constructor(rest) {
|
|
56
56
|
this.rest = rest;
|
|
57
57
|
}
|
|
58
|
+
rest;
|
|
58
59
|
static {
|
|
59
60
|
__name(this, "ApplicationCommandsAPI");
|
|
60
61
|
}
|
|
@@ -280,6 +281,7 @@ var ApplicationsAPI = class {
|
|
|
280
281
|
constructor(rest) {
|
|
281
282
|
this.rest = rest;
|
|
282
283
|
}
|
|
284
|
+
rest;
|
|
283
285
|
static {
|
|
284
286
|
__name(this, "ApplicationsAPI");
|
|
285
287
|
}
|
|
@@ -370,6 +372,19 @@ var ApplicationsAPI = class {
|
|
|
370
372
|
async deleteEmoji(applicationId, emojiId, { signal } = {}) {
|
|
371
373
|
await this.rest.delete(import_v102.Routes.applicationEmoji(applicationId, emojiId), { signal });
|
|
372
374
|
}
|
|
375
|
+
/**
|
|
376
|
+
* Fetches an activity instance of an application
|
|
377
|
+
*
|
|
378
|
+
* @see {@link https://docs.discord.com/developers/resources/application#get-application-activity-instance}
|
|
379
|
+
* @param applicationId - The id of the application to fetch the activity instance of
|
|
380
|
+
* @param instanceId - The id of the activity instance to fetch
|
|
381
|
+
* @param options - The options for fetching the activity instance
|
|
382
|
+
*/
|
|
383
|
+
async getActivityInstance(applicationId, instanceId, { signal } = {}) {
|
|
384
|
+
return this.rest.get(import_v102.Routes.applicationActivityInstance(applicationId, instanceId), {
|
|
385
|
+
signal
|
|
386
|
+
});
|
|
387
|
+
}
|
|
373
388
|
};
|
|
374
389
|
|
|
375
390
|
// src/api/channel.ts
|
|
@@ -379,6 +394,7 @@ var ChannelsAPI = class {
|
|
|
379
394
|
constructor(rest) {
|
|
380
395
|
this.rest = rest;
|
|
381
396
|
}
|
|
397
|
+
rest;
|
|
382
398
|
static {
|
|
383
399
|
__name(this, "ChannelsAPI");
|
|
384
400
|
}
|
|
@@ -803,7 +819,7 @@ var ChannelsAPI = class {
|
|
|
803
819
|
* @param options - The options for sending the soundboard sound
|
|
804
820
|
*/
|
|
805
821
|
async sendSoundboardSound(channelId, body, { signal } = {}) {
|
|
806
|
-
|
|
822
|
+
await this.rest.post(import_v103.Routes.sendSoundboardSound(channelId), {
|
|
807
823
|
body,
|
|
808
824
|
signal
|
|
809
825
|
});
|
|
@@ -844,6 +860,7 @@ var GatewayAPI = class {
|
|
|
844
860
|
constructor(rest) {
|
|
845
861
|
this.rest = rest;
|
|
846
862
|
}
|
|
863
|
+
rest;
|
|
847
864
|
static {
|
|
848
865
|
__name(this, "GatewayAPI");
|
|
849
866
|
}
|
|
@@ -880,6 +897,7 @@ var VoiceAPI = class {
|
|
|
880
897
|
constructor(rest) {
|
|
881
898
|
this.rest = rest;
|
|
882
899
|
}
|
|
900
|
+
rest;
|
|
883
901
|
static {
|
|
884
902
|
__name(this, "VoiceAPI");
|
|
885
903
|
}
|
|
@@ -951,6 +969,7 @@ var GuildsAPI = class {
|
|
|
951
969
|
constructor(rest) {
|
|
952
970
|
this.rest = rest;
|
|
953
971
|
}
|
|
972
|
+
rest;
|
|
954
973
|
static {
|
|
955
974
|
__name(this, "GuildsAPI");
|
|
956
975
|
}
|
|
@@ -1781,6 +1800,20 @@ var GuildsAPI = class {
|
|
|
1781
1800
|
signal
|
|
1782
1801
|
});
|
|
1783
1802
|
}
|
|
1803
|
+
/**
|
|
1804
|
+
* Searches for messages.
|
|
1805
|
+
*
|
|
1806
|
+
* @see {@link https://docs.discord.com/developers/resources/message#search-guild-messages}
|
|
1807
|
+
* @param guildId - The id of the guild to search in
|
|
1808
|
+
* @param query - The query to search for
|
|
1809
|
+
* @param options - The options for searching for messages
|
|
1810
|
+
*/
|
|
1811
|
+
async searchForMessages(guildId, query, { signal } = {}) {
|
|
1812
|
+
return this.rest.get(import_v106.Routes.guildMessagesSearch(guildId), {
|
|
1813
|
+
query: (0, import_rest3.makeURLSearchParams)(query),
|
|
1814
|
+
signal
|
|
1815
|
+
});
|
|
1816
|
+
}
|
|
1784
1817
|
/**
|
|
1785
1818
|
* Edits a guild member
|
|
1786
1819
|
*
|
|
@@ -1980,6 +2013,18 @@ var GuildsAPI = class {
|
|
|
1980
2013
|
signal
|
|
1981
2014
|
});
|
|
1982
2015
|
}
|
|
2016
|
+
/**
|
|
2017
|
+
* Fetches role member counts for a guild.
|
|
2018
|
+
*
|
|
2019
|
+
* @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role-member-counts}
|
|
2020
|
+
* @param guildId - The id of the guild to fetch role member counts for
|
|
2021
|
+
* @param options - The options for fetching role member counts
|
|
2022
|
+
*/
|
|
2023
|
+
async getRoleMemberCounts(guildId, { signal } = {}) {
|
|
2024
|
+
return this.rest.get(import_v106.Routes.guildRoleMemberCounts(guildId), {
|
|
2025
|
+
signal
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
1983
2028
|
};
|
|
1984
2029
|
|
|
1985
2030
|
// src/api/interactions.ts
|
|
@@ -1990,6 +2035,8 @@ var InteractionsAPI = class {
|
|
|
1990
2035
|
this.rest = rest;
|
|
1991
2036
|
this.webhooks = webhooks;
|
|
1992
2037
|
}
|
|
2038
|
+
rest;
|
|
2039
|
+
webhooks;
|
|
1993
2040
|
static {
|
|
1994
2041
|
__name(this, "InteractionsAPI");
|
|
1995
2042
|
}
|
|
@@ -2162,6 +2209,7 @@ var InvitesAPI = class {
|
|
|
2162
2209
|
constructor(rest) {
|
|
2163
2210
|
this.rest = rest;
|
|
2164
2211
|
}
|
|
2212
|
+
rest;
|
|
2165
2213
|
static {
|
|
2166
2214
|
__name(this, "InvitesAPI");
|
|
2167
2215
|
}
|
|
@@ -2187,7 +2235,7 @@ var InvitesAPI = class {
|
|
|
2187
2235
|
* @param options - The options for deleting the invite
|
|
2188
2236
|
*/
|
|
2189
2237
|
async delete(code, { reason, signal } = {}) {
|
|
2190
|
-
|
|
2238
|
+
return this.rest.delete(import_v108.Routes.invite(code), { reason, signal });
|
|
2191
2239
|
}
|
|
2192
2240
|
};
|
|
2193
2241
|
|
|
@@ -2198,6 +2246,7 @@ var MonetizationAPI = class {
|
|
|
2198
2246
|
constructor(rest) {
|
|
2199
2247
|
this.rest = rest;
|
|
2200
2248
|
}
|
|
2249
|
+
rest;
|
|
2201
2250
|
static {
|
|
2202
2251
|
__name(this, "MonetizationAPI");
|
|
2203
2252
|
}
|
|
@@ -2310,6 +2359,7 @@ var OAuth2API = class {
|
|
|
2310
2359
|
constructor(rest) {
|
|
2311
2360
|
this.rest = rest;
|
|
2312
2361
|
}
|
|
2362
|
+
rest;
|
|
2313
2363
|
static {
|
|
2314
2364
|
__name(this, "OAuth2API");
|
|
2315
2365
|
}
|
|
@@ -2432,6 +2482,7 @@ var PollAPI = class {
|
|
|
2432
2482
|
constructor(rest) {
|
|
2433
2483
|
this.rest = rest;
|
|
2434
2484
|
}
|
|
2485
|
+
rest;
|
|
2435
2486
|
static {
|
|
2436
2487
|
__name(this, "PollAPI");
|
|
2437
2488
|
}
|
|
@@ -2472,6 +2523,7 @@ var RoleConnectionsAPI = class {
|
|
|
2472
2523
|
constructor(rest) {
|
|
2473
2524
|
this.rest = rest;
|
|
2474
2525
|
}
|
|
2526
|
+
rest;
|
|
2475
2527
|
static {
|
|
2476
2528
|
__name(this, "RoleConnectionsAPI");
|
|
2477
2529
|
}
|
|
@@ -2509,6 +2561,7 @@ var SoundboardSoundsAPI = class {
|
|
|
2509
2561
|
constructor(rest) {
|
|
2510
2562
|
this.rest = rest;
|
|
2511
2563
|
}
|
|
2564
|
+
rest;
|
|
2512
2565
|
static {
|
|
2513
2566
|
__name(this, "SoundboardSoundsAPI");
|
|
2514
2567
|
}
|
|
@@ -2531,6 +2584,7 @@ var StageInstancesAPI = class {
|
|
|
2531
2584
|
constructor(rest) {
|
|
2532
2585
|
this.rest = rest;
|
|
2533
2586
|
}
|
|
2587
|
+
rest;
|
|
2534
2588
|
static {
|
|
2535
2589
|
__name(this, "StageInstancesAPI");
|
|
2536
2590
|
}
|
|
@@ -2591,6 +2645,7 @@ var StickersAPI = class {
|
|
|
2591
2645
|
constructor(rest) {
|
|
2592
2646
|
this.rest = rest;
|
|
2593
2647
|
}
|
|
2648
|
+
rest;
|
|
2594
2649
|
static {
|
|
2595
2650
|
__name(this, "StickersAPI");
|
|
2596
2651
|
}
|
|
@@ -2641,6 +2696,7 @@ var ThreadsAPI = class {
|
|
|
2641
2696
|
constructor(rest) {
|
|
2642
2697
|
this.rest = rest;
|
|
2643
2698
|
}
|
|
2699
|
+
rest;
|
|
2644
2700
|
static {
|
|
2645
2701
|
__name(this, "ThreadsAPI");
|
|
2646
2702
|
}
|
|
@@ -2716,6 +2772,7 @@ var UsersAPI = class {
|
|
|
2716
2772
|
constructor(rest) {
|
|
2717
2773
|
this.rest = rest;
|
|
2718
2774
|
}
|
|
2775
|
+
rest;
|
|
2719
2776
|
static {
|
|
2720
2777
|
__name(this, "UsersAPI");
|
|
2721
2778
|
}
|
|
@@ -2853,6 +2910,7 @@ var WebhooksAPI = class {
|
|
|
2853
2910
|
constructor(rest) {
|
|
2854
2911
|
this.rest = rest;
|
|
2855
2912
|
}
|
|
2913
|
+
rest;
|
|
2856
2914
|
static {
|
|
2857
2915
|
__name(this, "WebhooksAPI");
|
|
2858
2916
|
}
|
|
@@ -3035,6 +3093,7 @@ var API = class {
|
|
|
3035
3093
|
this.webhooks = new WebhooksAPI(rest);
|
|
3036
3094
|
this.interactions = new InteractionsAPI(rest, this.webhooks);
|
|
3037
3095
|
}
|
|
3096
|
+
rest;
|
|
3038
3097
|
static {
|
|
3039
3098
|
__name(this, "API");
|
|
3040
3099
|
}
|
|
@@ -3315,7 +3374,7 @@ __name(withFiles, "withFiles");
|
|
|
3315
3374
|
// src/index.ts
|
|
3316
3375
|
__reExport(index_exports, require("discord-api-types/v10"), module.exports);
|
|
3317
3376
|
var import_util2 = require("@discordjs/util");
|
|
3318
|
-
var version = "2.
|
|
3377
|
+
var version = "2.6.0";
|
|
3319
3378
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3320
3379
|
0 && (module.exports = {
|
|
3321
3380
|
API,
|