disgroove 2.0.1 → 2.1.0-dev.118f285
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 +16 -4
- package/dist/lib/Client.js +38 -2
- package/dist/lib/constants.d.ts +26 -2
- package/dist/lib/constants.js +29 -3
- 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 +28 -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 +66 -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 */
|
@@ -258,6 +261,7 @@ export declare class Client extends EventEmitter {
|
|
258
261
|
threadId?: string;
|
259
262
|
wait?: boolean;
|
260
263
|
}): Promise<Message | null>;
|
264
|
+
expirePoll(channelId: string, messageId: string): Promise<Message>;
|
261
265
|
/** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
|
262
266
|
followChannel(channelId: string, options: {
|
263
267
|
webhookChannelId: string;
|
@@ -475,6 +479,12 @@ export declare class Client extends EventEmitter {
|
|
475
479
|
}>;
|
476
480
|
/** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
|
477
481
|
getPinnedMessages(channelId: string): Promise<Array<Message>>;
|
482
|
+
getPollAnswerVoters(channelId: string, messageId: string, answerId: string, options?: {
|
483
|
+
after?: string;
|
484
|
+
limit?: number;
|
485
|
+
}): Promise<{
|
486
|
+
users: Array<User>;
|
487
|
+
}>;
|
478
488
|
/** https://discord.com/developers/docs/monetization/skus#list-skus */
|
479
489
|
getSkus(applicationId: string): Promise<Array<Sku>>;
|
480
490
|
/** https://discord.com/developers/docs/resources/stage-instance#get-stage-instance */
|
@@ -657,4 +667,6 @@ export interface ClientEvents {
|
|
657
667
|
voiceStateUpdate: [voiceState: VoiceState];
|
658
668
|
voiceServerUpdate: [voiceServer: VoiceServerUpdateEventFields];
|
659
669
|
webhooksUpdate: [channelId: string, guildId: string];
|
670
|
+
messagePollVoteAdd: [vote: MessagePollVoteAddFields];
|
671
|
+
messagePollVoteRemove: [vote: MessagePollVoteRemoveFields];
|
660
672
|
}
|
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
|
})
|
@@ -1253,6 +1271,10 @@ class Client extends node_events_1.default {
|
|
1253
1271
|
attachments: options.attachments?.map((attachment) => this.util.toSnakeCase(attachment)),
|
1254
1272
|
flags: options.flags,
|
1255
1273
|
thread_name: options.threadName,
|
1274
|
+
applied_tags: options.appliedTags,
|
1275
|
+
poll: options.poll !== undefined
|
1276
|
+
? this.util.toSnakeCase(options.poll)
|
1277
|
+
: undefined,
|
1256
1278
|
},
|
1257
1279
|
files: options.files,
|
1258
1280
|
query: {
|
@@ -1278,6 +1300,11 @@ class Client extends node_events_1.default {
|
|
1278
1300
|
})
|
1279
1301
|
.then((response) => response !== null ? this.util.toCamelCase(response) : null);
|
1280
1302
|
}
|
1303
|
+
expirePoll(channelId, messageId) {
|
1304
|
+
return this.rest
|
1305
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(channelId, messageId))
|
1306
|
+
.then((response) => this.util.toCamelCase(response));
|
1307
|
+
}
|
1281
1308
|
/** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
|
1282
1309
|
followChannel(channelId, options) {
|
1283
1310
|
return this.rest
|
@@ -1735,6 +1762,16 @@ class Client extends node_events_1.default {
|
|
1735
1762
|
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(channelId))
|
1736
1763
|
.then((response) => response.map((message) => this.util.toCamelCase(message)));
|
1737
1764
|
}
|
1765
|
+
getPollAnswerVoters(channelId, messageId, answerId, options) {
|
1766
|
+
return this.rest
|
1767
|
+
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.pollAnswerVoters(channelId, messageId, answerId), {
|
1768
|
+
query: {
|
1769
|
+
after: options?.after,
|
1770
|
+
limit: options?.limit,
|
1771
|
+
},
|
1772
|
+
})
|
1773
|
+
.then((response) => this.util.toCamelCase(response));
|
1774
|
+
}
|
1738
1775
|
/** https://discord.com/developers/docs/monetization/skus#list-skus */
|
1739
1776
|
getSkus(applicationId) {
|
1740
1777
|
return this.rest
|
@@ -1923,4 +1960,3 @@ class Client extends node_events_1.default {
|
|
1923
1960
|
}
|
1924
1961
|
}
|
1925
1962
|
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,9 @@ export declare enum InviteTargetTypes {
|
|
456
467
|
Stream = 1,
|
457
468
|
EmbeddedApplication = 2
|
458
469
|
}
|
470
|
+
export declare enum LayoutType {
|
471
|
+
Default = 1
|
472
|
+
}
|
459
473
|
/** https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level */
|
460
474
|
export declare enum PrivacyLevel {
|
461
475
|
Public = 1,
|
@@ -638,7 +652,9 @@ export declare enum GatewayEvents {
|
|
638
652
|
UserUpdate = "userUpdate",
|
639
653
|
VoiceStateUpdate = "voiceStateUpdate",
|
640
654
|
VoiceServerUpdate = "voiceServerUpdate",
|
641
|
-
WebhooksUpdate = "webhooksUpdate"
|
655
|
+
WebhooksUpdate = "webhooksUpdate",
|
656
|
+
MessagePollVoteAdd = "messagePollVoteAdd",
|
657
|
+
MessagePollVoteRemove = "messagePollVoteRemove"
|
642
658
|
}
|
643
659
|
/** https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types */
|
644
660
|
export declare enum ActivityType {
|
@@ -971,7 +987,15 @@ export declare enum JSONErrorCodes {
|
|
971
987
|
WebhookServicesCannotBeUsedInForumChannels = 220004,
|
972
988
|
MessageBlockedByHarmfulLinksFilter = 240000,
|
973
989
|
CannotEnableOnboardingRequirementsAreNotMet = 350000,
|
974
|
-
CannotUpdateOnboardingWhileBelowRequirements = 350001
|
990
|
+
CannotUpdateOnboardingWhileBelowRequirements = 350001,
|
991
|
+
FailedToBanUsers = 500000,
|
992
|
+
PollVotingBlocked = 520000,
|
993
|
+
PollExpired = 520001,
|
994
|
+
InvalidChannelTypeForPollCreation = 520002,
|
995
|
+
CannotEditAPollMessage = 520003,
|
996
|
+
CannotUseAnEmojiIncludedWithThePoll = 520004,
|
997
|
+
CannotExpireANonPollMessage = 520006,
|
998
|
+
PollIsAlreadyExpired = 520007
|
975
999
|
}
|
976
1000
|
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes */
|
977
1001
|
export declare enum RPCErrorCodes {
|
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,10 @@ var InviteTargetTypes;
|
|
505
518
|
InviteTargetTypes[InviteTargetTypes["Stream"] = 1] = "Stream";
|
506
519
|
InviteTargetTypes[InviteTargetTypes["EmbeddedApplication"] = 2] = "EmbeddedApplication";
|
507
520
|
})(InviteTargetTypes || (exports.InviteTargetTypes = InviteTargetTypes = {}));
|
521
|
+
var LayoutType;
|
522
|
+
(function (LayoutType) {
|
523
|
+
LayoutType[LayoutType["Default"] = 1] = "Default";
|
524
|
+
})(LayoutType || (exports.LayoutType = LayoutType = {}));
|
508
525
|
/** https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level */
|
509
526
|
var PrivacyLevel;
|
510
527
|
(function (PrivacyLevel) {
|
@@ -700,6 +717,8 @@ var GatewayEvents;
|
|
700
717
|
GatewayEvents["VoiceStateUpdate"] = "voiceStateUpdate";
|
701
718
|
GatewayEvents["VoiceServerUpdate"] = "voiceServerUpdate";
|
702
719
|
GatewayEvents["WebhooksUpdate"] = "webhooksUpdate";
|
720
|
+
GatewayEvents["MessagePollVoteAdd"] = "messagePollVoteAdd";
|
721
|
+
GatewayEvents["MessagePollVoteRemove"] = "messagePollVoteRemove";
|
703
722
|
})(GatewayEvents || (exports.GatewayEvents = GatewayEvents = {}));
|
704
723
|
/** https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types */
|
705
724
|
var ActivityType;
|
@@ -1042,6 +1061,14 @@ var JSONErrorCodes;
|
|
1042
1061
|
JSONErrorCodes[JSONErrorCodes["MessageBlockedByHarmfulLinksFilter"] = 240000] = "MessageBlockedByHarmfulLinksFilter";
|
1043
1062
|
JSONErrorCodes[JSONErrorCodes["CannotEnableOnboardingRequirementsAreNotMet"] = 350000] = "CannotEnableOnboardingRequirementsAreNotMet";
|
1044
1063
|
JSONErrorCodes[JSONErrorCodes["CannotUpdateOnboardingWhileBelowRequirements"] = 350001] = "CannotUpdateOnboardingWhileBelowRequirements";
|
1064
|
+
JSONErrorCodes[JSONErrorCodes["FailedToBanUsers"] = 500000] = "FailedToBanUsers";
|
1065
|
+
JSONErrorCodes[JSONErrorCodes["PollVotingBlocked"] = 520000] = "PollVotingBlocked";
|
1066
|
+
JSONErrorCodes[JSONErrorCodes["PollExpired"] = 520001] = "PollExpired";
|
1067
|
+
JSONErrorCodes[JSONErrorCodes["InvalidChannelTypeForPollCreation"] = 520002] = "InvalidChannelTypeForPollCreation";
|
1068
|
+
JSONErrorCodes[JSONErrorCodes["CannotEditAPollMessage"] = 520003] = "CannotEditAPollMessage";
|
1069
|
+
JSONErrorCodes[JSONErrorCodes["CannotUseAnEmojiIncludedWithThePoll"] = 520004] = "CannotUseAnEmojiIncludedWithThePoll";
|
1070
|
+
JSONErrorCodes[JSONErrorCodes["CannotExpireANonPollMessage"] = 520006] = "CannotExpireANonPollMessage";
|
1071
|
+
JSONErrorCodes[JSONErrorCodes["PollIsAlreadyExpired"] = 520007] = "PollIsAlreadyExpired";
|
1045
1072
|
})(JSONErrorCodes || (exports.JSONErrorCodes = JSONErrorCodes = {}));
|
1046
1073
|
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes */
|
1047
1074
|
var RPCErrorCodes;
|
@@ -1160,4 +1187,3 @@ var EntitlementTypes;
|
|
1160
1187
|
(function (EntitlementTypes) {
|
1161
1188
|
EntitlementTypes[EntitlementTypes["ApplicationSubscription"] = 8] = "ApplicationSubscription";
|
1162
1189
|
})(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
@@ -257,6 +257,20 @@ export interface RawVoiceServerUpdateEventFields {
|
|
257
257
|
guild_id: string;
|
258
258
|
endpoint: string | null;
|
259
259
|
}
|
260
|
+
export interface RawMessagePollVoteAddFields {
|
261
|
+
user_id: string;
|
262
|
+
channel_id: string;
|
263
|
+
message_id: string;
|
264
|
+
guild_id?: string;
|
265
|
+
answer_id: number;
|
266
|
+
}
|
267
|
+
export interface RawMessagePollVoteRemoveFields {
|
268
|
+
user_id: string;
|
269
|
+
channel_id: string;
|
270
|
+
message_id: string;
|
271
|
+
guild_id?: string;
|
272
|
+
answer_id: number;
|
273
|
+
}
|
260
274
|
export interface AutoModerationActionExecutionEventFields {
|
261
275
|
guildId: string;
|
262
276
|
action: AutoModerationAction;
|
@@ -479,3 +493,17 @@ export interface VoiceServerUpdateEventFields {
|
|
479
493
|
guildId: string;
|
480
494
|
endpoint: string | null;
|
481
495
|
}
|
496
|
+
export interface MessagePollVoteAddFields {
|
497
|
+
userId: string;
|
498
|
+
channelId: string;
|
499
|
+
messageId: string;
|
500
|
+
guildId?: string;
|
501
|
+
answerId: number;
|
502
|
+
}
|
503
|
+
export interface MessagePollVoteRemoveFields {
|
504
|
+
userId: string;
|
505
|
+
channelId: string;
|
506
|
+
messageId: string;
|
507
|
+
guildId?: string;
|
508
|
+
answerId: number;
|
509
|
+
}
|
@@ -433,6 +433,10 @@ export interface CreateGuildBanParams {
|
|
433
433
|
deleteMessageDays?: number;
|
434
434
|
deleteMessageSeconds?: number;
|
435
435
|
}
|
436
|
+
export interface BulkGuildBanParams {
|
437
|
+
userIds: Array<string>;
|
438
|
+
deleteMessageSeconds?: number;
|
439
|
+
}
|
436
440
|
export interface CreateGuildRoleParams {
|
437
441
|
name?: string;
|
438
442
|
permissions?: string;
|
package/dist/lib/types/guild.js
CHANGED