@discordjs/core 1.2.0-dev.1714263069-798f28cb9 → 1.2.0-dev.1714608592-997887069
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 +37 -2
- package/dist/http-only.d.ts +37 -2
- package/dist/http-only.js +109 -53
- package/dist/http-only.js.map +1 -1
- package/dist/http-only.mjs +110 -53
- package/dist/http-only.mjs.map +1 -1
- package/dist/index.d.mts +39 -2
- package/dist/index.d.ts +39 -2
- package/dist/index.js +115 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +112 -56
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelThreadsJSONBody, APIThreadChannel, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPostAPIChannelWebhookJSONBody, RESTGetAPIChannelWebhooksResult, RESTPutAPIChannelPermissionJSONBody, 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, RESTPatchAPIGuildMemberJSONBody, RESTPostAPIGuildTemplatesJSONBody, RESTGetAPIGuildWebhooksResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPutAPIGuildOnboardingJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, APIInteractionResponseCallbackData, APIInteractionResponseDeferredChannelMessageWithSource, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTGetAPIInviteQuery, RESTGetAPISKUsResult, RESTGetAPIEntitlementsQuery, RESTGetAPIEntitlementsResult, RESTPostAPIEntitlementBody, RESTOAuth2AuthorizationQuery, RESTPostOAuth2AccessTokenURLEncodedData, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2RefreshTokenURLEncodedData, RESTPostOAuth2ClientCredentialsURLEncodedData, RESTGetAPIOAuth2CurrentApplicationResult, RESTGetAPIOAuth2CurrentAuthorizationResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTPostAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceJSONBody, RESTGetStickerPacksResult, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, RESTGetAPICurrentUserConnectionsResult, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTGetAPIVoiceRegionsResult } 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, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelThreadsJSONBody, APIThreadChannel, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPostAPIChannelWebhookJSONBody, RESTGetAPIChannelWebhooksResult, RESTPutAPIChannelPermissionJSONBody, 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, RESTPatchAPIGuildMemberJSONBody, RESTPostAPIGuildTemplatesJSONBody, RESTGetAPIGuildWebhooksResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPutAPIGuildOnboardingJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, APIInteractionResponseCallbackData, APIInteractionResponseDeferredChannelMessageWithSource, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTGetAPIInviteQuery, RESTGetAPISKUsResult, RESTGetAPIEntitlementsQuery, RESTGetAPIEntitlementsResult, RESTPostAPIEntitlementBody, RESTOAuth2AuthorizationQuery, RESTPostOAuth2AccessTokenURLEncodedData, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2RefreshTokenURLEncodedData, RESTPostOAuth2ClientCredentialsURLEncodedData, RESTGetAPIOAuth2CurrentApplicationResult, RESTGetAPIOAuth2CurrentAuthorizationResult, RESTGetAPIPollAnswerVotersQuery, RESTGetAPIPollAnswerVotersResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTPostAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceJSONBody, RESTGetStickerPacksResult, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, RESTGetAPICurrentUserConnectionsResult, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTGetAPIVoiceRegionsResult } from 'discord-api-types/v10';
|
|
4
4
|
export * from 'discord-api-types/v10';
|
|
5
5
|
|
|
6
6
|
declare class ApplicationCommandsAPI {
|
|
@@ -1456,6 +1456,15 @@ declare class MonetizationAPI {
|
|
|
1456
1456
|
* @param options - The options for deleting the entitlement
|
|
1457
1457
|
*/
|
|
1458
1458
|
deleteTestEntitlement(applicationId: Snowflake, entitlementId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1459
|
+
/**
|
|
1460
|
+
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
1461
|
+
*
|
|
1462
|
+
* @see {@link https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement}
|
|
1463
|
+
* @param applicationId - The application id to consume the entitlement for
|
|
1464
|
+
* @param entitlementId - The entitlement id to consume
|
|
1465
|
+
* @param options - The options for consuming the entitlement
|
|
1466
|
+
*/
|
|
1467
|
+
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1459
1468
|
}
|
|
1460
1469
|
|
|
1461
1470
|
declare class OAuth2API {
|
|
@@ -1510,6 +1519,31 @@ declare class OAuth2API {
|
|
|
1510
1519
|
getCurrentAuthorizationInformation({ signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIOAuth2CurrentAuthorizationResult>;
|
|
1511
1520
|
}
|
|
1512
1521
|
|
|
1522
|
+
declare class PollAPI {
|
|
1523
|
+
private readonly rest;
|
|
1524
|
+
constructor(rest: REST);
|
|
1525
|
+
/**
|
|
1526
|
+
* Gets the list of users that voted for a specific answer in a poll
|
|
1527
|
+
*
|
|
1528
|
+
* @see {@link https://discord.com/developers/docs/resources/poll#get-answer-voters}
|
|
1529
|
+
* @param channelId - The id of the channel containing the message
|
|
1530
|
+
* @param messageId - The id of the message containing the poll
|
|
1531
|
+
* @param answerId - The id of the answer to get voters for
|
|
1532
|
+
* @param query - The query for getting the list of voters
|
|
1533
|
+
* @param options - The options for getting the list of voters
|
|
1534
|
+
*/
|
|
1535
|
+
getAnswerVoters(channelId: Snowflake, messageId: Snowflake, answerId: number, query: RESTGetAPIPollAnswerVotersQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIPollAnswerVotersResult>;
|
|
1536
|
+
/**
|
|
1537
|
+
* Immediately expires (i.e. ends) a poll
|
|
1538
|
+
*
|
|
1539
|
+
* @see {@link https://discord.com/developers/docs/resources/poll#expire-poll}
|
|
1540
|
+
* @param channelId - The id of the channel containing the message
|
|
1541
|
+
* @param messageId - The id of the message containing the poll
|
|
1542
|
+
* @param options - The options for expiring the poll
|
|
1543
|
+
*/
|
|
1544
|
+
expirePoll(channelId: Snowflake, messageId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1513
1547
|
declare class RoleConnectionsAPI {
|
|
1514
1548
|
private readonly rest;
|
|
1515
1549
|
constructor(rest: REST);
|
|
@@ -1769,6 +1803,7 @@ declare class API {
|
|
|
1769
1803
|
readonly invites: InvitesAPI;
|
|
1770
1804
|
readonly monetization: MonetizationAPI;
|
|
1771
1805
|
readonly oauth2: OAuth2API;
|
|
1806
|
+
readonly poll: PollAPI;
|
|
1772
1807
|
readonly roleConnections: RoleConnectionsAPI;
|
|
1773
1808
|
readonly stageInstances: StageInstancesAPI;
|
|
1774
1809
|
readonly stickers: StickersAPI;
|
|
@@ -1816,4 +1851,4 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
1816
1851
|
*/
|
|
1817
1852
|
declare const version: string;
|
|
1818
1853
|
|
|
1819
|
-
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, type DescriptiveRawFile, GuildsAPI, InteractionsAPI, InvitesAPI, MonetizationAPI, OAuth2API, RoleConnectionsAPI, StageInstancesAPI, type StartForumThreadOptions, StickersAPI, ThreadsAPI, UsersAPI, VoiceAPI, WebhooksAPI, version, withFiles };
|
|
1854
|
+
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, type DescriptiveRawFile, GuildsAPI, InteractionsAPI, InvitesAPI, MonetizationAPI, OAuth2API, PollAPI, RoleConnectionsAPI, 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, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelThreadsJSONBody, APIThreadChannel, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPostAPIChannelWebhookJSONBody, RESTGetAPIChannelWebhooksResult, RESTPutAPIChannelPermissionJSONBody, 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, RESTPatchAPIGuildMemberJSONBody, RESTPostAPIGuildTemplatesJSONBody, RESTGetAPIGuildWebhooksResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPutAPIGuildOnboardingJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, APIInteractionResponseCallbackData, APIInteractionResponseDeferredChannelMessageWithSource, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTGetAPIInviteQuery, RESTGetAPISKUsResult, RESTGetAPIEntitlementsQuery, RESTGetAPIEntitlementsResult, RESTPostAPIEntitlementBody, RESTOAuth2AuthorizationQuery, RESTPostOAuth2AccessTokenURLEncodedData, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2RefreshTokenURLEncodedData, RESTPostOAuth2ClientCredentialsURLEncodedData, RESTGetAPIOAuth2CurrentApplicationResult, RESTGetAPIOAuth2CurrentAuthorizationResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTPostAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceJSONBody, RESTGetStickerPacksResult, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, RESTGetAPICurrentUserConnectionsResult, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTGetAPIVoiceRegionsResult } 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, RESTPostAPIGuildForumThreadsJSONBody, RESTPostAPIChannelMessageJSONBody, RESTPatchAPIChannelMessageJSONBody, RESTGetAPIChannelMessageReactionUsersQuery, RESTGetAPIChannelMessageReactionUsersResult, RESTPatchAPIChannelJSONBody, RESTGetAPIChannelMessagesQuery, RESTGetAPIChannelMessagesResult, RESTGetAPIChannelPinsResult, RESTPostAPIChannelInviteJSONBody, RESTGetAPIChannelInvitesResult, RESTPostAPIChannelThreadsJSONBody, APIThreadChannel, RESTGetAPIChannelThreadsArchivedQuery, RESTGetAPIChannelUsersThreadsArchivedResult, RESTPostAPIChannelWebhookJSONBody, RESTGetAPIChannelWebhooksResult, RESTPutAPIChannelPermissionJSONBody, 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, RESTPatchAPIGuildMemberJSONBody, RESTPostAPIGuildTemplatesJSONBody, RESTGetAPIGuildWebhooksResult, RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody, RESTPutAPIGuildOnboardingJSONBody, RESTPatchAPIWebhookJSONBody, RESTPostAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery, RESTPostAPIWebhookWithTokenWaitResult, RESTPostAPIWebhookWithTokenSlackQuery, RESTPostAPIWebhookWithTokenGitHubQuery, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookWithTokenMessageJSONBody, APIInteractionResponseCallbackData, APIInteractionResponseDeferredChannelMessageWithSource, APICommandAutocompleteInteractionResponseCallbackData, APIModalInteractionResponseCallbackData, RESTGetAPIInviteQuery, RESTGetAPISKUsResult, RESTGetAPIEntitlementsQuery, RESTGetAPIEntitlementsResult, RESTPostAPIEntitlementBody, RESTOAuth2AuthorizationQuery, RESTPostOAuth2AccessTokenURLEncodedData, RESTPostOAuth2AccessTokenResult, RESTPostOAuth2RefreshTokenURLEncodedData, RESTPostOAuth2ClientCredentialsURLEncodedData, RESTGetAPIOAuth2CurrentApplicationResult, RESTGetAPIOAuth2CurrentAuthorizationResult, RESTGetAPIPollAnswerVotersQuery, RESTGetAPIPollAnswerVotersResult, RESTGetAPIApplicationRoleConnectionMetadataResult, RESTPutAPIApplicationRoleConnectionMetadataJSONBody, RESTPutAPIApplicationRoleConnectionMetadataResult, RESTPostAPIStageInstanceJSONBody, RESTPatchAPIStageInstanceJSONBody, RESTGetStickerPacksResult, APIThreadMember, RESTGetAPIChannelThreadMembersResult, RESTGetAPICurrentUserGuildsQuery, RESTGetAPICurrentUserGuildsResult, RESTPatchAPICurrentUserJSONBody, RESTGetAPICurrentUserConnectionsResult, RESTPutAPICurrentUserApplicationRoleConnectionJSONBody, RESTGetAPIVoiceRegionsResult } from 'discord-api-types/v10';
|
|
4
4
|
export * from 'discord-api-types/v10';
|
|
5
5
|
|
|
6
6
|
declare class ApplicationCommandsAPI {
|
|
@@ -1456,6 +1456,15 @@ declare class MonetizationAPI {
|
|
|
1456
1456
|
* @param options - The options for deleting the entitlement
|
|
1457
1457
|
*/
|
|
1458
1458
|
deleteTestEntitlement(applicationId: Snowflake, entitlementId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1459
|
+
/**
|
|
1460
|
+
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
1461
|
+
*
|
|
1462
|
+
* @see {@link https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement}
|
|
1463
|
+
* @param applicationId - The application id to consume the entitlement for
|
|
1464
|
+
* @param entitlementId - The entitlement id to consume
|
|
1465
|
+
* @param options - The options for consuming the entitlement
|
|
1466
|
+
*/
|
|
1467
|
+
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<void>;
|
|
1459
1468
|
}
|
|
1460
1469
|
|
|
1461
1470
|
declare class OAuth2API {
|
|
@@ -1510,6 +1519,31 @@ declare class OAuth2API {
|
|
|
1510
1519
|
getCurrentAuthorizationInformation({ signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIOAuth2CurrentAuthorizationResult>;
|
|
1511
1520
|
}
|
|
1512
1521
|
|
|
1522
|
+
declare class PollAPI {
|
|
1523
|
+
private readonly rest;
|
|
1524
|
+
constructor(rest: REST);
|
|
1525
|
+
/**
|
|
1526
|
+
* Gets the list of users that voted for a specific answer in a poll
|
|
1527
|
+
*
|
|
1528
|
+
* @see {@link https://discord.com/developers/docs/resources/poll#get-answer-voters}
|
|
1529
|
+
* @param channelId - The id of the channel containing the message
|
|
1530
|
+
* @param messageId - The id of the message containing the poll
|
|
1531
|
+
* @param answerId - The id of the answer to get voters for
|
|
1532
|
+
* @param query - The query for getting the list of voters
|
|
1533
|
+
* @param options - The options for getting the list of voters
|
|
1534
|
+
*/
|
|
1535
|
+
getAnswerVoters(channelId: Snowflake, messageId: Snowflake, answerId: number, query: RESTGetAPIPollAnswerVotersQuery, { signal }?: Pick<RequestData, 'signal'>): Promise<RESTGetAPIPollAnswerVotersResult>;
|
|
1536
|
+
/**
|
|
1537
|
+
* Immediately expires (i.e. ends) a poll
|
|
1538
|
+
*
|
|
1539
|
+
* @see {@link https://discord.com/developers/docs/resources/poll#expire-poll}
|
|
1540
|
+
* @param channelId - The id of the channel containing the message
|
|
1541
|
+
* @param messageId - The id of the message containing the poll
|
|
1542
|
+
* @param options - The options for expiring the poll
|
|
1543
|
+
*/
|
|
1544
|
+
expirePoll(channelId: Snowflake, messageId: Snowflake, { signal }?: Pick<RequestData, 'signal'>): Promise<discord_api_types_v10.APIMessage>;
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1513
1547
|
declare class RoleConnectionsAPI {
|
|
1514
1548
|
private readonly rest;
|
|
1515
1549
|
constructor(rest: REST);
|
|
@@ -1769,6 +1803,7 @@ declare class API {
|
|
|
1769
1803
|
readonly invites: InvitesAPI;
|
|
1770
1804
|
readonly monetization: MonetizationAPI;
|
|
1771
1805
|
readonly oauth2: OAuth2API;
|
|
1806
|
+
readonly poll: PollAPI;
|
|
1772
1807
|
readonly roleConnections: RoleConnectionsAPI;
|
|
1773
1808
|
readonly stageInstances: StageInstancesAPI;
|
|
1774
1809
|
readonly stickers: StickersAPI;
|
|
@@ -1816,4 +1851,4 @@ declare function withFiles(files: DescriptiveRawFile[], options: APIInteractionR
|
|
|
1816
1851
|
*/
|
|
1817
1852
|
declare const version: string;
|
|
1818
1853
|
|
|
1819
|
-
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, type DescriptiveRawFile, GuildsAPI, InteractionsAPI, InvitesAPI, MonetizationAPI, OAuth2API, RoleConnectionsAPI, StageInstancesAPI, type StartForumThreadOptions, StickersAPI, ThreadsAPI, UsersAPI, VoiceAPI, WebhooksAPI, version, withFiles };
|
|
1854
|
+
export { API, ApplicationCommandsAPI, ApplicationsAPI, ChannelsAPI, type DescriptiveRawFile, GuildsAPI, InteractionsAPI, InvitesAPI, MonetizationAPI, OAuth2API, PollAPI, RoleConnectionsAPI, StageInstancesAPI, type StartForumThreadOptions, StickersAPI, ThreadsAPI, UsersAPI, VoiceAPI, WebhooksAPI, version, withFiles };
|
package/dist/http-only.js
CHANGED
|
@@ -31,6 +31,7 @@ __export(http_only_exports, {
|
|
|
31
31
|
InvitesAPI: () => InvitesAPI,
|
|
32
32
|
MonetizationAPI: () => MonetizationAPI,
|
|
33
33
|
OAuth2API: () => OAuth2API,
|
|
34
|
+
PollAPI: () => PollAPI,
|
|
34
35
|
RoleConnectionsAPI: () => RoleConnectionsAPI,
|
|
35
36
|
StageInstancesAPI: () => StageInstancesAPI,
|
|
36
37
|
StickersAPI: () => StickersAPI,
|
|
@@ -1952,6 +1953,17 @@ var MonetizationAPI = class {
|
|
|
1952
1953
|
async deleteTestEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
1953
1954
|
await this.rest.delete(import_v107.Routes.entitlement(applicationId, entitlementId), { signal });
|
|
1954
1955
|
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Marks a given entitlement for the user as consumed. Only available for One-Time Purchase consumable SKUs.
|
|
1958
|
+
*
|
|
1959
|
+
* @see {@link https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement}
|
|
1960
|
+
* @param applicationId - The application id to consume the entitlement for
|
|
1961
|
+
* @param entitlementId - The entitlement id to consume
|
|
1962
|
+
* @param options - The options for consuming the entitlement
|
|
1963
|
+
*/
|
|
1964
|
+
async consumeEntitlement(applicationId, entitlementId, { signal } = {}) {
|
|
1965
|
+
await this.rest.post(import_v107.Routes.consumeEntitlement(applicationId, entitlementId), { signal });
|
|
1966
|
+
}
|
|
1955
1967
|
};
|
|
1956
1968
|
|
|
1957
1969
|
// src/api/oauth2.ts
|
|
@@ -2052,8 +2064,49 @@ var OAuth2API = class {
|
|
|
2052
2064
|
}
|
|
2053
2065
|
};
|
|
2054
2066
|
|
|
2055
|
-
// src/api/
|
|
2067
|
+
// src/api/poll.ts
|
|
2068
|
+
var import_rest7 = require("@discordjs/rest");
|
|
2056
2069
|
var import_v109 = require("discord-api-types/v10");
|
|
2070
|
+
var PollAPI = class {
|
|
2071
|
+
constructor(rest) {
|
|
2072
|
+
this.rest = rest;
|
|
2073
|
+
}
|
|
2074
|
+
static {
|
|
2075
|
+
__name(this, "PollAPI");
|
|
2076
|
+
}
|
|
2077
|
+
/**
|
|
2078
|
+
* Gets the list of users that voted for a specific answer in a poll
|
|
2079
|
+
*
|
|
2080
|
+
* @see {@link https://discord.com/developers/docs/resources/poll#get-answer-voters}
|
|
2081
|
+
* @param channelId - The id of the channel containing the message
|
|
2082
|
+
* @param messageId - The id of the message containing the poll
|
|
2083
|
+
* @param answerId - The id of the answer to get voters for
|
|
2084
|
+
* @param query - The query for getting the list of voters
|
|
2085
|
+
* @param options - The options for getting the list of voters
|
|
2086
|
+
*/
|
|
2087
|
+
async getAnswerVoters(channelId, messageId, answerId, query, { signal } = {}) {
|
|
2088
|
+
return this.rest.get(import_v109.Routes.pollAnswerVoters(channelId, messageId, answerId), {
|
|
2089
|
+
signal,
|
|
2090
|
+
query: (0, import_rest7.makeURLSearchParams)(query)
|
|
2091
|
+
});
|
|
2092
|
+
}
|
|
2093
|
+
/**
|
|
2094
|
+
* Immediately expires (i.e. ends) a poll
|
|
2095
|
+
*
|
|
2096
|
+
* @see {@link https://discord.com/developers/docs/resources/poll#expire-poll}
|
|
2097
|
+
* @param channelId - The id of the channel containing the message
|
|
2098
|
+
* @param messageId - The id of the message containing the poll
|
|
2099
|
+
* @param options - The options for expiring the poll
|
|
2100
|
+
*/
|
|
2101
|
+
async expirePoll(channelId, messageId, { signal } = {}) {
|
|
2102
|
+
return this.rest.post(import_v109.Routes.expirePoll(channelId, messageId), {
|
|
2103
|
+
signal
|
|
2104
|
+
});
|
|
2105
|
+
}
|
|
2106
|
+
};
|
|
2107
|
+
|
|
2108
|
+
// src/api/roleConnections.ts
|
|
2109
|
+
var import_v1010 = require("discord-api-types/v10");
|
|
2057
2110
|
var RoleConnectionsAPI = class {
|
|
2058
2111
|
constructor(rest) {
|
|
2059
2112
|
this.rest = rest;
|
|
@@ -2069,7 +2122,7 @@ var RoleConnectionsAPI = class {
|
|
|
2069
2122
|
* @param options - The options for fetching the role connection metadata records
|
|
2070
2123
|
*/
|
|
2071
2124
|
async getMetadataRecords(applicationId, { signal } = {}) {
|
|
2072
|
-
return this.rest.get(
|
|
2125
|
+
return this.rest.get(import_v1010.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2073
2126
|
signal
|
|
2074
2127
|
});
|
|
2075
2128
|
}
|
|
@@ -2082,7 +2135,7 @@ var RoleConnectionsAPI = class {
|
|
|
2082
2135
|
* @param options - The options for updating the role connection metadata records
|
|
2083
2136
|
*/
|
|
2084
2137
|
async updateMetadataRecords(applicationId, body, { signal } = {}) {
|
|
2085
|
-
return this.rest.put(
|
|
2138
|
+
return this.rest.put(import_v1010.Routes.applicationRoleConnectionMetadata(applicationId), {
|
|
2086
2139
|
body,
|
|
2087
2140
|
signal
|
|
2088
2141
|
});
|
|
@@ -2090,7 +2143,7 @@ var RoleConnectionsAPI = class {
|
|
|
2090
2143
|
};
|
|
2091
2144
|
|
|
2092
2145
|
// src/api/stageInstances.ts
|
|
2093
|
-
var
|
|
2146
|
+
var import_v1011 = require("discord-api-types/v10");
|
|
2094
2147
|
var StageInstancesAPI = class {
|
|
2095
2148
|
constructor(rest) {
|
|
2096
2149
|
this.rest = rest;
|
|
@@ -2106,7 +2159,7 @@ var StageInstancesAPI = class {
|
|
|
2106
2159
|
* @param options - The options for creating the new stage instance
|
|
2107
2160
|
*/
|
|
2108
2161
|
async create(body, { reason, signal } = {}) {
|
|
2109
|
-
return this.rest.post(
|
|
2162
|
+
return this.rest.post(import_v1011.Routes.stageInstances(), {
|
|
2110
2163
|
body,
|
|
2111
2164
|
reason,
|
|
2112
2165
|
signal
|
|
@@ -2120,7 +2173,7 @@ var StageInstancesAPI = class {
|
|
|
2120
2173
|
* @param options - The options for fetching the stage instance
|
|
2121
2174
|
*/
|
|
2122
2175
|
async get(channelId, { signal } = {}) {
|
|
2123
|
-
return this.rest.get(
|
|
2176
|
+
return this.rest.get(import_v1011.Routes.stageInstance(channelId), { signal });
|
|
2124
2177
|
}
|
|
2125
2178
|
/**
|
|
2126
2179
|
* Edits a stage instance
|
|
@@ -2131,7 +2184,7 @@ var StageInstancesAPI = class {
|
|
|
2131
2184
|
* @param options - The options for editing the stage instance
|
|
2132
2185
|
*/
|
|
2133
2186
|
async edit(channelId, body, { reason, signal } = {}) {
|
|
2134
|
-
return this.rest.patch(
|
|
2187
|
+
return this.rest.patch(import_v1011.Routes.stageInstance(channelId), {
|
|
2135
2188
|
body,
|
|
2136
2189
|
reason,
|
|
2137
2190
|
signal
|
|
@@ -2145,12 +2198,12 @@ var StageInstancesAPI = class {
|
|
|
2145
2198
|
* @param options - The options for deleting the stage instance
|
|
2146
2199
|
*/
|
|
2147
2200
|
async delete(channelId, { reason, signal } = {}) {
|
|
2148
|
-
await this.rest.delete(
|
|
2201
|
+
await this.rest.delete(import_v1011.Routes.stageInstance(channelId), { reason, signal });
|
|
2149
2202
|
}
|
|
2150
2203
|
};
|
|
2151
2204
|
|
|
2152
2205
|
// src/api/sticker.ts
|
|
2153
|
-
var
|
|
2206
|
+
var import_v1012 = require("discord-api-types/v10");
|
|
2154
2207
|
var StickersAPI = class {
|
|
2155
2208
|
constructor(rest) {
|
|
2156
2209
|
this.rest = rest;
|
|
@@ -2165,7 +2218,7 @@ var StickersAPI = class {
|
|
|
2165
2218
|
* @param options - The options for fetching the sticker packs
|
|
2166
2219
|
*/
|
|
2167
2220
|
async getStickers({ signal } = {}) {
|
|
2168
|
-
return this.rest.get(
|
|
2221
|
+
return this.rest.get(import_v1012.Routes.stickerPacks(), { signal });
|
|
2169
2222
|
}
|
|
2170
2223
|
/**
|
|
2171
2224
|
* Fetches all of the sticker packs
|
|
@@ -2185,12 +2238,12 @@ var StickersAPI = class {
|
|
|
2185
2238
|
* @param options - The options for fetching the sticker
|
|
2186
2239
|
*/
|
|
2187
2240
|
async get(stickerId, { signal } = {}) {
|
|
2188
|
-
return this.rest.get(
|
|
2241
|
+
return this.rest.get(import_v1012.Routes.sticker(stickerId), { signal });
|
|
2189
2242
|
}
|
|
2190
2243
|
};
|
|
2191
2244
|
|
|
2192
2245
|
// src/api/thread.ts
|
|
2193
|
-
var
|
|
2246
|
+
var import_v1013 = require("discord-api-types/v10");
|
|
2194
2247
|
var ThreadsAPI = class {
|
|
2195
2248
|
constructor(rest) {
|
|
2196
2249
|
this.rest = rest;
|
|
@@ -2206,7 +2259,7 @@ var ThreadsAPI = class {
|
|
|
2206
2259
|
* @param options - The options for joining the thread
|
|
2207
2260
|
*/
|
|
2208
2261
|
async join(threadId, { signal } = {}) {
|
|
2209
|
-
await this.rest.put(
|
|
2262
|
+
await this.rest.put(import_v1013.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2210
2263
|
}
|
|
2211
2264
|
/**
|
|
2212
2265
|
* Adds a member to a thread
|
|
@@ -2217,7 +2270,7 @@ var ThreadsAPI = class {
|
|
|
2217
2270
|
* @param options - The options for adding the member to the thread
|
|
2218
2271
|
*/
|
|
2219
2272
|
async addMember(threadId, userId, { signal } = {}) {
|
|
2220
|
-
await this.rest.put(
|
|
2273
|
+
await this.rest.put(import_v1013.Routes.threadMembers(threadId, userId), { signal });
|
|
2221
2274
|
}
|
|
2222
2275
|
/**
|
|
2223
2276
|
* Removes the current user from a thread
|
|
@@ -2227,7 +2280,7 @@ var ThreadsAPI = class {
|
|
|
2227
2280
|
* @param options - The options for leaving the thread
|
|
2228
2281
|
*/
|
|
2229
2282
|
async leave(threadId, { signal } = {}) {
|
|
2230
|
-
await this.rest.delete(
|
|
2283
|
+
await this.rest.delete(import_v1013.Routes.threadMembers(threadId, "@me"), { signal });
|
|
2231
2284
|
}
|
|
2232
2285
|
/**
|
|
2233
2286
|
* Removes a member from a thread
|
|
@@ -2238,7 +2291,7 @@ var ThreadsAPI = class {
|
|
|
2238
2291
|
* @param options - The options for removing the member from the thread
|
|
2239
2292
|
*/
|
|
2240
2293
|
async removeMember(threadId, userId, { signal } = {}) {
|
|
2241
|
-
await this.rest.delete(
|
|
2294
|
+
await this.rest.delete(import_v1013.Routes.threadMembers(threadId, userId), { signal });
|
|
2242
2295
|
}
|
|
2243
2296
|
/**
|
|
2244
2297
|
* Fetches a member of a thread
|
|
@@ -2249,7 +2302,7 @@ var ThreadsAPI = class {
|
|
|
2249
2302
|
* @param options - The options for fetching the member
|
|
2250
2303
|
*/
|
|
2251
2304
|
async getMember(threadId, userId, { signal } = {}) {
|
|
2252
|
-
return this.rest.get(
|
|
2305
|
+
return this.rest.get(import_v1013.Routes.threadMembers(threadId, userId), { signal });
|
|
2253
2306
|
}
|
|
2254
2307
|
/**
|
|
2255
2308
|
* Fetches all members of a thread
|
|
@@ -2259,13 +2312,13 @@ var ThreadsAPI = class {
|
|
|
2259
2312
|
* @param options - The options for fetching the members
|
|
2260
2313
|
*/
|
|
2261
2314
|
async getAllMembers(threadId, { signal } = {}) {
|
|
2262
|
-
return this.rest.get(
|
|
2315
|
+
return this.rest.get(import_v1013.Routes.threadMembers(threadId), { signal });
|
|
2263
2316
|
}
|
|
2264
2317
|
};
|
|
2265
2318
|
|
|
2266
2319
|
// src/api/user.ts
|
|
2267
|
-
var
|
|
2268
|
-
var
|
|
2320
|
+
var import_rest8 = require("@discordjs/rest");
|
|
2321
|
+
var import_v1014 = require("discord-api-types/v10");
|
|
2269
2322
|
var UsersAPI = class {
|
|
2270
2323
|
constructor(rest) {
|
|
2271
2324
|
this.rest = rest;
|
|
@@ -2281,7 +2334,7 @@ var UsersAPI = class {
|
|
|
2281
2334
|
* @param options - The options for fetching the user
|
|
2282
2335
|
*/
|
|
2283
2336
|
async get(userId, { signal } = {}) {
|
|
2284
|
-
return this.rest.get(
|
|
2337
|
+
return this.rest.get(import_v1014.Routes.user(userId), { signal });
|
|
2285
2338
|
}
|
|
2286
2339
|
/**
|
|
2287
2340
|
* Returns the user object of the requester's account
|
|
@@ -2290,7 +2343,7 @@ var UsersAPI = class {
|
|
|
2290
2343
|
* @param options - The options for fetching the current user
|
|
2291
2344
|
*/
|
|
2292
2345
|
async getCurrent({ signal } = {}) {
|
|
2293
|
-
return this.rest.get(
|
|
2346
|
+
return this.rest.get(import_v1014.Routes.user("@me"), { signal });
|
|
2294
2347
|
}
|
|
2295
2348
|
/**
|
|
2296
2349
|
* Returns a list of partial guild objects the current user is a member of
|
|
@@ -2300,8 +2353,8 @@ var UsersAPI = class {
|
|
|
2300
2353
|
* @param options - The options for fetching the guilds
|
|
2301
2354
|
*/
|
|
2302
2355
|
async getGuilds(query = {}, { signal } = {}) {
|
|
2303
|
-
return this.rest.get(
|
|
2304
|
-
query: (0,
|
|
2356
|
+
return this.rest.get(import_v1014.Routes.userGuilds(), {
|
|
2357
|
+
query: (0, import_rest8.makeURLSearchParams)(query),
|
|
2305
2358
|
signal
|
|
2306
2359
|
});
|
|
2307
2360
|
}
|
|
@@ -2313,7 +2366,7 @@ var UsersAPI = class {
|
|
|
2313
2366
|
* @param options - The options for leaving the guild
|
|
2314
2367
|
*/
|
|
2315
2368
|
async leaveGuild(guildId, { signal } = {}) {
|
|
2316
|
-
await this.rest.delete(
|
|
2369
|
+
await this.rest.delete(import_v1014.Routes.userGuild(guildId), { signal });
|
|
2317
2370
|
}
|
|
2318
2371
|
/**
|
|
2319
2372
|
* Edits the current user
|
|
@@ -2323,7 +2376,7 @@ var UsersAPI = class {
|
|
|
2323
2376
|
* @param options - The options for editing the user
|
|
2324
2377
|
*/
|
|
2325
2378
|
async edit(body, { signal } = {}) {
|
|
2326
|
-
return this.rest.patch(
|
|
2379
|
+
return this.rest.patch(import_v1014.Routes.user("@me"), { body, signal });
|
|
2327
2380
|
}
|
|
2328
2381
|
/**
|
|
2329
2382
|
* Fetches the guild member for the current user
|
|
@@ -2333,7 +2386,7 @@ var UsersAPI = class {
|
|
|
2333
2386
|
* @param options - The options for fetching the guild member
|
|
2334
2387
|
*/
|
|
2335
2388
|
async getGuildMember(guildId, { signal } = {}) {
|
|
2336
|
-
return this.rest.get(
|
|
2389
|
+
return this.rest.get(import_v1014.Routes.userGuildMember(guildId), { signal });
|
|
2337
2390
|
}
|
|
2338
2391
|
/**
|
|
2339
2392
|
* Edits the guild member for the current user
|
|
@@ -2344,7 +2397,7 @@ var UsersAPI = class {
|
|
|
2344
2397
|
* @param options - The options for editing the guild member
|
|
2345
2398
|
*/
|
|
2346
2399
|
async editCurrentGuildMember(guildId, body = {}, { reason, signal } = {}) {
|
|
2347
|
-
return this.rest.patch(
|
|
2400
|
+
return this.rest.patch(import_v1014.Routes.guildMember(guildId, "@me"), {
|
|
2348
2401
|
reason,
|
|
2349
2402
|
body,
|
|
2350
2403
|
signal
|
|
@@ -2358,7 +2411,7 @@ var UsersAPI = class {
|
|
|
2358
2411
|
* @param options - The options for opening the DM
|
|
2359
2412
|
*/
|
|
2360
2413
|
async createDM(userId, { signal } = {}) {
|
|
2361
|
-
return this.rest.post(
|
|
2414
|
+
return this.rest.post(import_v1014.Routes.userChannels(), {
|
|
2362
2415
|
body: { recipient_id: userId },
|
|
2363
2416
|
signal
|
|
2364
2417
|
});
|
|
@@ -2370,7 +2423,7 @@ var UsersAPI = class {
|
|
|
2370
2423
|
* @param options - The options for fetching the user's connections
|
|
2371
2424
|
*/
|
|
2372
2425
|
async getConnections({ signal } = {}) {
|
|
2373
|
-
return this.rest.get(
|
|
2426
|
+
return this.rest.get(import_v1014.Routes.userConnections(), { signal });
|
|
2374
2427
|
}
|
|
2375
2428
|
/**
|
|
2376
2429
|
* Gets the current user's active application role connection
|
|
@@ -2380,7 +2433,7 @@ var UsersAPI = class {
|
|
|
2380
2433
|
* @param options - The options for fetching the role connections
|
|
2381
2434
|
*/
|
|
2382
2435
|
async getApplicationRoleConnection(applicationId, { signal } = {}) {
|
|
2383
|
-
return this.rest.get(
|
|
2436
|
+
return this.rest.get(import_v1014.Routes.userApplicationRoleConnection(applicationId), {
|
|
2384
2437
|
signal
|
|
2385
2438
|
});
|
|
2386
2439
|
}
|
|
@@ -2393,7 +2446,7 @@ var UsersAPI = class {
|
|
|
2393
2446
|
* @param options - The options for updating the application role connection
|
|
2394
2447
|
*/
|
|
2395
2448
|
async updateApplicationRoleConnection(applicationId, body, { signal } = {}) {
|
|
2396
|
-
return this.rest.put(
|
|
2449
|
+
return this.rest.put(import_v1014.Routes.userApplicationRoleConnection(applicationId), {
|
|
2397
2450
|
body,
|
|
2398
2451
|
signal
|
|
2399
2452
|
});
|
|
@@ -2401,7 +2454,7 @@ var UsersAPI = class {
|
|
|
2401
2454
|
};
|
|
2402
2455
|
|
|
2403
2456
|
// src/api/voice.ts
|
|
2404
|
-
var
|
|
2457
|
+
var import_v1015 = require("discord-api-types/v10");
|
|
2405
2458
|
var VoiceAPI = class {
|
|
2406
2459
|
constructor(rest) {
|
|
2407
2460
|
this.rest = rest;
|
|
@@ -2416,13 +2469,13 @@ var VoiceAPI = class {
|
|
|
2416
2469
|
* @param options - The options for fetching the voice regions
|
|
2417
2470
|
*/
|
|
2418
2471
|
async getVoiceRegions({ signal } = {}) {
|
|
2419
|
-
return this.rest.get(
|
|
2472
|
+
return this.rest.get(import_v1015.Routes.voiceRegions(), { signal });
|
|
2420
2473
|
}
|
|
2421
2474
|
};
|
|
2422
2475
|
|
|
2423
2476
|
// src/api/webhook.ts
|
|
2424
|
-
var
|
|
2425
|
-
var
|
|
2477
|
+
var import_rest9 = require("@discordjs/rest");
|
|
2478
|
+
var import_v1016 = require("discord-api-types/v10");
|
|
2426
2479
|
var WebhooksAPI = class {
|
|
2427
2480
|
constructor(rest) {
|
|
2428
2481
|
this.rest = rest;
|
|
@@ -2439,7 +2492,7 @@ var WebhooksAPI = class {
|
|
|
2439
2492
|
* @param options - The options for fetching the webhook
|
|
2440
2493
|
*/
|
|
2441
2494
|
async get(id, { token, signal } = {}) {
|
|
2442
|
-
return this.rest.get(
|
|
2495
|
+
return this.rest.get(import_v1016.Routes.webhook(id, token), {
|
|
2443
2496
|
signal,
|
|
2444
2497
|
auth: !token
|
|
2445
2498
|
});
|
|
@@ -2454,7 +2507,7 @@ var WebhooksAPI = class {
|
|
|
2454
2507
|
* @param options - The options for editing the webhook
|
|
2455
2508
|
*/
|
|
2456
2509
|
async edit(id, body, { token, reason, signal } = {}) {
|
|
2457
|
-
return this.rest.patch(
|
|
2510
|
+
return this.rest.patch(import_v1016.Routes.webhook(id, token), {
|
|
2458
2511
|
reason,
|
|
2459
2512
|
body,
|
|
2460
2513
|
signal,
|
|
@@ -2470,7 +2523,7 @@ var WebhooksAPI = class {
|
|
|
2470
2523
|
* @param options - The options for deleting the webhook
|
|
2471
2524
|
*/
|
|
2472
2525
|
async delete(id, { token, reason, signal } = {}) {
|
|
2473
|
-
await this.rest.delete(
|
|
2526
|
+
await this.rest.delete(import_v1016.Routes.webhook(id, token), {
|
|
2474
2527
|
reason,
|
|
2475
2528
|
signal,
|
|
2476
2529
|
auth: !token
|
|
@@ -2491,8 +2544,8 @@ var WebhooksAPI = class {
|
|
|
2491
2544
|
files,
|
|
2492
2545
|
...body
|
|
2493
2546
|
}, { signal } = {}) {
|
|
2494
|
-
return this.rest.post(
|
|
2495
|
-
query: (0,
|
|
2547
|
+
return this.rest.post(import_v1016.Routes.webhook(id, token), {
|
|
2548
|
+
query: (0, import_rest9.makeURLSearchParams)({ wait, thread_id }),
|
|
2496
2549
|
files,
|
|
2497
2550
|
body,
|
|
2498
2551
|
auth: false,
|
|
@@ -2511,8 +2564,8 @@ var WebhooksAPI = class {
|
|
|
2511
2564
|
* @param options - The options for executing the webhook
|
|
2512
2565
|
*/
|
|
2513
2566
|
async executeSlack(id, token, body, query = {}, { signal } = {}) {
|
|
2514
|
-
await this.rest.post(
|
|
2515
|
-
query: (0,
|
|
2567
|
+
await this.rest.post(import_v1016.Routes.webhookPlatform(id, token, "slack"), {
|
|
2568
|
+
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2516
2569
|
body,
|
|
2517
2570
|
auth: false,
|
|
2518
2571
|
signal
|
|
@@ -2529,8 +2582,8 @@ var WebhooksAPI = class {
|
|
|
2529
2582
|
* @param options - The options for executing the webhook
|
|
2530
2583
|
*/
|
|
2531
2584
|
async executeGitHub(id, token, body, query = {}, { signal } = {}) {
|
|
2532
|
-
await this.rest.post(
|
|
2533
|
-
query: (0,
|
|
2585
|
+
await this.rest.post(import_v1016.Routes.webhookPlatform(id, token, "github"), {
|
|
2586
|
+
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2534
2587
|
body,
|
|
2535
2588
|
signal,
|
|
2536
2589
|
auth: false
|
|
@@ -2547,8 +2600,8 @@ var WebhooksAPI = class {
|
|
|
2547
2600
|
* @param options - The options for fetching the message
|
|
2548
2601
|
*/
|
|
2549
2602
|
async getMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2550
|
-
return this.rest.get(
|
|
2551
|
-
query: (0,
|
|
2603
|
+
return this.rest.get(import_v1016.Routes.webhookMessage(id, token, messageId), {
|
|
2604
|
+
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2552
2605
|
auth: false,
|
|
2553
2606
|
signal
|
|
2554
2607
|
});
|
|
@@ -2568,8 +2621,8 @@ var WebhooksAPI = class {
|
|
|
2568
2621
|
files,
|
|
2569
2622
|
...body
|
|
2570
2623
|
}, { signal } = {}) {
|
|
2571
|
-
return this.rest.patch(
|
|
2572
|
-
query: (0,
|
|
2624
|
+
return this.rest.patch(import_v1016.Routes.webhookMessage(id, token, messageId), {
|
|
2625
|
+
query: (0, import_rest9.makeURLSearchParams)({ thread_id }),
|
|
2573
2626
|
auth: false,
|
|
2574
2627
|
body,
|
|
2575
2628
|
signal,
|
|
@@ -2587,8 +2640,8 @@ var WebhooksAPI = class {
|
|
|
2587
2640
|
* @param options - The options for deleting the message
|
|
2588
2641
|
*/
|
|
2589
2642
|
async deleteMessage(id, token, messageId, query = {}, { signal } = {}) {
|
|
2590
|
-
await this.rest.delete(
|
|
2591
|
-
query: (0,
|
|
2643
|
+
await this.rest.delete(import_v1016.Routes.webhookMessage(id, token, messageId), {
|
|
2644
|
+
query: (0, import_rest9.makeURLSearchParams)(query),
|
|
2592
2645
|
auth: false,
|
|
2593
2646
|
signal
|
|
2594
2647
|
});
|
|
@@ -2605,8 +2658,9 @@ var API = class {
|
|
|
2605
2658
|
this.guilds = new GuildsAPI(rest);
|
|
2606
2659
|
this.invites = new InvitesAPI(rest);
|
|
2607
2660
|
this.monetization = new MonetizationAPI(rest);
|
|
2608
|
-
this.roleConnections = new RoleConnectionsAPI(rest);
|
|
2609
2661
|
this.oauth2 = new OAuth2API(rest);
|
|
2662
|
+
this.poll = new PollAPI(rest);
|
|
2663
|
+
this.roleConnections = new RoleConnectionsAPI(rest);
|
|
2610
2664
|
this.stageInstances = new StageInstancesAPI(rest);
|
|
2611
2665
|
this.stickers = new StickersAPI(rest);
|
|
2612
2666
|
this.threads = new ThreadsAPI(rest);
|
|
@@ -2626,6 +2680,7 @@ var API = class {
|
|
|
2626
2680
|
invites;
|
|
2627
2681
|
monetization;
|
|
2628
2682
|
oauth2;
|
|
2683
|
+
poll;
|
|
2629
2684
|
roleConnections;
|
|
2630
2685
|
stageInstances;
|
|
2631
2686
|
stickers;
|
|
@@ -2654,7 +2709,7 @@ __name(withFiles, "withFiles");
|
|
|
2654
2709
|
|
|
2655
2710
|
// src/http-only/index.ts
|
|
2656
2711
|
__reExport(http_only_exports, require("discord-api-types/v10"), module.exports);
|
|
2657
|
-
var version = "1.2.0-dev.
|
|
2712
|
+
var version = "1.2.0-dev.1714608592-997887069";
|
|
2658
2713
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2659
2714
|
0 && (module.exports = {
|
|
2660
2715
|
API,
|
|
@@ -2666,6 +2721,7 @@ var version = "1.2.0-dev.1714263069-798f28cb9";
|
|
|
2666
2721
|
InvitesAPI,
|
|
2667
2722
|
MonetizationAPI,
|
|
2668
2723
|
OAuth2API,
|
|
2724
|
+
PollAPI,
|
|
2669
2725
|
RoleConnectionsAPI,
|
|
2670
2726
|
StageInstancesAPI,
|
|
2671
2727
|
StickersAPI,
|