@discordjs/core 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/http-only.d.mts +46 -7
- package/dist/http-only.d.ts +46 -7
- package/dist/http-only.js +49 -6
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +49 -6
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +46 -7
- package/dist/index.d.ts +46 -7
- package/dist/index.js +49 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/http-only.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, 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 } from 'discord-api-types/v10';
|
|
3
|
+
import { Snowflake, RESTGetAPIApplicationCommandsQuery, Locale, 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, RESTGetAPIInviteTargetUsersJobStatusResult, 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 } from 'discord-api-types/v10';
|
|
4
4
|
export * from 'discord-api-types/v10';
|
|
5
5
|
import * as discord_api_types_globals from 'discord-api-types/globals';
|
|
6
6
|
|
|
@@ -15,7 +15,9 @@ declare class ApplicationCommandsAPI {
|
|
|
15
15
|
* @param query - The query options for fetching commands
|
|
16
16
|
* @param options - The options for fetching commands
|
|
17
17
|
*/
|
|
18
|
-
getGlobalCommands(applicationId: Snowflake, query?: RESTGetAPIApplicationCommandsQuery, { signal }?: Pick<RequestData, 'signal'>
|
|
18
|
+
getGlobalCommands(applicationId: Snowflake, query?: RESTGetAPIApplicationCommandsQuery, { locale, signal }?: Pick<RequestData, 'signal'> & {
|
|
19
|
+
locale?: Locale;
|
|
20
|
+
}): Promise<RESTGetAPIApplicationCommandsResult>;
|
|
19
21
|
/**
|
|
20
22
|
* Creates a new global command
|
|
21
23
|
*
|
|
@@ -71,7 +73,9 @@ declare class ApplicationCommandsAPI {
|
|
|
71
73
|
* @param query - The data for fetching commands
|
|
72
74
|
* @param options - The options for fetching commands
|
|
73
75
|
*/
|
|
74
|
-
getGuildCommands(applicationId: Snowflake, guildId: Snowflake, query?: RESTGetAPIApplicationGuildCommandsQuery, { signal }?: Pick<RequestData, 'signal'>
|
|
76
|
+
getGuildCommands(applicationId: Snowflake, guildId: Snowflake, query?: RESTGetAPIApplicationGuildCommandsQuery, { locale, signal }?: Pick<RequestData, 'signal'> & {
|
|
77
|
+
locale?: Locale;
|
|
78
|
+
}): Promise<RESTGetAPIApplicationGuildCommandsResult>;
|
|
75
79
|
/**
|
|
76
80
|
* Creates a new command for a guild
|
|
77
81
|
*
|
|
@@ -241,6 +245,12 @@ interface CreateMessageOptions extends RESTPostAPIChannelMessageJSONBody {
|
|
|
241
245
|
interface EditMessageOptions extends RESTPatchAPIChannelMessageJSONBody {
|
|
242
246
|
files?: RawFile[];
|
|
243
247
|
}
|
|
248
|
+
interface CreateInviteOptions extends RESTPostAPIChannelInviteJSONBody {
|
|
249
|
+
/**
|
|
250
|
+
* A CSV file with a single column of user ids for all the users able to accept this invite
|
|
251
|
+
*/
|
|
252
|
+
targetUsersFile?: RawFile;
|
|
253
|
+
}
|
|
244
254
|
declare class ChannelsAPI {
|
|
245
255
|
private readonly rest;
|
|
246
256
|
constructor(rest: REST);
|
|
@@ -445,7 +455,7 @@ declare class ChannelsAPI {
|
|
|
445
455
|
* @param body - The data for creating the invite
|
|
446
456
|
* @param options - The options for creating the invite
|
|
447
457
|
*/
|
|
448
|
-
createInvite(channelId: Snowflake, body:
|
|
458
|
+
createInvite(channelId: Snowflake, { targetUsersFile, ...body }: CreateInviteOptions, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIExtendedInvite>;
|
|
449
459
|
/**
|
|
450
460
|
* Fetches the invites of a channel
|
|
451
461
|
*
|
|
@@ -1783,7 +1793,7 @@ declare class InvitesAPI {
|
|
|
1783
1793
|
/**
|
|
1784
1794
|
* Fetches an invite
|
|
1785
1795
|
*
|
|
1786
|
-
* @see {@link https://discord.com/developers/
|
|
1796
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-invite}
|
|
1787
1797
|
* @param code - The invite code
|
|
1788
1798
|
* @param query - The options for fetching the invite
|
|
1789
1799
|
* @param options - The options for fetching the invite
|
|
@@ -1792,11 +1802,40 @@ declare class InvitesAPI {
|
|
|
1792
1802
|
/**
|
|
1793
1803
|
* Deletes an invite
|
|
1794
1804
|
*
|
|
1795
|
-
* @see {@link https://discord.com/developers/
|
|
1805
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#delete-invite}
|
|
1796
1806
|
* @param code - The invite code
|
|
1797
1807
|
* @param options - The options for deleting the invite
|
|
1798
1808
|
*/
|
|
1799
1809
|
delete(code: string, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIInvite>;
|
|
1810
|
+
/**
|
|
1811
|
+
* Fetches an invite's target users
|
|
1812
|
+
*
|
|
1813
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-target-users}
|
|
1814
|
+
* @param code - The invite code
|
|
1815
|
+
* @param options - The options for fetching the invite target users
|
|
1816
|
+
* @returns
|
|
1817
|
+
*/
|
|
1818
|
+
getTargetUsers(code: string, { signal }?: Pick<RequestData, 'signal'>): Promise<ArrayBuffer>;
|
|
1819
|
+
/**
|
|
1820
|
+
* Updates an invite's target users
|
|
1821
|
+
*
|
|
1822
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#update-target-users}
|
|
1823
|
+
* @param code - The invite code
|
|
1824
|
+
* @param targetUsersFile - A CSV file with a single column of user ids
|
|
1825
|
+
* for all the users able to accept this invite
|
|
1826
|
+
* @param options - The options for updating the invite target users
|
|
1827
|
+
* @returns
|
|
1828
|
+
*/
|
|
1829
|
+
updateTargetUsers(code: string, targetUsersFile: RawFile, { signal }?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1830
|
+
/**
|
|
1831
|
+
* Fetches an invite's target users job status
|
|
1832
|
+
*
|
|
1833
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-target-users-job-status}
|
|
1834
|
+
* @param code - The invite code
|
|
1835
|
+
* @param options - The options for fetching the invite target users job status
|
|
1836
|
+
* @returns
|
|
1837
|
+
*/
|
|
1838
|
+
getTargetUsersJobStatus(code: string, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIInviteTargetUsersJobStatusResult>;
|
|
1800
1839
|
}
|
|
1801
1840
|
|
|
1802
1841
|
declare class MonetizationAPI {
|
|
@@ -2324,4 +2363,4 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
2324
2363
|
*/
|
|
2325
2364
|
declare const version: string;
|
|
2326
2365
|
|
|
2327
|
-
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, 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, GatewayAPI, GuildsAPI, InteractionsAPI, InvitesAPI, MonetizationAPI, OAuth2API, PollAPI, RoleConnectionsAPI, SoundboardSoundsAPI, StageInstancesAPI, type StartForumThreadOptions, StickersAPI, ThreadsAPI, UsersAPI, VoiceAPI, WebhooksAPI, version, withFiles };
|
|
2366
|
+
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, type CreateAutocompleteResponseOptions, type CreateInteractionDeferResponseOptions, type CreateInteractionFollowUpResponseOptions, type CreateInteractionResponseOptions, type CreateInteractionUpdateMessageResponseOptions, type CreateInviteOptions, type CreateMessageOptions, type CreateModalResponseOptions, type CreateStickerOptions, type CreateWebhookMessageOptions, type DescriptiveRawFile, type EditInteractionResponseOptions, type EditMessageOptions, type EditWebhookMessageOptions, GatewayAPI, GuildsAPI, InteractionsAPI, InvitesAPI, MonetizationAPI, OAuth2API, PollAPI, RoleConnectionsAPI, SoundboardSoundsAPI, StageInstancesAPI, type StartForumThreadOptions, StickersAPI, ThreadsAPI, UsersAPI, VoiceAPI, WebhooksAPI, version, withFiles };
|
package/dist/http-only.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, 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 } from 'discord-api-types/v10';
|
|
3
|
+
import { Snowflake, RESTGetAPIApplicationCommandsQuery, Locale, 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, RESTGetAPIInviteTargetUsersJobStatusResult, 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 } from 'discord-api-types/v10';
|
|
4
4
|
export * from 'discord-api-types/v10';
|
|
5
5
|
import * as discord_api_types_globals from 'discord-api-types/globals';
|
|
6
6
|
|
|
@@ -15,7 +15,9 @@ declare class ApplicationCommandsAPI {
|
|
|
15
15
|
* @param query - The query options for fetching commands
|
|
16
16
|
* @param options - The options for fetching commands
|
|
17
17
|
*/
|
|
18
|
-
getGlobalCommands(applicationId: Snowflake, query?: RESTGetAPIApplicationCommandsQuery, { signal }?: Pick<RequestData, 'signal'>
|
|
18
|
+
getGlobalCommands(applicationId: Snowflake, query?: RESTGetAPIApplicationCommandsQuery, { locale, signal }?: Pick<RequestData, 'signal'> & {
|
|
19
|
+
locale?: Locale;
|
|
20
|
+
}): Promise<RESTGetAPIApplicationCommandsResult>;
|
|
19
21
|
/**
|
|
20
22
|
* Creates a new global command
|
|
21
23
|
*
|
|
@@ -71,7 +73,9 @@ declare class ApplicationCommandsAPI {
|
|
|
71
73
|
* @param query - The data for fetching commands
|
|
72
74
|
* @param options - The options for fetching commands
|
|
73
75
|
*/
|
|
74
|
-
getGuildCommands(applicationId: Snowflake, guildId: Snowflake, query?: RESTGetAPIApplicationGuildCommandsQuery, { signal }?: Pick<RequestData, 'signal'>
|
|
76
|
+
getGuildCommands(applicationId: Snowflake, guildId: Snowflake, query?: RESTGetAPIApplicationGuildCommandsQuery, { locale, signal }?: Pick<RequestData, 'signal'> & {
|
|
77
|
+
locale?: Locale;
|
|
78
|
+
}): Promise<RESTGetAPIApplicationGuildCommandsResult>;
|
|
75
79
|
/**
|
|
76
80
|
* Creates a new command for a guild
|
|
77
81
|
*
|
|
@@ -241,6 +245,12 @@ interface CreateMessageOptions extends RESTPostAPIChannelMessageJSONBody {
|
|
|
241
245
|
interface EditMessageOptions extends RESTPatchAPIChannelMessageJSONBody {
|
|
242
246
|
files?: RawFile[];
|
|
243
247
|
}
|
|
248
|
+
interface CreateInviteOptions extends RESTPostAPIChannelInviteJSONBody {
|
|
249
|
+
/**
|
|
250
|
+
* A CSV file with a single column of user ids for all the users able to accept this invite
|
|
251
|
+
*/
|
|
252
|
+
targetUsersFile?: RawFile;
|
|
253
|
+
}
|
|
244
254
|
declare class ChannelsAPI {
|
|
245
255
|
private readonly rest;
|
|
246
256
|
constructor(rest: REST);
|
|
@@ -445,7 +455,7 @@ declare class ChannelsAPI {
|
|
|
445
455
|
* @param body - The data for creating the invite
|
|
446
456
|
* @param options - The options for creating the invite
|
|
447
457
|
*/
|
|
448
|
-
createInvite(channelId: Snowflake, body:
|
|
458
|
+
createInvite(channelId: Snowflake, { targetUsersFile, ...body }: CreateInviteOptions, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIExtendedInvite>;
|
|
449
459
|
/**
|
|
450
460
|
* Fetches the invites of a channel
|
|
451
461
|
*
|
|
@@ -1783,7 +1793,7 @@ declare class InvitesAPI {
|
|
|
1783
1793
|
/**
|
|
1784
1794
|
* Fetches an invite
|
|
1785
1795
|
*
|
|
1786
|
-
* @see {@link https://discord.com/developers/
|
|
1796
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-invite}
|
|
1787
1797
|
* @param code - The invite code
|
|
1788
1798
|
* @param query - The options for fetching the invite
|
|
1789
1799
|
* @param options - The options for fetching the invite
|
|
@@ -1792,11 +1802,40 @@ declare class InvitesAPI {
|
|
|
1792
1802
|
/**
|
|
1793
1803
|
* Deletes an invite
|
|
1794
1804
|
*
|
|
1795
|
-
* @see {@link https://discord.com/developers/
|
|
1805
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#delete-invite}
|
|
1796
1806
|
* @param code - The invite code
|
|
1797
1807
|
* @param options - The options for deleting the invite
|
|
1798
1808
|
*/
|
|
1799
1809
|
delete(code: string, { reason, signal }?: Pick<RequestData, 'reason' | 'signal'>): Promise<discord_api_types_v10.APIInvite>;
|
|
1810
|
+
/**
|
|
1811
|
+
* Fetches an invite's target users
|
|
1812
|
+
*
|
|
1813
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-target-users}
|
|
1814
|
+
* @param code - The invite code
|
|
1815
|
+
* @param options - The options for fetching the invite target users
|
|
1816
|
+
* @returns
|
|
1817
|
+
*/
|
|
1818
|
+
getTargetUsers(code: string, { signal }?: Pick<RequestData, 'signal'>): Promise<ArrayBuffer>;
|
|
1819
|
+
/**
|
|
1820
|
+
* Updates an invite's target users
|
|
1821
|
+
*
|
|
1822
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#update-target-users}
|
|
1823
|
+
* @param code - The invite code
|
|
1824
|
+
* @param targetUsersFile - A CSV file with a single column of user ids
|
|
1825
|
+
* for all the users able to accept this invite
|
|
1826
|
+
* @param options - The options for updating the invite target users
|
|
1827
|
+
* @returns
|
|
1828
|
+
*/
|
|
1829
|
+
updateTargetUsers(code: string, targetUsersFile: RawFile, { signal }?: Pick<RequestData, 'signal'>): Promise<undefined>;
|
|
1830
|
+
/**
|
|
1831
|
+
* Fetches an invite's target users job status
|
|
1832
|
+
*
|
|
1833
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-target-users-job-status}
|
|
1834
|
+
* @param code - The invite code
|
|
1835
|
+
* @param options - The options for fetching the invite target users job status
|
|
1836
|
+
* @returns
|
|
1837
|
+
*/
|
|
1838
|
+
getTargetUsersJobStatus(code: string, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIInviteTargetUsersJobStatusResult>;
|
|
1800
1839
|
}
|
|
1801
1840
|
|
|
1802
1841
|
declare class MonetizationAPI {
|
|
@@ -2324,4 +2363,4 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
2324
2363
|
*/
|
|
2325
2364
|
declare const version: string;
|
|
2326
2365
|
|
|
2327
|
-
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, 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, GatewayAPI, GuildsAPI, InteractionsAPI, InvitesAPI, MonetizationAPI, OAuth2API, PollAPI, RoleConnectionsAPI, SoundboardSoundsAPI, StageInstancesAPI, type StartForumThreadOptions, StickersAPI, ThreadsAPI, UsersAPI, VoiceAPI, WebhooksAPI, version, withFiles };
|
|
2366
|
+
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, type CreateAutocompleteResponseOptions, type CreateInteractionDeferResponseOptions, type CreateInteractionFollowUpResponseOptions, type CreateInteractionResponseOptions, type CreateInteractionUpdateMessageResponseOptions, type CreateInviteOptions, type CreateMessageOptions, type CreateModalResponseOptions, type CreateStickerOptions, type CreateWebhookMessageOptions, type DescriptiveRawFile, type EditInteractionResponseOptions, type EditMessageOptions, type EditWebhookMessageOptions, GatewayAPI, GuildsAPI, InteractionsAPI, InvitesAPI, MonetizationAPI, OAuth2API, PollAPI, RoleConnectionsAPI, SoundboardSoundsAPI, StageInstancesAPI, type StartForumThreadOptions, StickersAPI, ThreadsAPI, UsersAPI, VoiceAPI, WebhooksAPI, version, withFiles };
|
package/dist/http-only.js
CHANGED
|
@@ -65,8 +65,9 @@ var ApplicationCommandsAPI = class {
|
|
|
65
65
|
* @param query - The query options for fetching commands
|
|
66
66
|
* @param options - The options for fetching commands
|
|
67
67
|
*/
|
|
68
|
-
async getGlobalCommands(applicationId, query = {}, { signal } = {}) {
|
|
68
|
+
async getGlobalCommands(applicationId, query = {}, { locale, signal } = {}) {
|
|
69
69
|
return this.rest.get(import_v10.Routes.applicationCommands(applicationId), {
|
|
70
|
+
headers: locale ? { "X-Discord-Locale": locale } : {},
|
|
70
71
|
query: (0, import_rest.makeURLSearchParams)(query),
|
|
71
72
|
signal
|
|
72
73
|
});
|
|
@@ -147,8 +148,9 @@ var ApplicationCommandsAPI = class {
|
|
|
147
148
|
* @param query - The data for fetching commands
|
|
148
149
|
* @param options - The options for fetching commands
|
|
149
150
|
*/
|
|
150
|
-
async getGuildCommands(applicationId, guildId, query = {}, { signal } = {}) {
|
|
151
|
+
async getGuildCommands(applicationId, guildId, query = {}, { locale, signal } = {}) {
|
|
151
152
|
return this.rest.get(import_v10.Routes.applicationGuildCommands(applicationId, guildId), {
|
|
153
|
+
headers: locale ? { "X-Discord-Locale": locale } : {},
|
|
152
154
|
query: (0, import_rest.makeURLSearchParams)(query),
|
|
153
155
|
signal
|
|
154
156
|
});
|
|
@@ -669,10 +671,11 @@ var ChannelsAPI = class {
|
|
|
669
671
|
* @param body - The data for creating the invite
|
|
670
672
|
* @param options - The options for creating the invite
|
|
671
673
|
*/
|
|
672
|
-
async createInvite(channelId, body, { reason, signal } = {}) {
|
|
674
|
+
async createInvite(channelId, { targetUsersFile, ...body }, { reason, signal } = {}) {
|
|
673
675
|
return this.rest.post(import_v103.Routes.channelInvites(channelId), {
|
|
674
676
|
reason,
|
|
675
677
|
body,
|
|
678
|
+
files: targetUsersFile ? [{ key: "target_users_file", contentType: "text/csv", ...targetUsersFile }] : [],
|
|
676
679
|
signal
|
|
677
680
|
});
|
|
678
681
|
}
|
|
@@ -2214,7 +2217,7 @@ var InvitesAPI = class {
|
|
|
2214
2217
|
/**
|
|
2215
2218
|
* Fetches an invite
|
|
2216
2219
|
*
|
|
2217
|
-
* @see {@link https://discord.com/developers/
|
|
2220
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-invite}
|
|
2218
2221
|
* @param code - The invite code
|
|
2219
2222
|
* @param query - The options for fetching the invite
|
|
2220
2223
|
* @param options - The options for fetching the invite
|
|
@@ -2228,13 +2231,53 @@ var InvitesAPI = class {
|
|
|
2228
2231
|
/**
|
|
2229
2232
|
* Deletes an invite
|
|
2230
2233
|
*
|
|
2231
|
-
* @see {@link https://discord.com/developers/
|
|
2234
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#delete-invite}
|
|
2232
2235
|
* @param code - The invite code
|
|
2233
2236
|
* @param options - The options for deleting the invite
|
|
2234
2237
|
*/
|
|
2235
2238
|
async delete(code, { reason, signal } = {}) {
|
|
2236
2239
|
return this.rest.delete(import_v108.Routes.invite(code), { reason, signal });
|
|
2237
2240
|
}
|
|
2241
|
+
/**
|
|
2242
|
+
* Fetches an invite's target users
|
|
2243
|
+
*
|
|
2244
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-target-users}
|
|
2245
|
+
* @param code - The invite code
|
|
2246
|
+
* @param options - The options for fetching the invite target users
|
|
2247
|
+
* @returns
|
|
2248
|
+
*/
|
|
2249
|
+
async getTargetUsers(code, { signal } = {}) {
|
|
2250
|
+
return this.rest.get(import_v108.Routes.inviteTargetUsers(code), { signal });
|
|
2251
|
+
}
|
|
2252
|
+
/**
|
|
2253
|
+
* Updates an invite's target users
|
|
2254
|
+
*
|
|
2255
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#update-target-users}
|
|
2256
|
+
* @param code - The invite code
|
|
2257
|
+
* @param targetUsersFile - A CSV file with a single column of user ids
|
|
2258
|
+
* for all the users able to accept this invite
|
|
2259
|
+
* @param options - The options for updating the invite target users
|
|
2260
|
+
* @returns
|
|
2261
|
+
*/
|
|
2262
|
+
async updateTargetUsers(code, targetUsersFile, { signal } = {}) {
|
|
2263
|
+
return this.rest.put(import_v108.Routes.inviteTargetUsers(code), {
|
|
2264
|
+
files: [{ key: "target_users_file", contentType: "text/csv", ...targetUsersFile }],
|
|
2265
|
+
signal
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
/**
|
|
2269
|
+
* Fetches an invite's target users job status
|
|
2270
|
+
*
|
|
2271
|
+
* @see {@link https://docs.discord.com/developers/resources/invite#get-target-users-job-status}
|
|
2272
|
+
* @param code - The invite code
|
|
2273
|
+
* @param options - The options for fetching the invite target users job status
|
|
2274
|
+
* @returns
|
|
2275
|
+
*/
|
|
2276
|
+
async getTargetUsersJobStatus(code, { signal } = {}) {
|
|
2277
|
+
return this.rest.get(import_v108.Routes.inviteTargetUsersJobStatus(code), {
|
|
2278
|
+
signal
|
|
2279
|
+
});
|
|
2280
|
+
}
|
|
2238
2281
|
};
|
|
2239
2282
|
|
|
2240
2283
|
// src/api/monetization.ts
|
|
@@ -3134,7 +3177,7 @@ __name(withFiles, "withFiles");
|
|
|
3134
3177
|
|
|
3135
3178
|
// src/http-only/index.ts
|
|
3136
3179
|
__reExport(http_only_exports, require("discord-api-types/v10"), module.exports);
|
|
3137
|
-
var version = "2.
|
|
3180
|
+
var version = "2.7.0";
|
|
3138
3181
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3139
3182
|
0 && (module.exports = {
|
|
3140
3183
|
API,
|