disgroove 2.0.1 → 2.1.0-dev.4032d61
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/lib/Client.d.ts +18 -4
- package/dist/lib/Client.js +40 -2
- package/dist/lib/constants.d.ts +32 -4
- package/dist/lib/constants.js +35 -5
- package/dist/lib/gateway/Shard.js +6 -1
- package/dist/lib/gateway/ShardManager.js +0 -1
- package/dist/lib/gateway/index.js +0 -1
- package/dist/lib/index.js +0 -1
- package/dist/lib/rest/CDN.js +0 -1
- package/dist/lib/rest/Endpoints.d.ts +4 -1
- package/dist/lib/rest/Endpoints.js +8 -3
- package/dist/lib/rest/RequestManager.d.ts +0 -1
- package/dist/lib/rest/RequestManager.js +0 -1
- package/dist/lib/rest/index.js +0 -1
- package/dist/lib/types/application-command.d.ts +5 -1
- package/dist/lib/types/application-command.js +0 -1
- package/dist/lib/types/application-role-connection-metadata.js +0 -1
- package/dist/lib/types/application.d.ts +11 -1
- package/dist/lib/types/application.js +0 -1
- package/dist/lib/types/audit-log.js +0 -1
- package/dist/lib/types/auto-moderation.js +0 -1
- package/dist/lib/types/channel.d.ts +4 -1
- package/dist/lib/types/channel.js +0 -1
- package/dist/lib/types/emoji.js +0 -1
- package/dist/lib/types/entitlements.js +0 -1
- package/dist/lib/types/gateway-events.d.ts +30 -0
- package/dist/lib/types/gateway-events.js +0 -1
- package/dist/lib/types/guild-scheduled-event.js +0 -1
- package/dist/lib/types/guild-template.js +0 -1
- package/dist/lib/types/guild.d.ts +4 -0
- package/dist/lib/types/guild.js +0 -1
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/index.js +1 -1
- package/dist/lib/types/interaction.d.ts +3 -1
- package/dist/lib/types/interaction.js +0 -1
- package/dist/lib/types/invite.js +0 -1
- package/dist/lib/types/message-components.js +0 -1
- package/dist/lib/types/poll.d.ts +72 -0
- package/dist/lib/types/poll.js +2 -0
- package/dist/lib/types/role.js +0 -1
- package/dist/lib/types/sku.js +0 -1
- package/dist/lib/types/stage-instance.js +0 -1
- package/dist/lib/types/sticker.js +0 -1
- package/dist/lib/types/team.js +0 -1
- package/dist/lib/types/user.js +0 -1
- package/dist/lib/types/voice.js +0 -1
- package/dist/lib/types/webhook.d.ts +3 -1
- package/dist/lib/types/webhook.js +0 -1
- package/dist/lib/utils/Util.js +0 -1
- package/dist/lib/utils/errors.js +0 -1
- package/dist/lib/utils/index.js +0 -1
- package/dist/package.json +2 -2
- package/package.json +2 -2
- package/dist/lib/Client.js.map +0 -1
- package/dist/lib/constants.js.map +0 -1
- package/dist/lib/gateway/Shard.js.map +0 -1
- package/dist/lib/gateway/ShardManager.js.map +0 -1
- package/dist/lib/gateway/ShardsManager.d.ts +0 -6
- package/dist/lib/gateway/ShardsManager.js +0 -14
- package/dist/lib/gateway/ShardsManager.js.map +0 -1
- package/dist/lib/gateway/index.js.map +0 -1
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/rest/CDN.js.map +0 -1
- package/dist/lib/rest/Endpoints.js.map +0 -1
- package/dist/lib/rest/REST.d.ts +0 -17
- package/dist/lib/rest/REST.js +0 -35
- package/dist/lib/rest/REST.js.map +0 -1
- package/dist/lib/rest/RequestManager.js.map +0 -1
- package/dist/lib/rest/RequestsManager.d.ts +0 -22
- package/dist/lib/rest/RequestsManager.js +0 -123
- package/dist/lib/rest/RequestsManager.js.map +0 -1
- package/dist/lib/rest/index.js.map +0 -1
- package/dist/lib/structures/Application.d.ts +0 -174
- package/dist/lib/structures/Application.js +0 -328
- package/dist/lib/structures/Application.js.map +0 -1
- package/dist/lib/structures/ApplicationCommand.d.ts +0 -45
- package/dist/lib/structures/ApplicationCommand.js +0 -127
- package/dist/lib/structures/ApplicationCommand.js.map +0 -1
- package/dist/lib/structures/AuditLog.d.ts +0 -19
- package/dist/lib/structures/AuditLog.js +0 -101
- package/dist/lib/structures/AuditLog.js.map +0 -1
- package/dist/lib/structures/AutoModerationRule.d.ts +0 -34
- package/dist/lib/structures/AutoModerationRule.js +0 -96
- package/dist/lib/structures/AutoModerationRule.js.map +0 -1
- package/dist/lib/structures/Base.d.ts +0 -10
- package/dist/lib/structures/Base.js +0 -23
- package/dist/lib/structures/Base.js.map +0 -1
- package/dist/lib/structures/Channel.d.ts +0 -254
- package/dist/lib/structures/Channel.js +0 -592
- package/dist/lib/structures/Channel.js.map +0 -1
- package/dist/lib/structures/ClientApplication.d.ts +0 -150
- package/dist/lib/structures/ClientApplication.js +0 -241
- package/dist/lib/structures/ClientApplication.js.map +0 -1
- package/dist/lib/structures/Emoji.d.ts +0 -26
- package/dist/lib/structures/Emoji.js +0 -75
- package/dist/lib/structures/Emoji.js.map +0 -1
- package/dist/lib/structures/Entitlement.d.ts +0 -24
- package/dist/lib/structures/Entitlement.js +0 -68
- package/dist/lib/structures/Entitlement.js.map +0 -1
- package/dist/lib/structures/Guild.d.ts +0 -474
- package/dist/lib/structures/Guild.js +0 -1141
- package/dist/lib/structures/Guild.js.map +0 -1
- package/dist/lib/structures/GuildMember.d.ts +0 -49
- package/dist/lib/structures/GuildMember.js +0 -146
- package/dist/lib/structures/GuildMember.js.map +0 -1
- package/dist/lib/structures/GuildScheduledEvent.d.ts +0 -49
- package/dist/lib/structures/GuildScheduledEvent.js +0 -118
- package/dist/lib/structures/GuildScheduledEvent.js.map +0 -1
- package/dist/lib/structures/GuildTemplate.d.ts +0 -30
- package/dist/lib/structures/GuildTemplate.js +0 -72
- package/dist/lib/structures/GuildTemplate.js.map +0 -1
- package/dist/lib/structures/IdentifiableBase.d.ts +0 -15
- package/dist/lib/structures/IdentifiableBase.js +0 -25
- package/dist/lib/structures/IdentifiableBase.js.map +0 -1
- package/dist/lib/structures/Integration.d.ts +0 -31
- package/dist/lib/structures/Integration.js +0 -103
- package/dist/lib/structures/Integration.js.map +0 -1
- package/dist/lib/structures/Interaction.d.ts +0 -76
- package/dist/lib/structures/Interaction.js +0 -346
- package/dist/lib/structures/Interaction.js.map +0 -1
- package/dist/lib/structures/Invite.d.ts +0 -26
- package/dist/lib/structures/Invite.js +0 -82
- package/dist/lib/structures/Invite.js.map +0 -1
- package/dist/lib/structures/Message.d.ts +0 -86
- package/dist/lib/structures/Message.js +0 -303
- package/dist/lib/structures/Message.js.map +0 -1
- package/dist/lib/structures/Role.d.ts +0 -37
- package/dist/lib/structures/Role.js +0 -90
- package/dist/lib/structures/Role.js.map +0 -1
- package/dist/lib/structures/SKU.d.ts +0 -23
- package/dist/lib/structures/SKU.js +0 -63
- package/dist/lib/structures/SKU.js.map +0 -1
- package/dist/lib/structures/StageInstance.d.ts +0 -24
- package/dist/lib/structures/StageInstance.js +0 -57
- package/dist/lib/structures/StageInstance.js.map +0 -1
- package/dist/lib/structures/Sticker.d.ts +0 -31
- package/dist/lib/structures/Sticker.js +0 -86
- package/dist/lib/structures/Sticker.js.map +0 -1
- package/dist/lib/structures/Team.d.ts +0 -14
- package/dist/lib/structures/Team.js +0 -39
- package/dist/lib/structures/Team.js.map +0 -1
- package/dist/lib/structures/TestEntitlement.d.ts +0 -23
- package/dist/lib/structures/TestEntitlement.js +0 -61
- package/dist/lib/structures/TestEntitlement.js.map +0 -1
- package/dist/lib/structures/UnavailableGuild.d.ts +0 -11
- package/dist/lib/structures/UnavailableGuild.js +0 -25
- package/dist/lib/structures/UnavailableGuild.js.map +0 -1
- package/dist/lib/structures/User.d.ts +0 -63
- package/dist/lib/structures/User.js +0 -177
- package/dist/lib/structures/User.js.map +0 -1
- package/dist/lib/structures/VoiceState.d.ts +0 -24
- package/dist/lib/structures/VoiceState.js +0 -66
- package/dist/lib/structures/VoiceState.js.map +0 -1
- package/dist/lib/structures/Webhook.d.ts +0 -82
- package/dist/lib/structures/Webhook.js +0 -223
- package/dist/lib/structures/Webhook.js.map +0 -1
- package/dist/lib/structures/index.d.ts +0 -28
- package/dist/lib/structures/index.js +0 -45
- package/dist/lib/structures/index.js.map +0 -1
- package/dist/lib/types/application-command.js.map +0 -1
- package/dist/lib/types/application-role-connection-metadata.js.map +0 -1
- package/dist/lib/types/application.js.map +0 -1
- package/dist/lib/types/audit-log.js.map +0 -1
- package/dist/lib/types/auto-moderation.js.map +0 -1
- package/dist/lib/types/channel.js.map +0 -1
- package/dist/lib/types/emoji.js.map +0 -1
- package/dist/lib/types/entitlements.js.map +0 -1
- package/dist/lib/types/gateway-events.js.map +0 -1
- package/dist/lib/types/guild-scheduled-event.js.map +0 -1
- package/dist/lib/types/guild-template.js.map +0 -1
- package/dist/lib/types/guild.js.map +0 -1
- package/dist/lib/types/index.js.map +0 -1
- package/dist/lib/types/interaction.js.map +0 -1
- package/dist/lib/types/invite.js.map +0 -1
- package/dist/lib/types/message-components.js.map +0 -1
- package/dist/lib/types/role.js.map +0 -1
- package/dist/lib/types/sku.js.map +0 -1
- package/dist/lib/types/stage-instance.js.map +0 -1
- package/dist/lib/types/sticker.js.map +0 -1
- package/dist/lib/types/team.js.map +0 -1
- package/dist/lib/types/user.js.map +0 -1
- package/dist/lib/types/voice.js.map +0 -1
- package/dist/lib/types/webhook.js.map +0 -1
- package/dist/lib/utils/Collection.d.ts +0 -24
- package/dist/lib/utils/Collection.js +0 -65
- package/dist/lib/utils/Collection.js.map +0 -1
- package/dist/lib/utils/Util.js.map +0 -1
- package/dist/lib/utils/errors.js.map +0 -1
- package/dist/lib/utils/index.js.map +0 -1
package/dist/lib/Client.d.ts
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
import { GatewayIntents, type OAuth2Scopes, type StatusTypes, type ActionTypes, type ImageWidgetStyleOptions, type MFALevel } from "./constants";
|
3
3
|
import { Util } from "./utils";
|
4
4
|
import { RequestManager } from "./rest";
|
5
|
-
import type { Activity, AuditLogEntry, AutoModerationActionExecutionEventFields, AutoModerationRule, Channel, ChannelPinsUpdateEventFields, GuildApplicationCommandPermissions, GuildBanAddEventFields, GuildBanRemoveEventFields, GuildMemberRemoveEventFields, GuildMemberUpdateEventFields, GuildMembersChunkEventFields, GuildScheduledEvent, IntegrationDeleteEventFields, InviteCreateEventFields, InviteDeleteEventFields, MessageDeleteBulkEventFields, MessageDeleteEventFields, MessageReactionAddEventFields, MessageReactionRemoveAllEventFields, MessageReactionRemoveEmojiEventFields, MessageReactionRemoveEventFields, PresenceUpdateEventFields, StageInstance, StickerPack, ThreadListSyncEventFields, ThreadMember, ThreadMembersUpdateEventFields, TypingStartEventFields, VoiceRegion, VoiceServerUpdateEventFields, Entitlement, UnavailableGuild, CreateGlobalApplicationCommandParams, ApplicationCommand, CreateGuildApplicationCommandParams, CreateTestEntitlementParams, EditCurrentApplicationParams, Application, EditGlobalApplicationCommandParams, EditGuildApplicationCommandParams, ApplicationRoleConnectionMetadata, Sku, BulkEditGlobalApplicationCommandsParams, BulkEditGuildApplicationCommandsParams, CreateGuildParams, CreateGuildFromGuildTemplateParams, CreateStageInstanceParams, EditAutoModerationRuleParams, CreateChannelInviteParams, Invite, CreateMessageParams, Message, CreateThreadFromMessageParams, CreateThreadParams, CreateThreadWithoutMessageParams, Webhook, EditChannelParams, EditMessageParams, FollowedChannel, User, Emoji, EditGuildEmojiParams, AddGuildMemberParams, BeginGuildPruneParams, GuildMember, CreateAutoModerationRuleParams, CreateGuildBanParams, CreateGuildChannelParams, CreateGuildEmojiParams, CreateGuildRoleParams, Role, CreateGuildScheduledEventParams, CreateGuildStickerParams, CreateGuildTemplateParams, GuildTemplate, Sticker, EditGuildParams, Guild, EditGuildChannelPositionsParams, EditGuildMemberParams, EditCurrentUserVoiceStateParams, EditCurrentGuildMemberParams, EditGuildMFALevelParams, EditGuildOnboardingParams, EditGuildRolePositionsParams, EditGuildScheduledEventParams, EditGuildStickerParams, EditGuildTemplateParams, EditGuildWelcomeScreenParams, WelcomeScreen, GuildWidgetSettings, AuditLog, Ban, Integration, GuildOnboarding, GuildPreview, GuildScheduledEventUser, GuildWidget, ExecuteWebhookParams, CreateInteractionFollowupMessageParams, InteractionResponse, EditWebhookMessageParams, EditStageInstanceParams, CreateDMParams, EditCurrentUserParams, ApplicationRoleConnection, Connection, UpdateCurrentUserApplicationRoleConnection, EditWebhookParams, Interaction, VoiceState, GuildCreateEventExtraFields, GuildMemberAddEventExtraFields, IntegrationCreateEventExtraFields, IntegrationUpdateEventExtraFields, MessageCreateEventExtraFields, ThreadMemberUpdateEventExtraFields } from "./types";
|
5
|
+
import type { Activity, AuditLogEntry, AutoModerationActionExecutionEventFields, AutoModerationRule, Channel, ChannelPinsUpdateEventFields, GuildApplicationCommandPermissions, GuildBanAddEventFields, GuildBanRemoveEventFields, GuildMemberRemoveEventFields, GuildMemberUpdateEventFields, GuildMembersChunkEventFields, GuildScheduledEvent, IntegrationDeleteEventFields, InviteCreateEventFields, InviteDeleteEventFields, MessageDeleteBulkEventFields, MessageDeleteEventFields, MessageReactionAddEventFields, MessageReactionRemoveAllEventFields, MessageReactionRemoveEmojiEventFields, MessageReactionRemoveEventFields, PresenceUpdateEventFields, StageInstance, StickerPack, ThreadListSyncEventFields, ThreadMember, ThreadMembersUpdateEventFields, TypingStartEventFields, VoiceRegion, VoiceServerUpdateEventFields, Entitlement, UnavailableGuild, CreateGlobalApplicationCommandParams, ApplicationCommand, CreateGuildApplicationCommandParams, CreateTestEntitlementParams, EditCurrentApplicationParams, Application, EditGlobalApplicationCommandParams, EditGuildApplicationCommandParams, ApplicationRoleConnectionMetadata, Sku, BulkEditGlobalApplicationCommandsParams, BulkEditGuildApplicationCommandsParams, CreateGuildParams, CreateGuildFromGuildTemplateParams, CreateStageInstanceParams, EditAutoModerationRuleParams, CreateChannelInviteParams, Invite, CreateMessageParams, Message, CreateThreadFromMessageParams, CreateThreadParams, CreateThreadWithoutMessageParams, Webhook, EditChannelParams, EditMessageParams, FollowedChannel, User, Emoji, EditGuildEmojiParams, AddGuildMemberParams, BeginGuildPruneParams, GuildMember, CreateAutoModerationRuleParams, CreateGuildBanParams, CreateGuildChannelParams, CreateGuildEmojiParams, CreateGuildRoleParams, Role, CreateGuildScheduledEventParams, CreateGuildStickerParams, CreateGuildTemplateParams, GuildTemplate, Sticker, EditGuildParams, Guild, EditGuildChannelPositionsParams, EditGuildMemberParams, EditCurrentUserVoiceStateParams, EditCurrentGuildMemberParams, EditGuildMFALevelParams, EditGuildOnboardingParams, EditGuildRolePositionsParams, EditGuildScheduledEventParams, EditGuildStickerParams, EditGuildTemplateParams, EditGuildWelcomeScreenParams, WelcomeScreen, GuildWidgetSettings, AuditLog, Ban, Integration, GuildOnboarding, GuildPreview, GuildScheduledEventUser, GuildWidget, ExecuteWebhookParams, CreateInteractionFollowupMessageParams, InteractionResponse, EditWebhookMessageParams, EditStageInstanceParams, CreateDMParams, EditCurrentUserParams, ApplicationRoleConnection, Connection, UpdateCurrentUserApplicationRoleConnection, EditWebhookParams, Interaction, VoiceState, GuildCreateEventExtraFields, GuildMemberAddEventExtraFields, IntegrationCreateEventExtraFields, IntegrationUpdateEventExtraFields, MessageCreateEventExtraFields, ThreadMemberUpdateEventExtraFields, MessagePollVoteAddFields, MessagePollVoteRemoveFields, BulkGuildBanParams, BulkDeleteMessagesParams } from "./types";
|
6
6
|
import EventEmitter from "node:events";
|
7
7
|
import { ShardManager } from "./gateway";
|
8
8
|
export interface ClientOptions {
|
@@ -38,10 +38,13 @@ export declare class Client extends EventEmitter {
|
|
38
38
|
beginGuildPrune(guildId: string, options: BeginGuildPruneParams, reason?: string): Promise<{
|
39
39
|
pruned: number;
|
40
40
|
}>;
|
41
|
+
/** https://discord.com/developers/docs/resources/guild#bulk-guild-ban */
|
42
|
+
bulkGuildBan(guildId: string, options: BulkGuildBanParams, reason?: string): Promise<{
|
43
|
+
bannedUsers: Array<string>;
|
44
|
+
failedUsers: Array<string>;
|
45
|
+
}>;
|
41
46
|
/** https://discord.com/developers/docs/resources/channel#bulk-delete-messages */
|
42
|
-
bulkDeleteMessages(channelId: string, options?:
|
43
|
-
messagesIds?: Array<string>;
|
44
|
-
}, reason?: string): void;
|
47
|
+
bulkDeleteMessages(channelId: string, options?: BulkDeleteMessagesParams, reason?: string): void;
|
45
48
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-global-application-commands */
|
46
49
|
bulkEditGlobalApplicationCommands(applicationId: string, commands: BulkEditGlobalApplicationCommandsParams): Promise<Array<ApplicationCommand>>;
|
47
50
|
/** https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands */
|
@@ -244,6 +247,8 @@ export declare class Client extends EventEmitter {
|
|
244
247
|
}): Promise<Message>;
|
245
248
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
|
246
249
|
editWebhookWithToken(webhookId: string, webhookToken: string, options: Omit<EditWebhookParams, "channelId">, reason?: string): Promise<Webhook>;
|
250
|
+
/** https://discord.com/developers/docs/resources/poll#end-poll */
|
251
|
+
endPoll(channelId: string, messageId: string): Promise<Message>;
|
247
252
|
/** https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
248
253
|
executeWebhook(webhookId: string, webhookToken: string, options: ExecuteWebhookParams & {
|
249
254
|
wait: boolean;
|
@@ -475,6 +480,13 @@ export declare class Client extends EventEmitter {
|
|
475
480
|
}>;
|
476
481
|
/** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
|
477
482
|
getPinnedMessages(channelId: string): Promise<Array<Message>>;
|
483
|
+
/** https://discord.com/developers/docs/resources/poll#get-answer-voters */
|
484
|
+
getPollAnswerVoters(channelId: string, messageId: string, answerId: string, options?: {
|
485
|
+
after?: string;
|
486
|
+
limit?: number;
|
487
|
+
}): Promise<{
|
488
|
+
users: Array<User>;
|
489
|
+
}>;
|
478
490
|
/** https://discord.com/developers/docs/monetization/skus#list-skus */
|
479
491
|
getSkus(applicationId: string): Promise<Array<Sku>>;
|
480
492
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
@@ -657,4 +669,6 @@ export interface ClientEvents {
|
|
657
669
|
voiceStateUpdate: [voiceState: VoiceState];
|
658
670
|
voiceServerUpdate: [voiceServer: VoiceServerUpdateEventFields];
|
659
671
|
webhooksUpdate: [channelId: string, guildId: string];
|
672
|
+
messagePollVoteAdd: [vote: MessagePollVoteAddFields];
|
673
|
+
messagePollVoteRemove: [vote: MessagePollVoteRemoveFields];
|
660
674
|
}
|
package/dist/lib/Client.js
CHANGED
@@ -84,11 +84,23 @@ class Client extends node_events_1.default {
|
|
84
84
|
})
|
85
85
|
.then((response) => this.util.toCamelCase(response));
|
86
86
|
}
|
87
|
+
/** https://discord.com/developers/docs/resources/guild#bulk-guild-ban */
|
88
|
+
bulkGuildBan(guildId, options, reason) {
|
89
|
+
return this.rest
|
90
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.bulkGuildBan(guildId), {
|
91
|
+
json: {
|
92
|
+
user_ids: options.userIds,
|
93
|
+
delete_message_seconds: options.deleteMessageSeconds,
|
94
|
+
},
|
95
|
+
reason,
|
96
|
+
})
|
97
|
+
.then((response) => this.util.toCamelCase(response));
|
98
|
+
}
|
87
99
|
/** https://discord.com/developers/docs/resources/channel#bulk-delete-messages */
|
88
100
|
bulkDeleteMessages(channelId, options, reason) {
|
89
101
|
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelBulkDelete(channelId), {
|
90
102
|
json: {
|
91
|
-
messages: options?.
|
103
|
+
messages: options?.messages,
|
92
104
|
},
|
93
105
|
reason,
|
94
106
|
});
|
@@ -424,6 +436,9 @@ class Client extends node_events_1.default {
|
|
424
436
|
? this.util.toSnakeCase(options.data.components)
|
425
437
|
: undefined,
|
426
438
|
attachments: options.data?.attachments?.map((attachment) => this.util.toSnakeCase(attachment)),
|
439
|
+
poll: options.data?.poll !== undefined
|
440
|
+
? this.util.toSnakeCase(options.data?.poll)
|
441
|
+
: undefined,
|
427
442
|
},
|
428
443
|
},
|
429
444
|
files: options.data?.files,
|
@@ -505,6 +520,9 @@ class Client extends node_events_1.default {
|
|
505
520
|
attachments: options.attachments?.map((attachment) => this.util.toSnakeCase(attachment)),
|
506
521
|
flags: options.flags,
|
507
522
|
enforce_nonce: options.enforceNonce,
|
523
|
+
poll: options.poll !== undefined
|
524
|
+
? this.util.toSnakeCase(options.poll)
|
525
|
+
: undefined,
|
508
526
|
},
|
509
527
|
files: options.files,
|
510
528
|
})
|
@@ -1226,6 +1244,12 @@ class Client extends node_events_1.default {
|
|
1226
1244
|
})
|
1227
1245
|
.then((response) => this.util.toCamelCase(response));
|
1228
1246
|
}
|
1247
|
+
/** https://discord.com/developers/docs/resources/poll#end-poll */
|
1248
|
+
endPoll(channelId, messageId) {
|
1249
|
+
return this.rest
|
1250
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(channelId, messageId))
|
1251
|
+
.then((response) => this.util.toCamelCase(response));
|
1252
|
+
}
|
1229
1253
|
/** https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
1230
1254
|
executeWebhook(webhookId, webhookToken, options) {
|
1231
1255
|
return this.rest
|
@@ -1253,6 +1277,10 @@ class Client extends node_events_1.default {
|
|
1253
1277
|
attachments: options.attachments?.map((attachment) => this.util.toSnakeCase(attachment)),
|
1254
1278
|
flags: options.flags,
|
1255
1279
|
thread_name: options.threadName,
|
1280
|
+
applied_tags: options.appliedTags,
|
1281
|
+
poll: options.poll !== undefined
|
1282
|
+
? this.util.toSnakeCase(options.poll)
|
1283
|
+
: undefined,
|
1256
1284
|
},
|
1257
1285
|
files: options.files,
|
1258
1286
|
query: {
|
@@ -1735,6 +1763,17 @@ class Client extends node_events_1.default {
|
|
1735
1763
|
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(channelId))
|
1736
1764
|
.then((response) => response.map((message) => this.util.toCamelCase(message)));
|
1737
1765
|
}
|
1766
|
+
/** https://discord.com/developers/docs/resources/poll#get-answer-voters */
|
1767
|
+
getPollAnswerVoters(channelId, messageId, answerId, options) {
|
1768
|
+
return this.rest
|
1769
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.pollAnswerVoters(channelId, messageId, answerId), {
|
1770
|
+
query: {
|
1771
|
+
after: options?.after,
|
1772
|
+
limit: options?.limit,
|
1773
|
+
},
|
1774
|
+
})
|
1775
|
+
.then((response) => this.util.toCamelCase(response));
|
1776
|
+
}
|
1738
1777
|
/** https://discord.com/developers/docs/monetization/skus#list-skus */
|
1739
1778
|
getSkus(applicationId) {
|
1740
1779
|
return this.rest
|
@@ -1923,4 +1962,3 @@ class Client extends node_events_1.default {
|
|
1923
1962
|
}
|
1924
1963
|
}
|
1925
1964
|
exports.Client = Client;
|
1926
|
-
//# sourceMappingURL=Client.js.map
|
package/dist/lib/constants.d.ts
CHANGED
@@ -76,6 +76,12 @@ export declare enum InteractionType {
|
|
76
76
|
ApplicationCommandAutocomplete = 4,
|
77
77
|
ModalSubmit = 5
|
78
78
|
}
|
79
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types */
|
80
|
+
export declare enum InterationContextTypes {
|
81
|
+
Guild = 0,
|
82
|
+
BotDM = 1,
|
83
|
+
PrivateChannel = 2
|
84
|
+
}
|
79
85
|
/** https://discord.com/developers/docs/interactions/message-components#component-object-component-types */
|
80
86
|
export declare enum ComponentTypes {
|
81
87
|
ActionRow = 1,
|
@@ -111,6 +117,11 @@ export declare enum TextInputStyles {
|
|
111
117
|
Short = 1,
|
112
118
|
Paragraph = 2
|
113
119
|
}
|
120
|
+
/** https://discord.com/developers/docs/resources/application#application-object-application-integration-types */
|
121
|
+
export declare enum ApplicationIntegrationTypes {
|
122
|
+
GuildInstall = 0,
|
123
|
+
UserInstall = 1
|
124
|
+
}
|
114
125
|
/** https://discord.com/developers/docs/resources/application#application-object-application-flags */
|
115
126
|
export declare enum ApplicationFlags {
|
116
127
|
ApplicationAutoModerationRuleCreateBadge = 64,
|
@@ -456,6 +467,10 @@ export declare enum InviteTargetTypes {
|
|
456
467
|
Stream = 1,
|
457
468
|
EmbeddedApplication = 2
|
458
469
|
}
|
470
|
+
/** https://discord.com/developers/docs/resources/poll#layout-type */
|
471
|
+
export declare enum LayoutType {
|
472
|
+
Default = 1
|
473
|
+
}
|
459
474
|
/** https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level */
|
460
475
|
export declare enum PrivacyLevel {
|
461
476
|
Public = 1,
|
@@ -558,9 +573,11 @@ export declare enum GatewayIntents {
|
|
558
573
|
GuildScheduledEvents = 65536,
|
559
574
|
AutoModerationConfiguration = 1048576,
|
560
575
|
AutoModerationActionExecution = 2097152,
|
561
|
-
|
576
|
+
GuildMessagePolls = 16777216,
|
577
|
+
DirectMessagePolls = 33554432,
|
578
|
+
AllNonPrivileged = 53575421,
|
562
579
|
AllPrivileged = 33026,
|
563
|
-
All =
|
580
|
+
All = 53608447
|
564
581
|
}
|
565
582
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types */
|
566
583
|
export declare enum StatusTypes {
|
@@ -638,7 +655,9 @@ export declare enum GatewayEvents {
|
|
638
655
|
UserUpdate = "userUpdate",
|
639
656
|
VoiceStateUpdate = "voiceStateUpdate",
|
640
657
|
VoiceServerUpdate = "voiceServerUpdate",
|
641
|
-
WebhooksUpdate = "webhooksUpdate"
|
658
|
+
WebhooksUpdate = "webhooksUpdate",
|
659
|
+
MessagePollVoteAdd = "messagePollVoteAdd",
|
660
|
+
MessagePollVoteRemove = "messagePollVoteRemove"
|
642
661
|
}
|
643
662
|
/** https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types */
|
644
663
|
export declare enum ActivityType {
|
@@ -971,7 +990,15 @@ export declare enum JSONErrorCodes {
|
|
971
990
|
WebhookServicesCannotBeUsedInForumChannels = 220004,
|
972
991
|
MessageBlockedByHarmfulLinksFilter = 240000,
|
973
992
|
CannotEnableOnboardingRequirementsAreNotMet = 350000,
|
974
|
-
CannotUpdateOnboardingWhileBelowRequirements = 350001
|
993
|
+
CannotUpdateOnboardingWhileBelowRequirements = 350001,
|
994
|
+
FailedToBanUsers = 500000,
|
995
|
+
PollVotingBlocked = 520000,
|
996
|
+
PollExpired = 520001,
|
997
|
+
InvalidChannelTypeForPollCreation = 520002,
|
998
|
+
CannotEditAPollMessage = 520003,
|
999
|
+
CannotUseAnEmojiIncludedWithThePoll = 520004,
|
1000
|
+
CannotExpireANonPollMessage = 520006,
|
1001
|
+
PollIsAlreadyExpired = 520007
|
975
1002
|
}
|
976
1003
|
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes */
|
977
1004
|
export declare enum RPCErrorCodes {
|
@@ -1050,6 +1077,7 @@ export declare const BitwisePermissionFlags: {
|
|
1050
1077
|
readonly CreateEvents: bigint;
|
1051
1078
|
readonly UseExternalSounds: bigint;
|
1052
1079
|
readonly SendVoiceMessages: bigint;
|
1080
|
+
readonly SendPolls: bigint;
|
1053
1081
|
};
|
1054
1082
|
/** https://discord.com/developers/docs/topics/permissions#role-object-role-flags */
|
1055
1083
|
export declare enum RoleFlags {
|
package/dist/lib/constants.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
exports.EntitlementTypes = exports.SkuFlags = exports.SkuTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.VisibilityTypes = exports.Services = void 0;
|
3
|
+
exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.InviteTargetTypes = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ApplicationFlags = exports.ApplicationIntegrationTypes = exports.TextInputStyles = exports.ButtonStyles = exports.InteractionCallbackType = exports.ComponentTypes = exports.InterationContextTypes = exports.InteractionType = exports.ApplicationCommandPermissionType = exports.ApplicationCommandOptionType = exports.ApplicationCommandTypes = exports.Locales = exports.ImageFormats = void 0;
|
4
|
+
exports.EntitlementTypes = exports.SkuFlags = exports.SkuTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = void 0;
|
5
5
|
/** https://discord.com/developers/docs/reference#image-formatting-image-formats */
|
6
6
|
var ImageFormats;
|
7
7
|
(function (ImageFormats) {
|
@@ -86,6 +86,13 @@ var InteractionType;
|
|
86
86
|
InteractionType[InteractionType["ApplicationCommandAutocomplete"] = 4] = "ApplicationCommandAutocomplete";
|
87
87
|
InteractionType[InteractionType["ModalSubmit"] = 5] = "ModalSubmit";
|
88
88
|
})(InteractionType || (exports.InteractionType = InteractionType = {}));
|
89
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types */
|
90
|
+
var InterationContextTypes;
|
91
|
+
(function (InterationContextTypes) {
|
92
|
+
InterationContextTypes[InterationContextTypes["Guild"] = 0] = "Guild";
|
93
|
+
InterationContextTypes[InterationContextTypes["BotDM"] = 1] = "BotDM";
|
94
|
+
InterationContextTypes[InterationContextTypes["PrivateChannel"] = 2] = "PrivateChannel";
|
95
|
+
})(InterationContextTypes || (exports.InterationContextTypes = InterationContextTypes = {}));
|
89
96
|
/** https://discord.com/developers/docs/interactions/message-components#component-object-component-types */
|
90
97
|
var ComponentTypes;
|
91
98
|
(function (ComponentTypes) {
|
@@ -125,6 +132,12 @@ var TextInputStyles;
|
|
125
132
|
TextInputStyles[TextInputStyles["Short"] = 1] = "Short";
|
126
133
|
TextInputStyles[TextInputStyles["Paragraph"] = 2] = "Paragraph";
|
127
134
|
})(TextInputStyles || (exports.TextInputStyles = TextInputStyles = {}));
|
135
|
+
/** https://discord.com/developers/docs/resources/application#application-object-application-integration-types */
|
136
|
+
var ApplicationIntegrationTypes;
|
137
|
+
(function (ApplicationIntegrationTypes) {
|
138
|
+
ApplicationIntegrationTypes[ApplicationIntegrationTypes["GuildInstall"] = 0] = "GuildInstall";
|
139
|
+
ApplicationIntegrationTypes[ApplicationIntegrationTypes["UserInstall"] = 1] = "UserInstall";
|
140
|
+
})(ApplicationIntegrationTypes || (exports.ApplicationIntegrationTypes = ApplicationIntegrationTypes = {}));
|
128
141
|
/** https://discord.com/developers/docs/resources/application#application-object-application-flags */
|
129
142
|
var ApplicationFlags;
|
130
143
|
(function (ApplicationFlags) {
|
@@ -505,6 +518,11 @@ var InviteTargetTypes;
|
|
505
518
|
InviteTargetTypes[InviteTargetTypes["Stream"] = 1] = "Stream";
|
506
519
|
InviteTargetTypes[InviteTargetTypes["EmbeddedApplication"] = 2] = "EmbeddedApplication";
|
507
520
|
})(InviteTargetTypes || (exports.InviteTargetTypes = InviteTargetTypes = {}));
|
521
|
+
/** https://discord.com/developers/docs/resources/poll#layout-type */
|
522
|
+
var LayoutType;
|
523
|
+
(function (LayoutType) {
|
524
|
+
LayoutType[LayoutType["Default"] = 1] = "Default";
|
525
|
+
})(LayoutType || (exports.LayoutType = LayoutType = {}));
|
508
526
|
/** https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level */
|
509
527
|
var PrivacyLevel;
|
510
528
|
(function (PrivacyLevel) {
|
@@ -617,9 +635,11 @@ var GatewayIntents;
|
|
617
635
|
GatewayIntents[GatewayIntents["GuildScheduledEvents"] = 65536] = "GuildScheduledEvents";
|
618
636
|
GatewayIntents[GatewayIntents["AutoModerationConfiguration"] = 1048576] = "AutoModerationConfiguration";
|
619
637
|
GatewayIntents[GatewayIntents["AutoModerationActionExecution"] = 2097152] = "AutoModerationActionExecution";
|
620
|
-
GatewayIntents[GatewayIntents["
|
638
|
+
GatewayIntents[GatewayIntents["GuildMessagePolls"] = 16777216] = "GuildMessagePolls";
|
639
|
+
GatewayIntents[GatewayIntents["DirectMessagePolls"] = 33554432] = "DirectMessagePolls";
|
640
|
+
GatewayIntents[GatewayIntents["AllNonPrivileged"] = 53575421] = "AllNonPrivileged";
|
621
641
|
GatewayIntents[GatewayIntents["AllPrivileged"] = 33026] = "AllPrivileged";
|
622
|
-
GatewayIntents[GatewayIntents["All"] =
|
642
|
+
GatewayIntents[GatewayIntents["All"] = 53608447] = "All";
|
623
643
|
})(GatewayIntents || (exports.GatewayIntents = GatewayIntents = {}));
|
624
644
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types */
|
625
645
|
var StatusTypes;
|
@@ -700,6 +720,8 @@ var GatewayEvents;
|
|
700
720
|
GatewayEvents["VoiceStateUpdate"] = "voiceStateUpdate";
|
701
721
|
GatewayEvents["VoiceServerUpdate"] = "voiceServerUpdate";
|
702
722
|
GatewayEvents["WebhooksUpdate"] = "webhooksUpdate";
|
723
|
+
GatewayEvents["MessagePollVoteAdd"] = "messagePollVoteAdd";
|
724
|
+
GatewayEvents["MessagePollVoteRemove"] = "messagePollVoteRemove";
|
703
725
|
})(GatewayEvents || (exports.GatewayEvents = GatewayEvents = {}));
|
704
726
|
/** https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types */
|
705
727
|
var ActivityType;
|
@@ -1042,6 +1064,14 @@ var JSONErrorCodes;
|
|
1042
1064
|
JSONErrorCodes[JSONErrorCodes["MessageBlockedByHarmfulLinksFilter"] = 240000] = "MessageBlockedByHarmfulLinksFilter";
|
1043
1065
|
JSONErrorCodes[JSONErrorCodes["CannotEnableOnboardingRequirementsAreNotMet"] = 350000] = "CannotEnableOnboardingRequirementsAreNotMet";
|
1044
1066
|
JSONErrorCodes[JSONErrorCodes["CannotUpdateOnboardingWhileBelowRequirements"] = 350001] = "CannotUpdateOnboardingWhileBelowRequirements";
|
1067
|
+
JSONErrorCodes[JSONErrorCodes["FailedToBanUsers"] = 500000] = "FailedToBanUsers";
|
1068
|
+
JSONErrorCodes[JSONErrorCodes["PollVotingBlocked"] = 520000] = "PollVotingBlocked";
|
1069
|
+
JSONErrorCodes[JSONErrorCodes["PollExpired"] = 520001] = "PollExpired";
|
1070
|
+
JSONErrorCodes[JSONErrorCodes["InvalidChannelTypeForPollCreation"] = 520002] = "InvalidChannelTypeForPollCreation";
|
1071
|
+
JSONErrorCodes[JSONErrorCodes["CannotEditAPollMessage"] = 520003] = "CannotEditAPollMessage";
|
1072
|
+
JSONErrorCodes[JSONErrorCodes["CannotUseAnEmojiIncludedWithThePoll"] = 520004] = "CannotUseAnEmojiIncludedWithThePoll";
|
1073
|
+
JSONErrorCodes[JSONErrorCodes["CannotExpireANonPollMessage"] = 520006] = "CannotExpireANonPollMessage";
|
1074
|
+
JSONErrorCodes[JSONErrorCodes["PollIsAlreadyExpired"] = 520007] = "PollIsAlreadyExpired";
|
1045
1075
|
})(JSONErrorCodes || (exports.JSONErrorCodes = JSONErrorCodes = {}));
|
1046
1076
|
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes */
|
1047
1077
|
var RPCErrorCodes;
|
@@ -1122,6 +1152,7 @@ exports.BitwisePermissionFlags = {
|
|
1122
1152
|
CreateEvents: 1n << 44n,
|
1123
1153
|
UseExternalSounds: 1n << 45n,
|
1124
1154
|
SendVoiceMessages: 1n << 46n,
|
1155
|
+
SendPolls: 1n << 49n,
|
1125
1156
|
};
|
1126
1157
|
/** https://discord.com/developers/docs/topics/permissions#role-object-role-flags */
|
1127
1158
|
var RoleFlags;
|
@@ -1160,4 +1191,3 @@ var EntitlementTypes;
|
|
1160
1191
|
(function (EntitlementTypes) {
|
1161
1192
|
EntitlementTypes[EntitlementTypes["ApplicationSubscription"] = 8] = "ApplicationSubscription";
|
1162
1193
|
})(EntitlementTypes || (exports.EntitlementTypes = EntitlementTypes = {}));
|
1163
|
-
//# sourceMappingURL=constants.js.map
|
@@ -311,6 +311,12 @@ class Shard {
|
|
311
311
|
case "WEBHOOKS_UPDATE":
|
312
312
|
this.client.emit(constants_1.GatewayEvents.WebhooksUpdate, packet.d.channel_id, packet.d.guild_id);
|
313
313
|
break;
|
314
|
+
case "MESSAGE_POLL_VOTE_ADD":
|
315
|
+
this.client.emit(constants_1.GatewayEvents.MessagePollVoteAdd, this.client.util.toCamelCase(packet.d));
|
316
|
+
break;
|
317
|
+
case "MESSAGE_POLL_VOTE_REMOVE":
|
318
|
+
this.client.emit(constants_1.GatewayEvents.MessagePollVoteRemove, this.client.util.toCamelCase(packet.d));
|
319
|
+
break;
|
314
320
|
}
|
315
321
|
}
|
316
322
|
onWebSocketError(err) {
|
@@ -323,4 +329,3 @@ class Shard {
|
|
323
329
|
}
|
324
330
|
}
|
325
331
|
exports.Shard = Shard;
|
326
|
-
//# sourceMappingURL=Shard.js.map
|
@@ -16,4 +16,3 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./Shard"), exports);
|
18
18
|
__exportStar(require("./ShardManager"), exports);
|
19
|
-
//# sourceMappingURL=index.js.map
|
package/dist/lib/index.js
CHANGED
package/dist/lib/rest/CDN.js
CHANGED
@@ -43,4 +43,3 @@ const userAvatarDecoration = (userId, avatarDecoration) => `https://cdn.discorda
|
|
43
43
|
exports.userAvatarDecoration = userAvatarDecoration;
|
44
44
|
const userBanner = (userId, banner) => `https://cdn.discordapp.com/banners/${userId}/${banner}.png`;
|
45
45
|
exports.userBanner = userBanner;
|
46
|
-
//# sourceMappingURL=CDN.js.map
|
@@ -1,3 +1,4 @@
|
|
1
|
+
export declare const bulkGuildBan: (guildId: string) => `guilds/${string}/bulk-ban`;
|
1
2
|
export declare const guild: (guildId: string) => `guilds/${string}`;
|
2
3
|
export declare const guilds: () => "guilds";
|
3
4
|
export declare const guildActiveThreads: (guildId: string) => `guilds/${string}/threads/active`;
|
@@ -53,11 +54,13 @@ export declare const channelPermission: (channelId: string, overwriteId: string)
|
|
53
54
|
export declare const channelPin: (channelId: string, messageId: string) => `channels/${string}/pins/${string}`;
|
54
55
|
export declare const channelPins: (channelId: string) => `channels/${string}/pins`;
|
55
56
|
export declare const channelRecipient: (channelId: string, userId: string) => `channels/${string}/recipients/${string}`;
|
56
|
-
export declare const channelThreads: (channelId: string, archivedStatus: "public" | "private", joined: boolean) => `channels/${string}/threads/archived/
|
57
|
+
export declare const channelThreads: (channelId: string, archivedStatus: "public" | "private", joined: boolean) => `channels/${string}/threads/archived/private` | `channels/${string}/threads/archived/public`;
|
57
58
|
export declare const channelTyping: (channelId: string) => `channels/${string}/typing`;
|
58
59
|
export declare const channelWebhooks: (channelId: string) => `channels/${string}/webhooks`;
|
59
60
|
export declare const threads: (channelId: string, messageId?: string) => `channels/${string}/threads`;
|
60
61
|
export declare const threadMembers: (threadId: string, userId?: string | "@me") => `channels/${string}/thread-members` | `channels/${string}/thread-members/${string}`;
|
62
|
+
export declare const pollAnswerVoters: (channelId: string, messageId: string, answerId: string) => `channels/${string}/polls/${string}/answers/${string}`;
|
63
|
+
export declare const pollExpire: (channelId: string, messageId: string) => `channels/${string}/polls/${string}/expire`;
|
61
64
|
export declare const user: (userId?: string | "@me") => `users/${string}`;
|
62
65
|
export declare const userApplicationRoleConnection: (applicationId: string) => `users/@me/applications/${string}/role-connection`;
|
63
66
|
export declare const userChannels: () => "users/@me/channels";
|
@@ -1,8 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
exports.voiceRegions = exports.stickerPacks = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2CurrentAuthorization = exports.oauth2CurrentApplication = exports.oauth2Authorization = exports.gatewayBot = exports.gateway = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSkus = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlement = exports.applicationCurrentUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = void 0;
|
3
|
+
exports.channelMessageCrosspost = exports.channelMessageAllReactions = exports.channelMessage = exports.channelInvites = exports.channelFollowers = exports.channelBulkDelete = exports.channel = exports.template = exports.guildWidgetSettings = exports.guildWidgetJSON = exports.guildWidgetImage = exports.guildWelcomeScreen = exports.guildWebhooks = exports.guildVoiceState = exports.guildVoiceRegions = exports.guildVanityUrl = exports.guildTemplates = exports.guildTemplate = exports.guildStickers = exports.guildSticker = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildEmojis = exports.guildEmoji = exports.guildCurrentMemberNickname = exports.guildChannels = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = exports.bulkGuildBan = void 0;
|
4
|
+
exports.voiceRegions = exports.stickerPacks = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2CurrentAuthorization = exports.oauth2CurrentApplication = exports.oauth2Authorization = exports.gatewayBot = exports.gateway = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSkus = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlement = exports.applicationCurrentUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.pollExpire = exports.pollAnswerVoters = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = exports.channelMessageReaction = void 0;
|
5
5
|
// Guilds
|
6
|
+
const bulkGuildBan = (guildId) => `guilds/${guildId}/bulk-ban`;
|
7
|
+
exports.bulkGuildBan = bulkGuildBan;
|
6
8
|
const guild = (guildId) => `guilds/${guildId}`;
|
7
9
|
exports.guild = guild;
|
8
10
|
const guilds = () => "guilds";
|
@@ -132,6 +134,10 @@ const threadMembers = (threadId, userId) => userId
|
|
132
134
|
? `channels/${threadId}/thread-members`
|
133
135
|
: `channels/${threadId}/thread-members/${userId}`;
|
134
136
|
exports.threadMembers = threadMembers;
|
137
|
+
const pollAnswerVoters = (channelId, messageId, answerId) => `channels/${channelId}/polls/${messageId}/answers/${answerId}`;
|
138
|
+
exports.pollAnswerVoters = pollAnswerVoters;
|
139
|
+
const pollExpire = (channelId, messageId) => `channels/${channelId}/polls/${messageId}/expire`;
|
140
|
+
exports.pollExpire = pollExpire;
|
135
141
|
// Users
|
136
142
|
const user = (userId = "@me") => `users/${userId}`;
|
137
143
|
exports.user = user;
|
@@ -208,4 +214,3 @@ const stickerPacks = () => "sticker-packs";
|
|
208
214
|
exports.stickerPacks = stickerPacks;
|
209
215
|
const voiceRegions = () => "voice/regions";
|
210
216
|
exports.voiceRegions = voiceRegions;
|
211
|
-
//# sourceMappingURL=Endpoints.js.map
|
package/dist/lib/rest/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { LocaleMap } from ".";
|
2
|
-
import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType } from "../constants";
|
2
|
+
import type { ApplicationCommandTypes, ApplicationCommandOptionType, ChannelTypes, ApplicationCommandPermissionType, ApplicationIntegrationTypes, InterationContextTypes } from "../constants";
|
3
3
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure */
|
4
4
|
export interface RawApplicationCommand {
|
5
5
|
id: string;
|
@@ -14,6 +14,8 @@ export interface RawApplicationCommand {
|
|
14
14
|
default_member_permissions: string | null;
|
15
15
|
dm_permission?: boolean;
|
16
16
|
default_permission?: boolean | null;
|
17
|
+
integration_types?: Array<ApplicationIntegrationTypes>;
|
18
|
+
contexts?: Array<InterationContextTypes>;
|
17
19
|
nsfw?: boolean;
|
18
20
|
version: string;
|
19
21
|
}
|
@@ -66,6 +68,8 @@ export interface ApplicationCommand {
|
|
66
68
|
defaultMemberPermissions: string | null;
|
67
69
|
dmPermission?: boolean;
|
68
70
|
defaultPermission?: boolean | null;
|
71
|
+
integrationTypes?: Array<ApplicationIntegrationTypes>;
|
72
|
+
contexts?: Array<InterationContextTypes>;
|
69
73
|
nsfw?: boolean;
|
70
74
|
version: string;
|
71
75
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { RawUser, RawTeam, Team, User, RawGuild, Guild } from ".";
|
2
|
-
import type { ApplicationFlags, OAuth2Scopes } from "../constants";
|
2
|
+
import type { ApplicationFlags, ApplicationIntegrationTypes, OAuth2Scopes } from "../constants";
|
3
3
|
/** https://discord.com/developers/docs/resources/application#application-object-application-structure */
|
4
4
|
export interface RawApplication {
|
5
5
|
id: string;
|
@@ -26,8 +26,13 @@ export interface RawApplication {
|
|
26
26
|
role_connections_verification_url?: string;
|
27
27
|
tags?: Array<string>;
|
28
28
|
install_params?: RawInstallParams;
|
29
|
+
integration_types_config?: Record<ApplicationIntegrationTypes, RawApplicationIntegrationTypeConfiguration>;
|
29
30
|
custom_install_url?: string;
|
30
31
|
}
|
32
|
+
/** https://discord.com/developers/docs/resources/application#application-object-application-integration-type-configuration-object */
|
33
|
+
export interface RawApplicationIntegrationTypeConfiguration {
|
34
|
+
oauth2_install_params: RawInstallParams;
|
35
|
+
}
|
31
36
|
/** https://discord.com/developers/docs/resources/application#install-params-object-install-params-structure */
|
32
37
|
export interface RawInstallParams {
|
33
38
|
scopes: Array<OAuth2Scopes>;
|
@@ -58,8 +63,12 @@ export interface Application {
|
|
58
63
|
roleConnectionsVerificationUrl?: string;
|
59
64
|
tags?: Array<string>;
|
60
65
|
installParams?: InstallParams;
|
66
|
+
integrationTypesConfig?: Record<ApplicationIntegrationTypes, ApplicationIntegrationTypeConfiguration>;
|
61
67
|
customInstallUrl?: string;
|
62
68
|
}
|
69
|
+
export interface ApplicationIntegrationTypeConfiguration {
|
70
|
+
oauth2InstallParams: InstallParams;
|
71
|
+
}
|
63
72
|
export interface InstallParams {
|
64
73
|
scopes: Array<OAuth2Scopes>;
|
65
74
|
permissions: string;
|
@@ -69,6 +78,7 @@ export interface EditCurrentApplicationParams {
|
|
69
78
|
description?: string;
|
70
79
|
roleConnectionsVerificationUrl?: string;
|
71
80
|
installParams?: InstallParams;
|
81
|
+
integrationTypesConfig?: Record<ApplicationIntegrationTypes, ApplicationIntegrationTypeConfiguration>;
|
72
82
|
flags?: ApplicationFlags;
|
73
83
|
icon?: string;
|
74
84
|
coverImage?: string;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { AllowedMentionTypes, AttachmentFlags, ChannelFlags, ChannelTypes, ForumLayoutTypes, InviteTargetTypes, MessageActivityTypes, MessageFlags, MessageTypes, SortOrderTypes, VideoQualityModes } from "../constants";
|
2
|
-
import type { RawApplication, RawGuildMember, RawUser, RawEmoji, RawSticker, RawStickerItem, RawMessageInteraction, MessageInteraction, StickerItem, Sticker, Emoji, User, Application, GuildMember, RawActionRow, ActionRow, RawResolvedData, ResolvedData } from ".";
|
2
|
+
import type { RawApplication, RawGuildMember, RawUser, RawEmoji, RawSticker, RawStickerItem, RawMessageInteraction, MessageInteraction, StickerItem, Sticker, Emoji, User, Application, GuildMember, RawActionRow, ActionRow, RawResolvedData, ResolvedData, RawPollCreateParams, PollCreateParams } from ".";
|
3
3
|
import type { File } from "../rest";
|
4
4
|
/** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */
|
5
5
|
export interface RawChannel {
|
@@ -73,6 +73,7 @@ export interface RawMessage {
|
|
73
73
|
position?: number;
|
74
74
|
role_subscription_data?: RawRoleSubscriptionData;
|
75
75
|
resolved?: RawResolvedData;
|
76
|
+
poll?: RawPollCreateParams;
|
76
77
|
}
|
77
78
|
/** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */
|
78
79
|
export interface RawMessageActivity {
|
@@ -310,6 +311,7 @@ export interface Message {
|
|
310
311
|
position?: number;
|
311
312
|
roleSubscriptionData?: RoleSubscriptionData;
|
312
313
|
resolved?: ResolvedData;
|
314
|
+
poll?: PollCreateParams;
|
313
315
|
}
|
314
316
|
export interface MessageActivity {
|
315
317
|
type: MessageActivityTypes;
|
@@ -495,6 +497,7 @@ export interface CreateMessageParams {
|
|
495
497
|
attachments?: Array<Attachment>;
|
496
498
|
flags?: MessageFlags;
|
497
499
|
enforceNonce?: boolean;
|
500
|
+
poll?: PollCreateParams;
|
498
501
|
}
|
499
502
|
export interface EditMessageParams {
|
500
503
|
content?: string | null;
|
package/dist/lib/types/emoji.js
CHANGED