disgroove 2.2.7-dev.fca4921 → 3.0.0-dev.2cf2b90
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/LICENSE +9 -9
- package/README.md +48 -48
- package/dist/lib/Client.d.ts +332 -301
- package/dist/lib/Client.js +562 -462
- package/dist/lib/constants.d.ts +35 -24
- package/dist/lib/constants.js +39 -27
- package/dist/lib/gateway/Dispatcher.d.ts +104 -0
- package/dist/lib/gateway/Dispatcher.js +471 -0
- package/dist/lib/gateway/Shard.d.ts +12 -21
- package/dist/lib/gateway/Shard.js +121 -570
- package/dist/lib/gateway/Transmitter.d.ts +22 -0
- package/dist/lib/gateway/Transmitter.js +93 -0
- package/dist/lib/gateway/WebSocketManager.d.ts +22 -0
- package/dist/lib/gateway/WebSocketManager.js +93 -0
- package/dist/lib/index.d.ts +5 -1
- package/dist/lib/index.js +5 -1
- package/dist/lib/rest/Endpoints.d.ts +95 -91
- package/dist/lib/rest/Endpoints.js +111 -102
- package/dist/lib/rest/RequestManager.d.ts +1 -3
- package/dist/lib/rest/RequestManager.js +17 -7
- package/dist/lib/rest/index.js +17 -7
- package/dist/lib/transformers/ApplicationCommands.js +4 -4
- package/dist/lib/transformers/Applications.d.ts +2 -0
- package/dist/lib/transformers/Applications.js +110 -4
- package/dist/lib/transformers/AuditLogs.js +10 -10
- package/dist/lib/transformers/AutoModeration.js +6 -6
- package/dist/lib/transformers/Channels.js +16 -16
- package/dist/lib/transformers/Components.d.ts +15 -3
- package/dist/lib/transformers/Components.js +309 -156
- package/dist/lib/transformers/Entitlements.d.ts +2 -2
- package/dist/lib/transformers/Entitlements.js +16 -16
- package/dist/lib/transformers/GuildScheduledEvents.js +8 -8
- package/dist/lib/transformers/GuildTemplates.js +4 -4
- package/dist/lib/transformers/Guilds.js +28 -28
- package/dist/lib/transformers/Interactions.js +330 -55
- package/dist/lib/transformers/Lobbies.d.ts +7 -0
- package/dist/lib/transformers/Lobbies.js +38 -0
- package/dist/lib/transformers/Messages.d.ts +4 -3
- package/dist/lib/transformers/Messages.js +38 -52
- package/dist/lib/transformers/Polls.js +2 -2
- package/dist/lib/transformers/Presences.d.ts +3 -3
- package/dist/lib/transformers/Presences.js +6 -6
- package/dist/lib/transformers/Roles.js +8 -8
- package/dist/lib/transformers/SKUs.js +2 -2
- package/dist/lib/transformers/Soundboards.js +6 -6
- package/dist/lib/transformers/StageInstances.js +6 -6
- package/dist/lib/transformers/Stickers.js +3 -3
- package/dist/lib/transformers/Subscriptions.js +8 -8
- package/dist/lib/transformers/Teams.js +4 -4
- package/dist/lib/transformers/Users.js +6 -6
- package/dist/lib/transformers/Voice.js +8 -8
- package/dist/lib/transformers/Webhooks.js +6 -6
- package/dist/lib/transformers/index.d.ts +2 -1
- package/dist/lib/transformers/index.js +2 -1
- package/dist/lib/types/application-command.d.ts +9 -4
- package/dist/lib/types/application-role-connection-metadata.d.ts +1 -0
- package/dist/lib/types/application.d.ts +12 -7
- package/dist/lib/types/audit-log.d.ts +9 -5
- package/dist/lib/types/auto-moderation.d.ts +7 -3
- package/dist/lib/types/channel.d.ts +17 -23
- package/dist/lib/types/common.d.ts +2 -0
- package/dist/lib/types/components.d.ts +510 -0
- package/dist/lib/types/emoji.d.ts +1 -0
- package/dist/lib/types/entitlements.d.ts +5 -4
- package/dist/lib/types/gateway-events.d.ts +406 -207
- package/dist/lib/types/guild-scheduled-event.d.ts +10 -5
- package/dist/lib/types/guild-template.d.ts +3 -2
- package/dist/lib/types/guild.d.ts +40 -22
- package/dist/lib/types/interaction.d.ts +35 -18
- package/dist/lib/types/invite.d.ts +5 -2
- package/dist/lib/types/lobby.d.ts +31 -0
- package/dist/lib/types/lobby.js +2 -0
- package/dist/lib/types/message.d.ts +32 -20
- package/dist/lib/types/poll.d.ts +7 -1
- package/dist/lib/types/role.d.ts +8 -5
- package/dist/lib/types/sku.d.ts +2 -1
- package/dist/lib/types/soundboard.d.ts +4 -3
- package/dist/lib/types/stage-instance.d.ts +4 -3
- package/dist/lib/types/sticker.d.ts +8 -5
- package/dist/lib/types/subscription.d.ts +6 -5
- package/dist/lib/types/team.d.ts +4 -2
- package/dist/lib/types/user.d.ts +10 -3
- package/dist/lib/types/voice.d.ts +6 -4
- package/dist/lib/types/webhook.d.ts +4 -3
- package/dist/lib/utils/CDN.d.ts +22 -22
- package/dist/lib/utils/CDN.js +22 -22
- package/dist/lib/utils/errors.d.ts +3 -1
- package/dist/lib/utils/errors.js +4 -0
- package/dist/lib/utils/formatters.d.ts +7 -7
- package/dist/lib/utils/formatters.js +28 -29
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.js +18 -7
- package/dist/lib/utils/permissions.d.ts +2 -0
- package/dist/lib/utils/permissions.js +7 -0
- package/dist/package.json +4 -4
- package/package.json +5 -5
- package/dist/lib/types/message-components.d.ts +0 -234
- /package/dist/lib/types/{message-components.js → components.js} +0 -0
package/dist/lib/constants.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/** https://discord.com/developers/docs/reference#message-formatting-timestamp-styles */
|
|
2
2
|
export declare enum TimestampStyles {
|
|
3
3
|
ShortTime = "t",
|
|
4
|
-
|
|
4
|
+
MediumTime = "T",
|
|
5
5
|
ShortDate = "d",
|
|
6
6
|
LongDate = "D",
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
LongDateShortTime = "f",
|
|
8
|
+
FullDateShortTime = "F",
|
|
9
|
+
ShortDateShortTime = "s",
|
|
10
|
+
ShortDateMediumTime = "S",
|
|
9
11
|
RelativeTime = "R"
|
|
10
12
|
}
|
|
11
13
|
/** https://discord.com/developers/docs/reference#message-formatting-guild-navigation-types */
|
|
@@ -106,7 +108,19 @@ export declare enum InteractionContextTypes {
|
|
|
106
108
|
BotDM = 1,
|
|
107
109
|
PrivateChannel = 2
|
|
108
110
|
}
|
|
109
|
-
/** https://discord.com/developers/docs/interactions/
|
|
111
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */
|
|
112
|
+
export declare enum InteractionCallbackType {
|
|
113
|
+
Pong = 1,
|
|
114
|
+
ChannelMessageWithSource = 4,
|
|
115
|
+
DeferredChannelMessageWithSource = 5,
|
|
116
|
+
DeferredUpdateMessage = 6,
|
|
117
|
+
UpdateMessage = 7,
|
|
118
|
+
ApplicationCommandAutocompleteResult = 8,
|
|
119
|
+
Modal = 9,
|
|
120
|
+
PremiumRequired = 10,
|
|
121
|
+
LaunchActivity = 12
|
|
122
|
+
}
|
|
123
|
+
/** https://discord.com/developers/docs/components/reference#component-object-component-types */
|
|
110
124
|
export declare enum ComponentTypes {
|
|
111
125
|
ActionRow = 1,
|
|
112
126
|
Button = 2,
|
|
@@ -122,26 +136,11 @@ export declare enum ComponentTypes {
|
|
|
122
136
|
MediaGallery = 12,
|
|
123
137
|
File = 13,
|
|
124
138
|
Separator = 14,
|
|
125
|
-
Container = 17
|
|
139
|
+
Container = 17,
|
|
140
|
+
Label = 18,
|
|
141
|
+
FileUpload = 19
|
|
126
142
|
}
|
|
127
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
128
|
-
export declare enum SeparatorSpacing {
|
|
129
|
-
Small = 1,
|
|
130
|
-
Large = 2
|
|
131
|
-
}
|
|
132
|
-
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */
|
|
133
|
-
export declare enum InteractionCallbackType {
|
|
134
|
-
Pong = 1,
|
|
135
|
-
ChannelMessageWithSource = 4,
|
|
136
|
-
DeferredChannelMessageWithSource = 5,
|
|
137
|
-
DeferredUpdateMessage = 6,
|
|
138
|
-
UpdateMessage = 7,
|
|
139
|
-
ApplicationCommandAutocompleteResult = 8,
|
|
140
|
-
Modal = 9,
|
|
141
|
-
PremiumRequired = 10,
|
|
142
|
-
LaunchActivity = 12
|
|
143
|
-
}
|
|
144
|
-
/** https://discord.com/developers/docs/interactions/message-components#button-object-button-styles */
|
|
143
|
+
/** https://discord.com/developers/docs/components/reference#button-button-styles */
|
|
145
144
|
export declare enum ButtonStyles {
|
|
146
145
|
Primary = 1,
|
|
147
146
|
Secondary = 2,
|
|
@@ -150,11 +149,16 @@ export declare enum ButtonStyles {
|
|
|
150
149
|
Link = 5,
|
|
151
150
|
Premium = 6
|
|
152
151
|
}
|
|
153
|
-
/** https://discord.com/developers/docs/
|
|
152
|
+
/** https://discord.com/developers/docs/components/reference#text-input-text-input-styles */
|
|
154
153
|
export declare enum TextInputStyles {
|
|
155
154
|
Short = 1,
|
|
156
155
|
Paragraph = 2
|
|
157
156
|
}
|
|
157
|
+
/** https://discord.com/developers/docs/components/reference#separator-separator-structure */
|
|
158
|
+
export declare enum SeparatorSpacing {
|
|
159
|
+
Small = 1,
|
|
160
|
+
Large = 2
|
|
161
|
+
}
|
|
158
162
|
/** https://discord.com/developers/docs/resources/application#application-object-application-integration-types */
|
|
159
163
|
export declare enum ApplicationIntegrationTypes {
|
|
160
164
|
GuildInstall = 0,
|
|
@@ -518,6 +522,10 @@ export declare enum InviteTargetTypes {
|
|
|
518
522
|
export declare enum GuildInviteFlags {
|
|
519
523
|
IsGuestInvite = 1
|
|
520
524
|
}
|
|
525
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-flags */
|
|
526
|
+
export declare enum LobbyMemberFlags {
|
|
527
|
+
CanLinkLobby = 1
|
|
528
|
+
}
|
|
521
529
|
/** https://discord.com/developers/docs/resources/message#message-object-message-types */
|
|
522
530
|
export declare enum MessageTypes {
|
|
523
531
|
Default = 0,
|
|
@@ -748,6 +756,7 @@ export declare enum StatusTypes {
|
|
|
748
756
|
export declare enum GatewayEvents {
|
|
749
757
|
Ready = "READY",
|
|
750
758
|
Resumed = "RESUMED",
|
|
759
|
+
RateLimited = "RATE_LIMITED",
|
|
751
760
|
ApplicationCommandPermissionsUpdate = "APPLICATION_COMMAND_PERMISSIONS_UPDATE",
|
|
752
761
|
AutoModerationRuleCreate = "AUTO_MODERATION_RULE_CREATE",
|
|
753
762
|
AutoModerationRuleUpdate = "AUTO_MODERATION_RULE_UPDATE",
|
|
@@ -1173,6 +1182,7 @@ export declare enum JSONErrorCodes {
|
|
|
1173
1182
|
MessageBlockedByHarmfulLinksFilter = 240000,
|
|
1174
1183
|
CannotEnableOnboardingRequirementsAreNotMet = 350000,
|
|
1175
1184
|
CannotUpdateOnboardingWhileBelowRequirements = 350001,
|
|
1185
|
+
AccessToFileUploadsHasBeenLimitedForThisGuild = 400001,
|
|
1176
1186
|
FailedToBanUsers = 500000,
|
|
1177
1187
|
PollVotingBlocked = 520000,
|
|
1178
1188
|
PollExpired = 520001,
|
|
@@ -1261,6 +1271,7 @@ export declare const BitwisePermissionFlags: {
|
|
|
1261
1271
|
readonly SendVoiceMessages: bigint;
|
|
1262
1272
|
readonly SendPolls: bigint;
|
|
1263
1273
|
readonly UseExternalApps: bigint;
|
|
1274
|
+
readonly PinMessages: bigint;
|
|
1264
1275
|
};
|
|
1265
1276
|
/** https://discord.com/developers/docs/topics/permissions#role-object-role-flags */
|
|
1266
1277
|
export declare enum RoleFlags {
|
package/dist/lib/constants.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GuildScheduledEventRecurrenceRuleMonth = exports.GuildScheduledEventRecurrenceRuleWeekday = exports.GuildScheduledEventRecurrenceRuleFrequency = 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.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ActivityLocationKind = exports.ApplicationFlags = exports.ApplicationEventWebhookStatus = exports.ApplicationIntegrationTypes = 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.AnimationTypes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.SubscriptionStatuses = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.EmbedTypes = exports.MessageReferenceTypes = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.GuildInviteFlags = exports.InviteTargetTypes = exports.InviteTypes = void 0;
|
|
3
|
+
exports.GuildScheduledEventRecurrenceRuleMonth = exports.GuildScheduledEventRecurrenceRuleWeekday = exports.GuildScheduledEventRecurrenceRuleFrequency = 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.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ActivityLocationKind = exports.ApplicationFlags = exports.ApplicationEventWebhookStatus = exports.ApplicationIntegrationTypes = exports.SeparatorSpacing = exports.TextInputStyles = exports.ButtonStyles = exports.ComponentTypes = exports.InteractionCallbackType = exports.InteractionContextTypes = exports.InteractionType = exports.ApplicationCommandPermissionType = exports.EntryPointCommandHandlerTypes = exports.ApplicationCommandOptionType = exports.ApplicationCommandTypes = exports.Locales = exports.ImageFormats = exports.GuildNavigationTypes = exports.TimestampStyles = 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.AnimationTypes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.SubscriptionStatuses = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.EmbedTypes = exports.MessageReferenceTypes = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.LobbyMemberFlags = exports.GuildInviteFlags = exports.InviteTargetTypes = exports.InviteTypes = void 0;
|
|
5
5
|
/** https://discord.com/developers/docs/reference#message-formatting-timestamp-styles */
|
|
6
6
|
var TimestampStyles;
|
|
7
7
|
(function (TimestampStyles) {
|
|
8
8
|
TimestampStyles["ShortTime"] = "t";
|
|
9
|
-
TimestampStyles["
|
|
9
|
+
TimestampStyles["MediumTime"] = "T";
|
|
10
10
|
TimestampStyles["ShortDate"] = "d";
|
|
11
11
|
TimestampStyles["LongDate"] = "D";
|
|
12
|
-
TimestampStyles["
|
|
13
|
-
TimestampStyles["
|
|
12
|
+
TimestampStyles["LongDateShortTime"] = "f";
|
|
13
|
+
TimestampStyles["FullDateShortTime"] = "F";
|
|
14
|
+
TimestampStyles["ShortDateShortTime"] = "s";
|
|
15
|
+
TimestampStyles["ShortDateMediumTime"] = "S";
|
|
14
16
|
TimestampStyles["RelativeTime"] = "R";
|
|
15
17
|
})(TimestampStyles || (exports.TimestampStyles = TimestampStyles = {}));
|
|
16
18
|
/** https://discord.com/developers/docs/reference#message-formatting-guild-navigation-types */
|
|
@@ -120,7 +122,20 @@ var InteractionContextTypes;
|
|
|
120
122
|
InteractionContextTypes[InteractionContextTypes["BotDM"] = 1] = "BotDM";
|
|
121
123
|
InteractionContextTypes[InteractionContextTypes["PrivateChannel"] = 2] = "PrivateChannel";
|
|
122
124
|
})(InteractionContextTypes || (exports.InteractionContextTypes = InteractionContextTypes = {}));
|
|
123
|
-
/** https://discord.com/developers/docs/interactions/
|
|
125
|
+
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */
|
|
126
|
+
var InteractionCallbackType;
|
|
127
|
+
(function (InteractionCallbackType) {
|
|
128
|
+
InteractionCallbackType[InteractionCallbackType["Pong"] = 1] = "Pong";
|
|
129
|
+
InteractionCallbackType[InteractionCallbackType["ChannelMessageWithSource"] = 4] = "ChannelMessageWithSource";
|
|
130
|
+
InteractionCallbackType[InteractionCallbackType["DeferredChannelMessageWithSource"] = 5] = "DeferredChannelMessageWithSource";
|
|
131
|
+
InteractionCallbackType[InteractionCallbackType["DeferredUpdateMessage"] = 6] = "DeferredUpdateMessage";
|
|
132
|
+
InteractionCallbackType[InteractionCallbackType["UpdateMessage"] = 7] = "UpdateMessage";
|
|
133
|
+
InteractionCallbackType[InteractionCallbackType["ApplicationCommandAutocompleteResult"] = 8] = "ApplicationCommandAutocompleteResult";
|
|
134
|
+
InteractionCallbackType[InteractionCallbackType["Modal"] = 9] = "Modal";
|
|
135
|
+
InteractionCallbackType[InteractionCallbackType["PremiumRequired"] = 10] = "PremiumRequired";
|
|
136
|
+
InteractionCallbackType[InteractionCallbackType["LaunchActivity"] = 12] = "LaunchActivity";
|
|
137
|
+
})(InteractionCallbackType || (exports.InteractionCallbackType = InteractionCallbackType = {}));
|
|
138
|
+
/** https://discord.com/developers/docs/components/reference#component-object-component-types */
|
|
124
139
|
var ComponentTypes;
|
|
125
140
|
(function (ComponentTypes) {
|
|
126
141
|
ComponentTypes[ComponentTypes["ActionRow"] = 1] = "ActionRow";
|
|
@@ -138,27 +153,10 @@ var ComponentTypes;
|
|
|
138
153
|
ComponentTypes[ComponentTypes["File"] = 13] = "File";
|
|
139
154
|
ComponentTypes[ComponentTypes["Separator"] = 14] = "Separator";
|
|
140
155
|
ComponentTypes[ComponentTypes["Container"] = 17] = "Container";
|
|
156
|
+
ComponentTypes[ComponentTypes["Label"] = 18] = "Label";
|
|
157
|
+
ComponentTypes[ComponentTypes["FileUpload"] = 19] = "FileUpload";
|
|
141
158
|
})(ComponentTypes || (exports.ComponentTypes = ComponentTypes = {}));
|
|
142
|
-
/** https://discord.com/developers/docs/components/reference#
|
|
143
|
-
var SeparatorSpacing;
|
|
144
|
-
(function (SeparatorSpacing) {
|
|
145
|
-
SeparatorSpacing[SeparatorSpacing["Small"] = 1] = "Small";
|
|
146
|
-
SeparatorSpacing[SeparatorSpacing["Large"] = 2] = "Large";
|
|
147
|
-
})(SeparatorSpacing || (exports.SeparatorSpacing = SeparatorSpacing = {}));
|
|
148
|
-
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type */
|
|
149
|
-
var InteractionCallbackType;
|
|
150
|
-
(function (InteractionCallbackType) {
|
|
151
|
-
InteractionCallbackType[InteractionCallbackType["Pong"] = 1] = "Pong";
|
|
152
|
-
InteractionCallbackType[InteractionCallbackType["ChannelMessageWithSource"] = 4] = "ChannelMessageWithSource";
|
|
153
|
-
InteractionCallbackType[InteractionCallbackType["DeferredChannelMessageWithSource"] = 5] = "DeferredChannelMessageWithSource";
|
|
154
|
-
InteractionCallbackType[InteractionCallbackType["DeferredUpdateMessage"] = 6] = "DeferredUpdateMessage";
|
|
155
|
-
InteractionCallbackType[InteractionCallbackType["UpdateMessage"] = 7] = "UpdateMessage";
|
|
156
|
-
InteractionCallbackType[InteractionCallbackType["ApplicationCommandAutocompleteResult"] = 8] = "ApplicationCommandAutocompleteResult";
|
|
157
|
-
InteractionCallbackType[InteractionCallbackType["Modal"] = 9] = "Modal";
|
|
158
|
-
InteractionCallbackType[InteractionCallbackType["PremiumRequired"] = 10] = "PremiumRequired";
|
|
159
|
-
InteractionCallbackType[InteractionCallbackType["LaunchActivity"] = 12] = "LaunchActivity";
|
|
160
|
-
})(InteractionCallbackType || (exports.InteractionCallbackType = InteractionCallbackType = {}));
|
|
161
|
-
/** https://discord.com/developers/docs/interactions/message-components#button-object-button-styles */
|
|
159
|
+
/** https://discord.com/developers/docs/components/reference#button-button-styles */
|
|
162
160
|
var ButtonStyles;
|
|
163
161
|
(function (ButtonStyles) {
|
|
164
162
|
ButtonStyles[ButtonStyles["Primary"] = 1] = "Primary";
|
|
@@ -168,12 +166,18 @@ var ButtonStyles;
|
|
|
168
166
|
ButtonStyles[ButtonStyles["Link"] = 5] = "Link";
|
|
169
167
|
ButtonStyles[ButtonStyles["Premium"] = 6] = "Premium";
|
|
170
168
|
})(ButtonStyles || (exports.ButtonStyles = ButtonStyles = {}));
|
|
171
|
-
/** https://discord.com/developers/docs/
|
|
169
|
+
/** https://discord.com/developers/docs/components/reference#text-input-text-input-styles */
|
|
172
170
|
var TextInputStyles;
|
|
173
171
|
(function (TextInputStyles) {
|
|
174
172
|
TextInputStyles[TextInputStyles["Short"] = 1] = "Short";
|
|
175
173
|
TextInputStyles[TextInputStyles["Paragraph"] = 2] = "Paragraph";
|
|
176
174
|
})(TextInputStyles || (exports.TextInputStyles = TextInputStyles = {}));
|
|
175
|
+
/** https://discord.com/developers/docs/components/reference#separator-separator-structure */
|
|
176
|
+
var SeparatorSpacing;
|
|
177
|
+
(function (SeparatorSpacing) {
|
|
178
|
+
SeparatorSpacing[SeparatorSpacing["Small"] = 1] = "Small";
|
|
179
|
+
SeparatorSpacing[SeparatorSpacing["Large"] = 2] = "Large";
|
|
180
|
+
})(SeparatorSpacing || (exports.SeparatorSpacing = SeparatorSpacing = {}));
|
|
177
181
|
/** https://discord.com/developers/docs/resources/application#application-object-application-integration-types */
|
|
178
182
|
var ApplicationIntegrationTypes;
|
|
179
183
|
(function (ApplicationIntegrationTypes) {
|
|
@@ -575,6 +579,11 @@ var GuildInviteFlags;
|
|
|
575
579
|
(function (GuildInviteFlags) {
|
|
576
580
|
GuildInviteFlags[GuildInviteFlags["IsGuestInvite"] = 1] = "IsGuestInvite";
|
|
577
581
|
})(GuildInviteFlags || (exports.GuildInviteFlags = GuildInviteFlags = {}));
|
|
582
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-flags */
|
|
583
|
+
var LobbyMemberFlags;
|
|
584
|
+
(function (LobbyMemberFlags) {
|
|
585
|
+
LobbyMemberFlags[LobbyMemberFlags["CanLinkLobby"] = 1] = "CanLinkLobby";
|
|
586
|
+
})(LobbyMemberFlags || (exports.LobbyMemberFlags = LobbyMemberFlags = {}));
|
|
578
587
|
/** https://discord.com/developers/docs/resources/message#message-object-message-types */
|
|
579
588
|
var MessageTypes;
|
|
580
589
|
(function (MessageTypes) {
|
|
@@ -827,6 +836,7 @@ var GatewayEvents;
|
|
|
827
836
|
(function (GatewayEvents) {
|
|
828
837
|
GatewayEvents["Ready"] = "READY";
|
|
829
838
|
GatewayEvents["Resumed"] = "RESUMED";
|
|
839
|
+
GatewayEvents["RateLimited"] = "RATE_LIMITED";
|
|
830
840
|
GatewayEvents["ApplicationCommandPermissionsUpdate"] = "APPLICATION_COMMAND_PERMISSIONS_UPDATE";
|
|
831
841
|
GatewayEvents["AutoModerationRuleCreate"] = "AUTO_MODERATION_RULE_CREATE";
|
|
832
842
|
GatewayEvents["AutoModerationRuleUpdate"] = "AUTO_MODERATION_RULE_UPDATE";
|
|
@@ -1262,6 +1272,7 @@ var JSONErrorCodes;
|
|
|
1262
1272
|
JSONErrorCodes[JSONErrorCodes["MessageBlockedByHarmfulLinksFilter"] = 240000] = "MessageBlockedByHarmfulLinksFilter";
|
|
1263
1273
|
JSONErrorCodes[JSONErrorCodes["CannotEnableOnboardingRequirementsAreNotMet"] = 350000] = "CannotEnableOnboardingRequirementsAreNotMet";
|
|
1264
1274
|
JSONErrorCodes[JSONErrorCodes["CannotUpdateOnboardingWhileBelowRequirements"] = 350001] = "CannotUpdateOnboardingWhileBelowRequirements";
|
|
1275
|
+
JSONErrorCodes[JSONErrorCodes["AccessToFileUploadsHasBeenLimitedForThisGuild"] = 400001] = "AccessToFileUploadsHasBeenLimitedForThisGuild";
|
|
1265
1276
|
JSONErrorCodes[JSONErrorCodes["FailedToBanUsers"] = 500000] = "FailedToBanUsers";
|
|
1266
1277
|
JSONErrorCodes[JSONErrorCodes["PollVotingBlocked"] = 520000] = "PollVotingBlocked";
|
|
1267
1278
|
JSONErrorCodes[JSONErrorCodes["PollExpired"] = 520001] = "PollExpired";
|
|
@@ -1352,6 +1363,7 @@ exports.BitwisePermissionFlags = {
|
|
|
1352
1363
|
SendVoiceMessages: 1n << 46n,
|
|
1353
1364
|
SendPolls: 1n << 49n,
|
|
1354
1365
|
UseExternalApps: 1n << 50n,
|
|
1366
|
+
PinMessages: 1n << 51n,
|
|
1355
1367
|
};
|
|
1356
1368
|
/** https://discord.com/developers/docs/topics/permissions#role-object-role-flags */
|
|
1357
1369
|
var RoleFlags;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { GatewayEvents } from "../constants";
|
|
2
|
+
import type { RawGuildApplicationCommandPermissions } from "../types/application-command";
|
|
3
|
+
import type { RawAuditLogEntry } from "../types/audit-log";
|
|
4
|
+
import type { RawAutoModerationRule } from "../types/auto-moderation";
|
|
5
|
+
import type { RawChannel, RawThreadMember } from "../types/channel";
|
|
6
|
+
import type { RawEntitlement } from "../types/entitlements";
|
|
7
|
+
import type { RawRateLimitedEvent, RawAutoModerationActionExecutionEvent, RawChannelPinsUpdateEvent, RawThreadListSyncEvent, RawThreadMemberUpdateEventExtra, RawThreadMembersUpdateEvent, RawGuildCreateEventExtra, RawGuildAuditLogEntryCreateExtra, RawGuildBanAddEvent, RawGuildBanRemoveEvent, RawGuildEmojisUpdateEvent, RawGuildStickersUpdateEvent, RawGuildIntegrationsUpdateEvent, RawGuildMemberAddEventExtra, RawGuildMemberRemoveEvent, RawGuildMemberUpdateEvent, RawGuildMembersChunkEvent, RawGuildRoleCreateEvent, RawGuildRoleUpdateEvent, RawGuildRoleDeleteEvent, RawGuildScheduledEventUserAddEvent, RawGuildScheduledEventUserRemoveEvent, RawGuildSoundboardSoundDeleteEvent, RawGuildSoundboardSoundsUpdateEvent, RawGuildSoundboardSoundsEvent, RawIntegrationCreateEventExtra, RawIntegrationUpdateEventExtra, RawIntegrationDeleteEvent, RawInviteCreateEvent, RawInviteDeleteEvent, RawMessageCreateEventExtra, RawMessageDeleteEvent, RawMessageDeleteBulkEvent, RawMessageReactionAddEvent, RawMessageReactionRemoveEvent, RawMessageReactionRemoveAllEvent, RawMessageReactionRemoveEmojiEvent, RawPresenceUpdateEvent, RawTypingStartEvent, RawVoiceChannelEffectSendEvent, RawVoiceServerUpdateEvent, RawWebhooksUpdateEvent, RawMessagePollVoteAddEvent, RawMessagePollVoteRemoveEvent, RawReadyEvent } from "../types/gateway-events";
|
|
8
|
+
import type { RawGuild, RawUnavailableGuild, RawGuildMember, RawIntegration } from "../types/guild";
|
|
9
|
+
import type { RawGuildScheduledEvent } from "../types/guild-scheduled-event";
|
|
10
|
+
import type { RawInteraction } from "../types/interaction";
|
|
11
|
+
import type { RawMessage } from "../types/message";
|
|
12
|
+
import type { RawSoundboardSound } from "../types/soundboard";
|
|
13
|
+
import type { RawStageInstance } from "../types/stage-instance";
|
|
14
|
+
import type { RawSubscription } from "../types/subscription";
|
|
15
|
+
import type { RawUser } from "../types/user";
|
|
16
|
+
import type { RawVoiceState } from "../types/voice";
|
|
17
|
+
import { Shard } from "./Shard";
|
|
18
|
+
export type DispatchHandler<T extends GatewayEvents> = (shard: Shard, data: DispatchEvents[T]) => void;
|
|
19
|
+
export declare class Dispatcher {
|
|
20
|
+
private shard;
|
|
21
|
+
constructor(shard: Shard);
|
|
22
|
+
dispatch<T extends GatewayEvents>(event: T, data: DispatchEvents[T]): void;
|
|
23
|
+
}
|
|
24
|
+
export declare const Handlers: {
|
|
25
|
+
[K in GatewayEvents]?: DispatchHandler<K>;
|
|
26
|
+
};
|
|
27
|
+
export interface DispatchEvents {
|
|
28
|
+
[GatewayEvents.Ready]: RawReadyEvent;
|
|
29
|
+
[GatewayEvents.Resumed]: [];
|
|
30
|
+
[GatewayEvents.RateLimited]: RawRateLimitedEvent;
|
|
31
|
+
[GatewayEvents.ApplicationCommandPermissionsUpdate]: RawGuildApplicationCommandPermissions;
|
|
32
|
+
[GatewayEvents.AutoModerationRuleCreate]: RawAutoModerationRule;
|
|
33
|
+
[GatewayEvents.AutoModerationRuleUpdate]: RawAutoModerationRule;
|
|
34
|
+
[GatewayEvents.AutoModerationRuleDelete]: RawAutoModerationRule;
|
|
35
|
+
[GatewayEvents.AutoModerationActionExecution]: RawAutoModerationActionExecutionEvent;
|
|
36
|
+
[GatewayEvents.ChannelCreate]: RawChannel;
|
|
37
|
+
[GatewayEvents.ChannelUpdate]: RawChannel;
|
|
38
|
+
[GatewayEvents.ChannelDelete]: RawChannel;
|
|
39
|
+
[GatewayEvents.ChannelPinsUpdate]: RawChannelPinsUpdateEvent;
|
|
40
|
+
[GatewayEvents.ThreadCreate]: RawChannel;
|
|
41
|
+
[GatewayEvents.ThreadUpdate]: RawChannel;
|
|
42
|
+
[GatewayEvents.ThreadDelete]: RawChannel;
|
|
43
|
+
[GatewayEvents.ThreadListSync]: RawThreadListSyncEvent;
|
|
44
|
+
[GatewayEvents.ThreadMemberUpdate]: RawThreadMember & RawThreadMemberUpdateEventExtra;
|
|
45
|
+
[GatewayEvents.ThreadMembersUpdate]: RawThreadMembersUpdateEvent;
|
|
46
|
+
[GatewayEvents.EntitlementCreate]: RawEntitlement;
|
|
47
|
+
[GatewayEvents.EntitlementUpdate]: RawEntitlement;
|
|
48
|
+
[GatewayEvents.EntitlementDelete]: RawEntitlement;
|
|
49
|
+
[GatewayEvents.GuildCreate]: (RawGuild & RawGuildCreateEventExtra) | RawUnavailableGuild;
|
|
50
|
+
[GatewayEvents.GuildUpdate]: RawGuild;
|
|
51
|
+
[GatewayEvents.GuildDelete]: RawUnavailableGuild;
|
|
52
|
+
[GatewayEvents.GuildAuditLogEntryCreate]: RawAuditLogEntry & RawGuildAuditLogEntryCreateExtra;
|
|
53
|
+
[GatewayEvents.GuildBanAdd]: RawGuildBanAddEvent;
|
|
54
|
+
[GatewayEvents.GuildBanRemove]: RawGuildBanRemoveEvent;
|
|
55
|
+
[GatewayEvents.GuildEmojisUpdate]: RawGuildEmojisUpdateEvent;
|
|
56
|
+
[GatewayEvents.GuildStickersUpdate]: RawGuildStickersUpdateEvent;
|
|
57
|
+
[GatewayEvents.GuildIntegrationsUpdate]: RawGuildIntegrationsUpdateEvent;
|
|
58
|
+
[GatewayEvents.GuildMemberAdd]: RawGuildMember & RawGuildMemberAddEventExtra;
|
|
59
|
+
[GatewayEvents.GuildMemberRemove]: RawGuildMemberRemoveEvent;
|
|
60
|
+
[GatewayEvents.GuildMemberUpdate]: RawGuildMemberUpdateEvent;
|
|
61
|
+
[GatewayEvents.GuildMembersChunk]: RawGuildMembersChunkEvent;
|
|
62
|
+
[GatewayEvents.GuildRoleCreate]: RawGuildRoleCreateEvent;
|
|
63
|
+
[GatewayEvents.GuildRoleUpdate]: RawGuildRoleUpdateEvent;
|
|
64
|
+
[GatewayEvents.GuildRoleDelete]: RawGuildRoleDeleteEvent;
|
|
65
|
+
[GatewayEvents.GuildScheduledEventCreate]: RawGuildScheduledEvent;
|
|
66
|
+
[GatewayEvents.GuildScheduledEventUpdate]: RawGuildScheduledEvent;
|
|
67
|
+
[GatewayEvents.GuildScheduledEventDelete]: RawGuildScheduledEvent;
|
|
68
|
+
[GatewayEvents.GuildScheduledEventUserAdd]: RawGuildScheduledEventUserAddEvent;
|
|
69
|
+
[GatewayEvents.GuildScheduledEventUserRemove]: RawGuildScheduledEventUserRemoveEvent;
|
|
70
|
+
[GatewayEvents.GuildSoundboardSoundCreate]: RawSoundboardSound;
|
|
71
|
+
[GatewayEvents.GuildSoundboardSoundUpdate]: RawSoundboardSound;
|
|
72
|
+
[GatewayEvents.GuildSoundboardSoundDelete]: RawGuildSoundboardSoundDeleteEvent;
|
|
73
|
+
[GatewayEvents.GuildSoundboardSoundsUpdate]: RawGuildSoundboardSoundsUpdateEvent;
|
|
74
|
+
[GatewayEvents.SoundboardSounds]: RawGuildSoundboardSoundsEvent;
|
|
75
|
+
[GatewayEvents.IntegrationCreate]: RawIntegration & RawIntegrationCreateEventExtra;
|
|
76
|
+
[GatewayEvents.IntegrationUpdate]: RawIntegration & RawIntegrationUpdateEventExtra;
|
|
77
|
+
[GatewayEvents.IntegrationDelete]: RawIntegrationDeleteEvent;
|
|
78
|
+
[GatewayEvents.InteractionCreate]: RawInteraction;
|
|
79
|
+
[GatewayEvents.InviteCreate]: RawInviteCreateEvent;
|
|
80
|
+
[GatewayEvents.InviteDelete]: RawInviteDeleteEvent;
|
|
81
|
+
[GatewayEvents.MessageCreate]: RawMessage & RawMessageCreateEventExtra;
|
|
82
|
+
[GatewayEvents.MessageUpdate]: RawMessage;
|
|
83
|
+
[GatewayEvents.MessageDelete]: RawMessageDeleteEvent;
|
|
84
|
+
[GatewayEvents.MessageDeleteBulk]: RawMessageDeleteBulkEvent;
|
|
85
|
+
[GatewayEvents.MessageReactionAdd]: RawMessageReactionAddEvent;
|
|
86
|
+
[GatewayEvents.MessageReactionRemove]: RawMessageReactionRemoveEvent;
|
|
87
|
+
[GatewayEvents.MessageReactionRemoveAll]: RawMessageReactionRemoveAllEvent;
|
|
88
|
+
[GatewayEvents.MessageReactionRemoveEmoji]: RawMessageReactionRemoveEmojiEvent;
|
|
89
|
+
[GatewayEvents.PresenceUpdate]: RawPresenceUpdateEvent;
|
|
90
|
+
[GatewayEvents.StageInstanceCreate]: RawStageInstance;
|
|
91
|
+
[GatewayEvents.StageInstanceUpdate]: RawStageInstance;
|
|
92
|
+
[GatewayEvents.StageInstanceDelete]: RawStageInstance;
|
|
93
|
+
[GatewayEvents.SubscriptionCreate]: RawSubscription;
|
|
94
|
+
[GatewayEvents.SubscriptionUpdate]: RawSubscription;
|
|
95
|
+
[GatewayEvents.SubscriptionDelete]: RawSubscription;
|
|
96
|
+
[GatewayEvents.TypingStart]: RawTypingStartEvent;
|
|
97
|
+
[GatewayEvents.UserUpdate]: RawUser;
|
|
98
|
+
[GatewayEvents.VoiceChannelEffectSend]: RawVoiceChannelEffectSendEvent;
|
|
99
|
+
[GatewayEvents.VoiceStateUpdate]: RawVoiceState;
|
|
100
|
+
[GatewayEvents.VoiceServerUpdate]: RawVoiceServerUpdateEvent;
|
|
101
|
+
[GatewayEvents.WebhooksUpdate]: RawWebhooksUpdateEvent;
|
|
102
|
+
[GatewayEvents.MessagePollVoteAdd]: RawMessagePollVoteAddEvent;
|
|
103
|
+
[GatewayEvents.MessagePollVoteRemove]: RawMessagePollVoteRemoveEvent;
|
|
104
|
+
}
|