disgroove 2.1.0-dev.fb7987e → 2.1.1
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 +10 -4
- package/dist/lib/Client.js +24 -6
- package/dist/lib/constants.d.ts +22 -2
- package/dist/lib/constants.js +25 -4
- package/dist/lib/rest/Endpoints.d.ts +1 -0
- package/dist/lib/rest/Endpoints.js +3 -1
- package/dist/lib/types/application-command.d.ts +5 -1
- package/dist/lib/types/application.d.ts +1 -1
- package/dist/lib/types/channel.d.ts +35 -4
- package/dist/lib/types/gateway-events.d.ts +9 -0
- package/dist/lib/types/index.d.ts +1 -0
- package/dist/lib/types/index.js +1 -0
- package/dist/lib/types/interaction.d.ts +3 -4
- package/dist/lib/types/poll.d.ts +24 -4
- package/dist/lib/types/user.d.ts +1 -0
- package/dist/lib/types/webhook.d.ts +2 -3
- package/dist/package.json +4 -5
- package/package.json +4 -5
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, MessagePollVoteAddFields, MessagePollVoteRemoveFields, BulkGuildBanParams, BulkDeleteMessagesParams } 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, GuildAuditLogEntryCreateExtraFields } from "./types";
|
6
6
|
import EventEmitter from "node:events";
|
7
7
|
import { ShardManager } from "./gateway";
|
8
8
|
export interface ClientOptions {
|
@@ -51,6 +51,8 @@ export declare class Client extends EventEmitter {
|
|
51
51
|
bulkEditGuildApplicationCommands(applicationId: string, guildId: string, commands: BulkEditGuildApplicationCommandsParams): Promise<Array<ApplicationCommand>>;
|
52
52
|
/** https://discord.com/developers/docs/topics/gateway#connections */
|
53
53
|
connect(): Promise<void>;
|
54
|
+
/** https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement */
|
55
|
+
consumeEntitlement(applicationId: string, entitlementId: string): void;
|
54
56
|
/** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
|
55
57
|
createAutoModerationRule(guildId: string, options: CreateAutoModerationRuleParams, reason?: string): Promise<AutoModerationRule>;
|
56
58
|
/** https://discord.com/developers/docs/resources/guild#create-guild-channel */
|
@@ -247,6 +249,8 @@ export declare class Client extends EventEmitter {
|
|
247
249
|
}): Promise<Message>;
|
248
250
|
/** https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token */
|
249
251
|
editWebhookWithToken(webhookId: string, webhookToken: string, options: Omit<EditWebhookParams, "channelId">, reason?: string): Promise<Webhook>;
|
252
|
+
/** https://discord.com/developers/docs/resources/poll#end-poll */
|
253
|
+
endPoll(channelId: string, messageId: string): Promise<Message>;
|
250
254
|
/** https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
251
255
|
executeWebhook(webhookId: string, webhookToken: string, options: ExecuteWebhookParams & {
|
252
256
|
wait: boolean;
|
@@ -261,11 +265,10 @@ export declare class Client extends EventEmitter {
|
|
261
265
|
threadId?: string;
|
262
266
|
wait?: boolean;
|
263
267
|
}): Promise<Message | null>;
|
264
|
-
expirePoll(channelId: string, messageId: string): Promise<Message>;
|
265
268
|
/** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
|
266
269
|
followChannel(channelId: string, options: {
|
267
270
|
webhookChannelId: string;
|
268
|
-
}): Promise<FollowedChannel>;
|
271
|
+
}, reason?: string): Promise<FollowedChannel>;
|
269
272
|
/** https://discord.com/developers/docs/resources/guild#list-active-guild-threads */
|
270
273
|
getActiveGuildThreads(guildId: string): Promise<{
|
271
274
|
threads: Array<Channel>;
|
@@ -479,6 +482,7 @@ export declare class Client extends EventEmitter {
|
|
479
482
|
}>;
|
480
483
|
/** https://discord.com/developers/docs/resources/channel#get-pinned-messages */
|
481
484
|
getPinnedMessages(channelId: string): Promise<Array<Message>>;
|
485
|
+
/** https://discord.com/developers/docs/resources/poll#get-answer-voters */
|
482
486
|
getPollAnswerVoters(channelId: string, messageId: string, answerId: string, options?: {
|
483
487
|
after?: string;
|
484
488
|
limit?: number;
|
@@ -609,7 +613,9 @@ export interface ClientEvents {
|
|
609
613
|
];
|
610
614
|
guildUpdate: [guild: Guild];
|
611
615
|
guildDelete: [guild: UnavailableGuild];
|
612
|
-
guildAuditLogEntryCreate: [
|
616
|
+
guildAuditLogEntryCreate: [
|
617
|
+
auditLogEntry: AuditLogEntry & GuildAuditLogEntryCreateExtraFields
|
618
|
+
];
|
613
619
|
guildBanAdd: [ban: GuildBanAddEventFields];
|
614
620
|
guildBanRemove: [ban: GuildBanRemoveEventFields];
|
615
621
|
guildEmojisUpdate: [emojis: Array<Emoji>, guildId: string];
|
package/dist/lib/Client.js
CHANGED
@@ -131,6 +131,10 @@ class Client extends node_events_1.default {
|
|
131
131
|
this.shards.set(i, new gateway_1.Shard(i, this));
|
132
132
|
this.shards.connect();
|
133
133
|
}
|
134
|
+
/** https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement */
|
135
|
+
consumeEntitlement(applicationId, entitlementId) {
|
136
|
+
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.applicationEntitlementConsume(applicationId, entitlementId));
|
137
|
+
}
|
134
138
|
/** https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule */
|
135
139
|
createAutoModerationRule(guildId, options, reason) {
|
136
140
|
return this.rest
|
@@ -436,6 +440,9 @@ class Client extends node_events_1.default {
|
|
436
440
|
? this.util.toSnakeCase(options.data.components)
|
437
441
|
: undefined,
|
438
442
|
attachments: options.data?.attachments?.map((attachment) => this.util.toSnakeCase(attachment)),
|
443
|
+
poll: options.data?.poll !== undefined
|
444
|
+
? this.util.toSnakeCase(options.data?.poll)
|
445
|
+
: undefined,
|
439
446
|
},
|
440
447
|
},
|
441
448
|
files: options.data?.files,
|
@@ -517,6 +524,9 @@ class Client extends node_events_1.default {
|
|
517
524
|
attachments: options.attachments?.map((attachment) => this.util.toSnakeCase(attachment)),
|
518
525
|
flags: options.flags,
|
519
526
|
enforce_nonce: options.enforceNonce,
|
527
|
+
poll: options.poll !== undefined
|
528
|
+
? this.util.toSnakeCase(options.poll)
|
529
|
+
: undefined,
|
520
530
|
},
|
521
531
|
files: options.files,
|
522
532
|
})
|
@@ -819,6 +829,7 @@ class Client extends node_events_1.default {
|
|
819
829
|
json: {
|
820
830
|
username: options.username,
|
821
831
|
avatar: options.avatar,
|
832
|
+
banner: options.banner,
|
822
833
|
},
|
823
834
|
})
|
824
835
|
.then((response) => this.util.toCamelCase(response));
|
@@ -1238,6 +1249,12 @@ class Client extends node_events_1.default {
|
|
1238
1249
|
})
|
1239
1250
|
.then((response) => this.util.toCamelCase(response));
|
1240
1251
|
}
|
1252
|
+
/** https://discord.com/developers/docs/resources/poll#end-poll */
|
1253
|
+
endPoll(channelId, messageId) {
|
1254
|
+
return this.rest
|
1255
|
+
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(channelId, messageId))
|
1256
|
+
.then((response) => this.util.toCamelCase(response));
|
1257
|
+
}
|
1241
1258
|
/** https://discord.com/developers/docs/resources/webhook#execute-webhook */
|
1242
1259
|
executeWebhook(webhookId, webhookToken, options) {
|
1243
1260
|
return this.rest
|
@@ -1265,6 +1282,10 @@ class Client extends node_events_1.default {
|
|
1265
1282
|
attachments: options.attachments?.map((attachment) => this.util.toSnakeCase(attachment)),
|
1266
1283
|
flags: options.flags,
|
1267
1284
|
thread_name: options.threadName,
|
1285
|
+
applied_tags: options.appliedTags,
|
1286
|
+
poll: options.poll !== undefined
|
1287
|
+
? this.util.toSnakeCase(options.poll)
|
1288
|
+
: undefined,
|
1268
1289
|
},
|
1269
1290
|
files: options.files,
|
1270
1291
|
query: {
|
@@ -1290,18 +1311,14 @@ class Client extends node_events_1.default {
|
|
1290
1311
|
})
|
1291
1312
|
.then((response) => response !== null ? this.util.toCamelCase(response) : null);
|
1292
1313
|
}
|
1293
|
-
expirePoll(channelId, messageId) {
|
1294
|
-
return this.rest
|
1295
|
-
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.pollExpire(channelId, messageId))
|
1296
|
-
.then((response) => this.util.toCamelCase(response));
|
1297
|
-
}
|
1298
1314
|
/** https://discord.com/developers/docs/resources/channel#follow-announcement-channel */
|
1299
|
-
followChannel(channelId, options) {
|
1315
|
+
followChannel(channelId, options, reason) {
|
1300
1316
|
return this.rest
|
1301
1317
|
.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelFollowers(channelId), {
|
1302
1318
|
json: {
|
1303
1319
|
webhook_channel_id: options.webhookChannelId,
|
1304
1320
|
},
|
1321
|
+
reason,
|
1305
1322
|
})
|
1306
1323
|
.then((response) => this.util.toCamelCase(response));
|
1307
1324
|
}
|
@@ -1752,6 +1769,7 @@ class Client extends node_events_1.default {
|
|
1752
1769
|
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelPins(channelId))
|
1753
1770
|
.then((response) => response.map((message) => this.util.toCamelCase(message)));
|
1754
1771
|
}
|
1772
|
+
/** https://discord.com/developers/docs/resources/poll#get-answer-voters */
|
1755
1773
|
getPollAnswerVoters(channelId, messageId, answerId, options) {
|
1756
1774
|
return this.rest
|
1757
1775
|
.request(rest_1.RESTMethods.Get, rest_1.Endpoints.pollAnswerVoters(channelId, messageId, answerId), {
|
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,
|
@@ -461,6 +467,7 @@ export declare enum InviteTargetTypes {
|
|
461
467
|
Stream = 1,
|
462
468
|
EmbeddedApplication = 2
|
463
469
|
}
|
470
|
+
/** https://discord.com/developers/docs/resources/poll#layout-type */
|
464
471
|
export declare enum LayoutType {
|
465
472
|
Default = 1
|
466
473
|
}
|
@@ -566,9 +573,11 @@ export declare enum GatewayIntents {
|
|
566
573
|
GuildScheduledEvents = 65536,
|
567
574
|
AutoModerationConfiguration = 1048576,
|
568
575
|
AutoModerationActionExecution = 2097152,
|
569
|
-
|
576
|
+
GuildMessagePolls = 16777216,
|
577
|
+
DirectMessagePolls = 33554432,
|
578
|
+
AllNonPrivileged = 53575421,
|
570
579
|
AllPrivileged = 33026,
|
571
|
-
All =
|
580
|
+
All = 53608447
|
572
581
|
}
|
573
582
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types */
|
574
583
|
export declare enum StatusTypes {
|
@@ -887,6 +896,7 @@ export declare enum JSONErrorCodes {
|
|
887
896
|
ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066,
|
888
897
|
TagRequiredToCreateAForumPostInThisChannel = 40067,
|
889
898
|
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40074,
|
899
|
+
CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent = 40333,
|
890
900
|
MissingAccess = 50001,
|
891
901
|
InvalidAccountType = 50002,
|
892
902
|
CannotExecuteActionOnDMChannel = 50003,
|
@@ -1068,6 +1078,7 @@ export declare const BitwisePermissionFlags: {
|
|
1068
1078
|
readonly CreateEvents: bigint;
|
1069
1079
|
readonly UseExternalSounds: bigint;
|
1070
1080
|
readonly SendVoiceMessages: bigint;
|
1081
|
+
readonly SendPolls: bigint;
|
1071
1082
|
};
|
1072
1083
|
/** https://discord.com/developers/docs/topics/permissions#role-object-role-flags */
|
1073
1084
|
export declare enum RoleFlags {
|
@@ -1087,6 +1098,8 @@ export declare enum MembershipState {
|
|
1087
1098
|
}
|
1088
1099
|
/** https://discord.com/developers/docs/monetization/skus#sku-object-sku-types */
|
1089
1100
|
export declare enum SkuTypes {
|
1101
|
+
Durable = 2,
|
1102
|
+
Consumable = 3,
|
1090
1103
|
Subscription = 5,
|
1091
1104
|
SubscriptionGroup = 6
|
1092
1105
|
}
|
@@ -1098,5 +1111,12 @@ export declare enum SkuFlags {
|
|
1098
1111
|
}
|
1099
1112
|
/** https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types */
|
1100
1113
|
export declare enum EntitlementTypes {
|
1114
|
+
Purchase = 1,
|
1115
|
+
PremiumSubscription = 2,
|
1116
|
+
DeveloperGift = 3,
|
1117
|
+
TestModePurchase = 4,
|
1118
|
+
FreePurchase = 5,
|
1119
|
+
UserGift = 6,
|
1120
|
+
PremiumPurchase = 7,
|
1101
1121
|
ApplicationSubscription = 8
|
1102
1122
|
}
|
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 = exports.PremiumTypes = exports.UserFlags = 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) {
|
@@ -511,6 +518,7 @@ var InviteTargetTypes;
|
|
511
518
|
InviteTargetTypes[InviteTargetTypes["Stream"] = 1] = "Stream";
|
512
519
|
InviteTargetTypes[InviteTargetTypes["EmbeddedApplication"] = 2] = "EmbeddedApplication";
|
513
520
|
})(InviteTargetTypes || (exports.InviteTargetTypes = InviteTargetTypes = {}));
|
521
|
+
/** https://discord.com/developers/docs/resources/poll#layout-type */
|
514
522
|
var LayoutType;
|
515
523
|
(function (LayoutType) {
|
516
524
|
LayoutType[LayoutType["Default"] = 1] = "Default";
|
@@ -627,9 +635,11 @@ var GatewayIntents;
|
|
627
635
|
GatewayIntents[GatewayIntents["GuildScheduledEvents"] = 65536] = "GuildScheduledEvents";
|
628
636
|
GatewayIntents[GatewayIntents["AutoModerationConfiguration"] = 1048576] = "AutoModerationConfiguration";
|
629
637
|
GatewayIntents[GatewayIntents["AutoModerationActionExecution"] = 2097152] = "AutoModerationActionExecution";
|
630
|
-
GatewayIntents[GatewayIntents["
|
638
|
+
GatewayIntents[GatewayIntents["GuildMessagePolls"] = 16777216] = "GuildMessagePolls";
|
639
|
+
GatewayIntents[GatewayIntents["DirectMessagePolls"] = 33554432] = "DirectMessagePolls";
|
640
|
+
GatewayIntents[GatewayIntents["AllNonPrivileged"] = 53575421] = "AllNonPrivileged";
|
631
641
|
GatewayIntents[GatewayIntents["AllPrivileged"] = 33026] = "AllPrivileged";
|
632
|
-
GatewayIntents[GatewayIntents["All"] =
|
642
|
+
GatewayIntents[GatewayIntents["All"] = 53608447] = "All";
|
633
643
|
})(GatewayIntents || (exports.GatewayIntents = GatewayIntents = {}));
|
634
644
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types */
|
635
645
|
var StatusTypes;
|
@@ -959,6 +969,7 @@ var JSONErrorCodes;
|
|
959
969
|
JSONErrorCodes[JSONErrorCodes["ThereAreNoTagsAvailableThatCanBeSetByNonModerators"] = 40066] = "ThereAreNoTagsAvailableThatCanBeSetByNonModerators";
|
960
970
|
JSONErrorCodes[JSONErrorCodes["TagRequiredToCreateAForumPostInThisChannel"] = 40067] = "TagRequiredToCreateAForumPostInThisChannel";
|
961
971
|
JSONErrorCodes[JSONErrorCodes["AnEntitlementHasAlreadyBeenGrantedForThisResource"] = 40074] = "AnEntitlementHasAlreadyBeenGrantedForThisResource";
|
972
|
+
JSONErrorCodes[JSONErrorCodes["CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent"] = 40333] = "CloudflareIsBlockingYourRequestThisCanOftenBeResolvedBySettingAProperUserAgent";
|
962
973
|
JSONErrorCodes[JSONErrorCodes["MissingAccess"] = 50001] = "MissingAccess";
|
963
974
|
JSONErrorCodes[JSONErrorCodes["InvalidAccountType"] = 50002] = "InvalidAccountType";
|
964
975
|
JSONErrorCodes[JSONErrorCodes["CannotExecuteActionOnDMChannel"] = 50003] = "CannotExecuteActionOnDMChannel";
|
@@ -1142,6 +1153,7 @@ exports.BitwisePermissionFlags = {
|
|
1142
1153
|
CreateEvents: 1n << 44n,
|
1143
1154
|
UseExternalSounds: 1n << 45n,
|
1144
1155
|
SendVoiceMessages: 1n << 46n,
|
1156
|
+
SendPolls: 1n << 49n,
|
1145
1157
|
};
|
1146
1158
|
/** https://discord.com/developers/docs/topics/permissions#role-object-role-flags */
|
1147
1159
|
var RoleFlags;
|
@@ -1165,6 +1177,8 @@ var MembershipState;
|
|
1165
1177
|
/** https://discord.com/developers/docs/monetization/skus#sku-object-sku-types */
|
1166
1178
|
var SkuTypes;
|
1167
1179
|
(function (SkuTypes) {
|
1180
|
+
SkuTypes[SkuTypes["Durable"] = 2] = "Durable";
|
1181
|
+
SkuTypes[SkuTypes["Consumable"] = 3] = "Consumable";
|
1168
1182
|
SkuTypes[SkuTypes["Subscription"] = 5] = "Subscription";
|
1169
1183
|
SkuTypes[SkuTypes["SubscriptionGroup"] = 6] = "SubscriptionGroup";
|
1170
1184
|
})(SkuTypes || (exports.SkuTypes = SkuTypes = {}));
|
@@ -1178,5 +1192,12 @@ var SkuFlags;
|
|
1178
1192
|
/** https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types */
|
1179
1193
|
var EntitlementTypes;
|
1180
1194
|
(function (EntitlementTypes) {
|
1195
|
+
EntitlementTypes[EntitlementTypes["Purchase"] = 1] = "Purchase";
|
1196
|
+
EntitlementTypes[EntitlementTypes["PremiumSubscription"] = 2] = "PremiumSubscription";
|
1197
|
+
EntitlementTypes[EntitlementTypes["DeveloperGift"] = 3] = "DeveloperGift";
|
1198
|
+
EntitlementTypes[EntitlementTypes["TestModePurchase"] = 4] = "TestModePurchase";
|
1199
|
+
EntitlementTypes[EntitlementTypes["FreePurchase"] = 5] = "FreePurchase";
|
1200
|
+
EntitlementTypes[EntitlementTypes["UserGift"] = 6] = "UserGift";
|
1201
|
+
EntitlementTypes[EntitlementTypes["PremiumPurchase"] = 7] = "PremiumPurchase";
|
1181
1202
|
EntitlementTypes[EntitlementTypes["ApplicationSubscription"] = 8] = "ApplicationSubscription";
|
1182
1203
|
})(EntitlementTypes || (exports.EntitlementTypes = EntitlementTypes = {}));
|
@@ -72,6 +72,7 @@ export declare const applicationCommands: (applicationId: string) => `applicatio
|
|
72
72
|
export declare const applicationCommandPermissions: (applicationId: string, guildId: string, commandId: string) => `applications/${string}/guilds/${string}/commands/${string}/permissions`;
|
73
73
|
export declare const applicationCurrentUser: () => "applications/@me";
|
74
74
|
export declare const applicationEntitlement: (applicationId: string, entitlementId: string) => `applications/${string}/entitlements/${string}`;
|
75
|
+
export declare const applicationEntitlementConsume: (applicationId: string, entitlementId: string) => `applications/${string}/entitlements/${string}/consume`;
|
75
76
|
export declare const applicationEntitlements: (applicationId: string) => `applications/${string}/entitlements`;
|
76
77
|
export declare const applicationGuildCommand: (applicationId: string, guildId: string, commandId: string) => `applications/${string}/guilds/${string}/commands/${string}`;
|
77
78
|
export declare const applicationGuildCommands: (applicationId: string, guildId: string) => `applications/${string}/guilds/${string}/commands`;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
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;
|
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.applicationEntitlementConsume = 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
6
|
const bulkGuildBan = (guildId) => `guilds/${guildId}/bulk-ban`;
|
7
7
|
exports.bulkGuildBan = bulkGuildBan;
|
@@ -162,6 +162,8 @@ const applicationCurrentUser = () => "applications/@me";
|
|
162
162
|
exports.applicationCurrentUser = applicationCurrentUser;
|
163
163
|
const applicationEntitlement = (applicationId, entitlementId) => `applications/${applicationId}/entitlements/${entitlementId}`;
|
164
164
|
exports.applicationEntitlement = applicationEntitlement;
|
165
|
+
const applicationEntitlementConsume = (applicationId, entitlementId) => `applications/${applicationId}/entitlements/${entitlementId}/consume`;
|
166
|
+
exports.applicationEntitlementConsume = applicationEntitlementConsume;
|
165
167
|
const applicationEntitlements = (applicationId) => `applications/${applicationId}/entitlements`;
|
166
168
|
exports.applicationEntitlements = applicationEntitlements;
|
167
169
|
const applicationGuildCommand = (applicationId, guildId, commandId) => `applications/${applicationId}/guilds/${guildId}/commands/${commandId}`;
|
@@ -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
|
}
|
@@ -26,7 +26,7 @@ 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<
|
29
|
+
integration_types_config?: Record<ApplicationIntegrationTypes, RawApplicationIntegrationTypeConfiguration>;
|
30
30
|
custom_install_url?: string;
|
31
31
|
}
|
32
32
|
/** https://discord.com/developers/docs/resources/application#application-object-application-integration-type-configuration-object */
|
@@ -1,7 +1,6 @@
|
|
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 ".";
|
1
|
+
import type { AllowedMentionTypes, ApplicationIntegrationTypes, AttachmentFlags, ChannelFlags, ChannelTypes, ForumLayoutTypes, InteractionType, 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, PollCreateParams, Poll, RawPoll } from ".";
|
3
3
|
import type { File } from "../rest";
|
4
|
-
import type { Poll, RawPoll } from "./poll";
|
5
4
|
/** https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */
|
6
5
|
export interface RawChannel {
|
7
6
|
id: string;
|
@@ -66,6 +65,7 @@ export interface RawMessage {
|
|
66
65
|
message_reference?: RawMessageReference;
|
67
66
|
flags?: MessageFlags;
|
68
67
|
referenced_message?: RawMessage | null;
|
68
|
+
interaction_metadata?: RawMessageInteractionMetadata;
|
69
69
|
interaction?: RawMessageInteraction;
|
70
70
|
thread?: RawChannel;
|
71
71
|
components?: Array<RawActionRow>;
|
@@ -75,12 +75,28 @@ export interface RawMessage {
|
|
75
75
|
role_subscription_data?: RawRoleSubscriptionData;
|
76
76
|
resolved?: RawResolvedData;
|
77
77
|
poll?: RawPoll;
|
78
|
+
call?: RawMessageCall;
|
78
79
|
}
|
79
80
|
/** https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure */
|
80
81
|
export interface RawMessageActivity {
|
81
82
|
type: MessageActivityTypes;
|
82
83
|
party_id?: string;
|
83
84
|
}
|
85
|
+
/** https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object-message-interaction-metadata-structure */
|
86
|
+
export interface RawMessageInteractionMetadata {
|
87
|
+
id: string;
|
88
|
+
type: InteractionType;
|
89
|
+
user: RawUser;
|
90
|
+
authorizing_integration_owners: Record<ApplicationIntegrationTypes, string>;
|
91
|
+
original_response_message_id?: string;
|
92
|
+
interacted_message_id?: string;
|
93
|
+
triggering_interaction_metadata?: RawMessageInteractionMetadata;
|
94
|
+
}
|
95
|
+
/** https://discord.com/developers/docs/resources/channel#message-call-object-message-call-structure */
|
96
|
+
export interface RawMessageCall {
|
97
|
+
partecipants: Array<string>;
|
98
|
+
ended_timestamp?: string | null;
|
99
|
+
}
|
84
100
|
/** https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */
|
85
101
|
export interface RawMessageReference {
|
86
102
|
message_id?: string;
|
@@ -304,6 +320,7 @@ export interface Message {
|
|
304
320
|
messageReference?: MessageReference;
|
305
321
|
flags?: MessageFlags;
|
306
322
|
referencedMessage?: Message | null;
|
323
|
+
interactionMetadata?: MessageInteractionMetadata;
|
307
324
|
interaction?: MessageInteraction;
|
308
325
|
thread?: Channel;
|
309
326
|
components?: Array<ActionRow>;
|
@@ -313,11 +330,25 @@ export interface Message {
|
|
313
330
|
roleSubscriptionData?: RoleSubscriptionData;
|
314
331
|
resolved?: ResolvedData;
|
315
332
|
poll?: Poll;
|
333
|
+
call?: MessageCall;
|
316
334
|
}
|
317
335
|
export interface MessageActivity {
|
318
336
|
type: MessageActivityTypes;
|
319
337
|
partyId?: string;
|
320
338
|
}
|
339
|
+
export interface MessageInteractionMetadata {
|
340
|
+
id: string;
|
341
|
+
type: InteractionType;
|
342
|
+
user: User;
|
343
|
+
authorizingIntegrationOwners: Record<ApplicationIntegrationTypes, string>;
|
344
|
+
originalResponseMessageId?: string;
|
345
|
+
interactedMessageId?: string;
|
346
|
+
triggeringInteractionMetadata?: MessageInteractionMetadata;
|
347
|
+
}
|
348
|
+
export interface MessageCall {
|
349
|
+
partecipants: Array<string>;
|
350
|
+
endedTimestamp?: string | null;
|
351
|
+
}
|
321
352
|
export interface MessageReference {
|
322
353
|
messageId?: string;
|
323
354
|
channelId?: string;
|
@@ -498,7 +529,7 @@ export interface CreateMessageParams {
|
|
498
529
|
attachments?: Array<Attachment>;
|
499
530
|
flags?: MessageFlags;
|
500
531
|
enforceNonce?: boolean;
|
501
|
-
poll?:
|
532
|
+
poll?: PollCreateParams;
|
502
533
|
}
|
503
534
|
export interface EditMessageParams {
|
504
535
|
content?: string | null;
|
@@ -53,6 +53,10 @@ export interface RawGuildCreateEventExtraFields {
|
|
53
53
|
stage_instances?: Array<RawStageInstance>;
|
54
54
|
guild_scheduled_events?: Array<RawGuildScheduledEvent>;
|
55
55
|
}
|
56
|
+
/** https://discord.com/developers/docs/topics/gateway-events#guild-audit-log-entry-create-guild-audit-log-entry-create-extra-fields */
|
57
|
+
export interface RawGuildAuditLogEntryCreateExtraFields {
|
58
|
+
guild_id: string;
|
59
|
+
}
|
56
60
|
/** https://discord.com/developers/docs/topics/gateway-events#guild-ban-add-guild-ban-add-event-fields */
|
57
61
|
export interface RawGuildBanAddEventFields {
|
58
62
|
guild_id: string;
|
@@ -257,6 +261,7 @@ export interface RawVoiceServerUpdateEventFields {
|
|
257
261
|
guild_id: string;
|
258
262
|
endpoint: string | null;
|
259
263
|
}
|
264
|
+
/** https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add-message-poll-vote-add-fields */
|
260
265
|
export interface RawMessagePollVoteAddFields {
|
261
266
|
user_id: string;
|
262
267
|
channel_id: string;
|
@@ -264,6 +269,7 @@ export interface RawMessagePollVoteAddFields {
|
|
264
269
|
guild_id?: string;
|
265
270
|
answer_id: number;
|
266
271
|
}
|
272
|
+
/** https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove */
|
267
273
|
export interface RawMessagePollVoteRemoveFields {
|
268
274
|
user_id: string;
|
269
275
|
channel_id: string;
|
@@ -318,6 +324,9 @@ export interface GuildCreateEventExtraFields {
|
|
318
324
|
stageInstances?: Array<StageInstance>;
|
319
325
|
guildScheduledEvents?: Array<GuildScheduledEvent>;
|
320
326
|
}
|
327
|
+
export interface GuildAuditLogEntryCreateExtraFields {
|
328
|
+
guildId: string;
|
329
|
+
}
|
321
330
|
export interface GuildBanAddEventFields {
|
322
331
|
guildId: string;
|
323
332
|
user: User;
|
package/dist/lib/types/index.js
CHANGED
@@ -29,6 +29,7 @@ __exportStar(require("./guild"), exports);
|
|
29
29
|
__exportStar(require("./interaction"), exports);
|
30
30
|
__exportStar(require("./invite"), exports);
|
31
31
|
__exportStar(require("./message-components"), exports);
|
32
|
+
__exportStar(require("./poll"), exports);
|
32
33
|
__exportStar(require("./role"), exports);
|
33
34
|
__exportStar(require("./sku"), exports);
|
34
35
|
__exportStar(require("./stage-instance"), exports);
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import type { RawAttachment, RawChannel, RawGuildMember, RawMessage, RawUser, RawRole, Attachment, User, GuildMember, Message, Role, Channel, Entitlement, RawEntitlement, RawEmbed, RawAllowedMentions, RawActionRow, RawApplicationCommandOptionChoice, Embed, AllowedMentions, ActionRow, ApplicationCommandOptionChoice, RawTextInput, TextInput, ExecuteWebhookParams } from ".";
|
1
|
+
import type { RawAttachment, RawChannel, RawGuildMember, RawMessage, RawUser, RawRole, Attachment, User, GuildMember, Message, Role, Channel, Entitlement, RawEntitlement, RawEmbed, RawAllowedMentions, RawActionRow, RawApplicationCommandOptionChoice, Embed, AllowedMentions, ActionRow, ApplicationCommandOptionChoice, RawTextInput, TextInput, ExecuteWebhookParams, RawPollCreateParams, PollCreateParams } from ".";
|
2
2
|
import type { ApplicationCommandOptionType, ApplicationCommandTypes, ComponentTypes, InteractionCallbackType, InteractionType, MessageFlags } from "../constants";
|
3
3
|
import type { File } from "../rest";
|
4
|
-
import type { Poll, RawPoll } from "./poll";
|
5
4
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-structure */
|
6
5
|
export interface RawInteraction {
|
7
6
|
id: string;
|
@@ -85,7 +84,7 @@ export interface RawInteractionCallbackData {
|
|
85
84
|
flags?: MessageFlags;
|
86
85
|
components?: Array<RawActionRow>;
|
87
86
|
attachments?: Array<RawAttachment>;
|
88
|
-
poll?:
|
87
|
+
poll?: RawPollCreateParams;
|
89
88
|
files?: Array<File>;
|
90
89
|
choices?: Array<RawApplicationCommandOptionChoice>;
|
91
90
|
custom_id?: string;
|
@@ -165,7 +164,7 @@ export interface InteractionCallbackData {
|
|
165
164
|
flags?: MessageFlags;
|
166
165
|
components?: Array<ActionRow>;
|
167
166
|
attachments?: Array<Attachment>;
|
168
|
-
poll?:
|
167
|
+
poll?: PollCreateParams;
|
169
168
|
files?: Array<File>;
|
170
169
|
choices?: Array<ApplicationCommandOptionChoice>;
|
171
170
|
customId?: string;
|
package/dist/lib/types/poll.d.ts
CHANGED
@@ -1,25 +1,38 @@
|
|
1
1
|
import type { LayoutType } from "../constants";
|
2
2
|
import type { Emoji, RawEmoji } from "./emoji";
|
3
|
+
/** https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure */
|
3
4
|
export interface RawPoll {
|
4
5
|
question: RawPollMedia;
|
5
6
|
answers: Array<RawPollAnswer>;
|
6
|
-
expiry: string;
|
7
|
+
expiry: string | null;
|
7
8
|
allow_multiselect: boolean;
|
8
9
|
layout_type: LayoutType;
|
9
|
-
results
|
10
|
+
results?: RawPollResults;
|
10
11
|
}
|
12
|
+
/** https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure */
|
13
|
+
export interface RawPollCreateParams {
|
14
|
+
question: RawPollMedia;
|
15
|
+
answers: Array<RawPollAnswer>;
|
16
|
+
duration: number;
|
17
|
+
allow_multiselect: boolean;
|
18
|
+
layout_type?: LayoutType;
|
19
|
+
}
|
20
|
+
/** https://discord.com/developers/docs/resources/poll#poll-media-object-poll-media-object-structure */
|
11
21
|
export interface RawPollMedia {
|
12
22
|
text?: string;
|
13
23
|
emoji?: Pick<RawEmoji, "id" | "name">;
|
14
24
|
}
|
25
|
+
/** https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure */
|
15
26
|
export interface RawPollAnswer {
|
16
27
|
answer_id: number;
|
17
28
|
poll_media: RawPollMedia;
|
18
29
|
}
|
30
|
+
/** https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure */
|
19
31
|
export interface RawPollResults {
|
20
32
|
is_finalized: boolean;
|
21
33
|
answer_counts: Array<RawPollAnswerCount>;
|
22
34
|
}
|
35
|
+
/** https://discord.com/developers/docs/resources/poll#poll-results-object-poll-answer-count-object-structure */
|
23
36
|
export interface RawPollAnswerCount {
|
24
37
|
id: number;
|
25
38
|
count: number;
|
@@ -28,10 +41,17 @@ export interface RawPollAnswerCount {
|
|
28
41
|
export interface Poll {
|
29
42
|
question: PollMedia;
|
30
43
|
answers: Array<PollAnswer>;
|
31
|
-
expiry: string;
|
44
|
+
expiry: string | null;
|
32
45
|
allowMultiselect: boolean;
|
33
46
|
layoutType: LayoutType;
|
34
|
-
results
|
47
|
+
results?: PollResults;
|
48
|
+
}
|
49
|
+
export interface PollCreateParams {
|
50
|
+
question: PollMedia;
|
51
|
+
answers: Array<PollAnswer>;
|
52
|
+
duration: number;
|
53
|
+
allowMultiselect: boolean;
|
54
|
+
layoutType?: LayoutType;
|
35
55
|
}
|
36
56
|
export interface PollMedia {
|
37
57
|
text?: string;
|
package/dist/lib/types/user.d.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import type { MessageFlags, WebhookTypes } from "../constants";
|
2
|
-
import type { ActionRow, AllowedMentions, Attachment, Channel, Embed, Guild, User, RawChannel, RawGuild, RawUser } from ".";
|
2
|
+
import type { ActionRow, AllowedMentions, Attachment, Channel, Embed, Guild, User, RawChannel, RawGuild, RawUser, PollCreateParams } from ".";
|
3
3
|
import type { File } from "../rest";
|
4
|
-
import type { Poll } from "./poll";
|
5
4
|
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-structure */
|
6
5
|
export interface RawWebhook {
|
7
6
|
id: string;
|
@@ -53,7 +52,7 @@ export interface ExecuteWebhookParams {
|
|
53
52
|
flags?: MessageFlags | null;
|
54
53
|
threadName?: string;
|
55
54
|
appliedTags?: Array<string>;
|
56
|
-
poll?:
|
55
|
+
poll?: PollCreateParams;
|
57
56
|
}
|
58
57
|
export interface EditWebhookMessageParams {
|
59
58
|
content?: string | null;
|
package/dist/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "disgroove",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.1",
|
4
4
|
"description": "A module to interface with Discord",
|
5
5
|
"main": "./dist/lib/index.js",
|
6
6
|
"types": "./dist/lib/index.d.ts",
|
@@ -22,12 +22,11 @@
|
|
22
22
|
},
|
23
23
|
"homepage": "https://github.com/XenKys/disgroove#readme",
|
24
24
|
"devDependencies": {
|
25
|
-
"@types/node": "^20.11
|
25
|
+
"@types/node": "^20.12.11",
|
26
26
|
"@types/ws": "^8.5.10",
|
27
|
-
"
|
28
|
-
"typescript": "^5.4.2"
|
27
|
+
"typescript": "^5.4.5"
|
29
28
|
},
|
30
29
|
"dependencies": {
|
31
|
-
"ws": "^8.
|
30
|
+
"ws": "^8.17.0"
|
32
31
|
}
|
33
32
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "disgroove",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.1",
|
4
4
|
"description": "A module to interface with Discord",
|
5
5
|
"main": "./dist/lib/index.js",
|
6
6
|
"types": "./dist/lib/index.d.ts",
|
@@ -22,12 +22,11 @@
|
|
22
22
|
},
|
23
23
|
"homepage": "https://github.com/XenKys/disgroove#readme",
|
24
24
|
"devDependencies": {
|
25
|
-
"@types/node": "^20.11
|
25
|
+
"@types/node": "^20.12.11",
|
26
26
|
"@types/ws": "^8.5.10",
|
27
|
-
"
|
28
|
-
"typescript": "^5.4.2"
|
27
|
+
"typescript": "^5.4.5"
|
29
28
|
},
|
30
29
|
"dependencies": {
|
31
|
-
"ws": "^8.
|
30
|
+
"ws": "^8.17.0"
|
32
31
|
}
|
33
32
|
}
|