disgroove 3.0.1-dev.6d98962 → 3.0.1-dev.7231e6e
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 +1 -1
- package/dist/lib/Client.d.ts +60 -11
- package/dist/lib/Client.js +86 -23
- package/dist/lib/constants.d.ts +26 -7
- package/dist/lib/constants.js +25 -5
- package/dist/lib/gateway/Dispatcher.d.ts +4 -1
- package/dist/lib/gateway/Dispatcher.js +19 -0
- package/dist/lib/gateway/Shard.js +1 -0
- package/dist/lib/gateway/Transmitter.d.ts +3 -1
- package/dist/lib/gateway/Transmitter.js +8 -0
- package/dist/lib/rest/Endpoints.d.ts +6 -1
- package/dist/lib/rest/Endpoints.js +12 -2
- package/dist/lib/rest/RequestManager.d.ts +1 -0
- package/dist/lib/rest/RequestManager.js +2 -3
- package/dist/lib/transformers/ApplicationCommands.js +2 -0
- package/dist/lib/transformers/Applications.js +2 -0
- package/dist/lib/transformers/AuditLogs.js +2 -0
- package/dist/lib/transformers/Channels.d.ts +3 -0
- package/dist/lib/transformers/Channels.js +24 -0
- package/dist/lib/transformers/Components.js +2 -0
- package/dist/lib/transformers/Lobbies.d.ts +3 -1
- package/dist/lib/transformers/Lobbies.js +31 -0
- package/dist/lib/types/application-command.d.ts +2 -0
- package/dist/lib/types/application.d.ts +2 -0
- package/dist/lib/types/audit-log.d.ts +2 -0
- package/dist/lib/types/channel.d.ts +4 -2
- package/dist/lib/types/components.d.ts +4 -2
- package/dist/lib/types/gateway-events.d.ts +63 -1
- package/dist/lib/types/lobby.d.ts +38 -1
- package/dist/lib/types/message.d.ts +20 -0
- package/dist/package.json +4 -3
- package/package.json +5 -4
package/dist/lib/constants.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
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.UnfurledMediaItemFlags = 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.
|
|
5
|
-
exports.EntitlementTypes = exports.SKUFlags = exports.SKUTypes = exports.MembershipState = void 0;
|
|
4
|
+
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.GatewayCapabilities = 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.SearchSortModes = exports.SearchEmbedTypes = exports.SearchHasTypes = exports.AuthorTypes = exports.BaseThemeTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.EmbedMediaFlags = exports.EmbedFlags = exports.EmbedTypes = exports.MessageReferenceTypes = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.LobbyMemberFlags = exports.InviteTargetUsersJobStatusErrorCodes = exports.GuildInviteFlags = exports.InviteTargetTypes = exports.InviteTypes = exports.GuildScheduledEventRecurrenceRuleMonth = void 0;
|
|
5
|
+
exports.EntitlementTypes = exports.SKUFlags = exports.SKUTypes = exports.MembershipState = exports.TeamMemberRoleTypes = void 0;
|
|
6
6
|
/** https://discord.com/developers/docs/reference#message-formatting-timestamp-styles */
|
|
7
7
|
var TimestampStyles;
|
|
8
8
|
(function (TimestampStyles) {
|
|
@@ -302,6 +302,8 @@ var AuditLogEvents;
|
|
|
302
302
|
AuditLogEvents[AuditLogEvents["OnboardingUpdate"] = 167] = "OnboardingUpdate";
|
|
303
303
|
AuditLogEvents[AuditLogEvents["HomeSettingsCreate"] = 190] = "HomeSettingsCreate";
|
|
304
304
|
AuditLogEvents[AuditLogEvents["HomeSettingsUpdate"] = 191] = "HomeSettingsUpdate";
|
|
305
|
+
AuditLogEvents[AuditLogEvents["VoiceChannelStatusUpdate"] = 192] = "VoiceChannelStatusUpdate";
|
|
306
|
+
AuditLogEvents[AuditLogEvents["VoiceChannelStatusDelete"] = 193] = "VoiceChannelStatusDelete";
|
|
305
307
|
})(AuditLogEvents || (exports.AuditLogEvents = AuditLogEvents = {}));
|
|
306
308
|
/** https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types */
|
|
307
309
|
var TriggerTypes;
|
|
@@ -362,6 +364,8 @@ var ChannelFlags;
|
|
|
362
364
|
ChannelFlags[ChannelFlags["Pinned"] = 2] = "Pinned";
|
|
363
365
|
ChannelFlags[ChannelFlags["RequiredTag"] = 16] = "RequiredTag";
|
|
364
366
|
ChannelFlags[ChannelFlags["HideMediaDownloadOptions"] = 32768] = "HideMediaDownloadOptions";
|
|
367
|
+
ChannelFlags[ChannelFlags["ChannelObfuscated"] = 131072] = "ChannelObfuscated";
|
|
368
|
+
ChannelFlags[ChannelFlags["IsSpoilerChannel"] = 2097152] = "IsSpoilerChannel";
|
|
365
369
|
})(ChannelFlags || (exports.ChannelFlags = ChannelFlags = {}));
|
|
366
370
|
/** https://discord.com/developers/docs/resources/channel#channel-object-sort-order-types */
|
|
367
371
|
var SortOrderTypes;
|
|
@@ -649,6 +653,7 @@ var MessageActivityTypes;
|
|
|
649
653
|
MessageActivityTypes[MessageActivityTypes["Spectate"] = 2] = "Spectate";
|
|
650
654
|
MessageActivityTypes[MessageActivityTypes["Listen"] = 3] = "Listen";
|
|
651
655
|
MessageActivityTypes[MessageActivityTypes["JoinRequest"] = 5] = "JoinRequest";
|
|
656
|
+
MessageActivityTypes[MessageActivityTypes["StreamRequest"] = 6] = "StreamRequest";
|
|
652
657
|
})(MessageActivityTypes || (exports.MessageActivityTypes = MessageActivityTypes = {}));
|
|
653
658
|
/** https://discord.com/developers/docs/resources/message#message-object-message-flags */
|
|
654
659
|
var MessageFlags;
|
|
@@ -852,8 +857,8 @@ var VisibilityTypes;
|
|
|
852
857
|
var SubscriptionStatuses;
|
|
853
858
|
(function (SubscriptionStatuses) {
|
|
854
859
|
SubscriptionStatuses[SubscriptionStatuses["Active"] = 0] = "Active";
|
|
855
|
-
SubscriptionStatuses[SubscriptionStatuses["
|
|
856
|
-
SubscriptionStatuses[SubscriptionStatuses["
|
|
860
|
+
SubscriptionStatuses[SubscriptionStatuses["Inactive"] = 1] = "Inactive";
|
|
861
|
+
SubscriptionStatuses[SubscriptionStatuses["Ending"] = 2] = "Ending";
|
|
857
862
|
})(SubscriptionStatuses || (exports.SubscriptionStatuses = SubscriptionStatuses = {}));
|
|
858
863
|
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */
|
|
859
864
|
var WebhookTypes;
|
|
@@ -906,6 +911,11 @@ var StatusTypes;
|
|
|
906
911
|
StatusTypes["Invisible"] = "invisible";
|
|
907
912
|
StatusTypes["Offline"] = "offline";
|
|
908
913
|
})(StatusTypes || (exports.StatusTypes = StatusTypes = {}));
|
|
914
|
+
/** https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities */
|
|
915
|
+
var GatewayCapabilities;
|
|
916
|
+
(function (GatewayCapabilities) {
|
|
917
|
+
GatewayCapabilities[GatewayCapabilities["ChannelObfuscation"] = 32768] = "ChannelObfuscation";
|
|
918
|
+
})(GatewayCapabilities || (exports.GatewayCapabilities = GatewayCapabilities = {}));
|
|
909
919
|
/** https://discord.com/developers/docs/topics/gateway-events#receive-events */
|
|
910
920
|
var GatewayEvents;
|
|
911
921
|
(function (GatewayEvents) {
|
|
@@ -920,6 +930,7 @@ var GatewayEvents;
|
|
|
920
930
|
GatewayEvents["ChannelCreate"] = "CHANNEL_CREATE";
|
|
921
931
|
GatewayEvents["ChannelUpdate"] = "CHANNEL_UPDATE";
|
|
922
932
|
GatewayEvents["ChannelDelete"] = "CHANNEL_DELETE";
|
|
933
|
+
GatewayEvents["ChannelInfo"] = "CHANNEL_INFO";
|
|
923
934
|
GatewayEvents["ChannelPinsUpdate"] = "CHANNEL_PINS_UPDATE";
|
|
924
935
|
GatewayEvents["ThreadCreate"] = "THREAD_CREATE";
|
|
925
936
|
GatewayEvents["ThreadUpdate"] = "THREAD_UPDATE";
|
|
@@ -980,6 +991,8 @@ var GatewayEvents;
|
|
|
980
991
|
GatewayEvents["TypingStart"] = "TYPING_START";
|
|
981
992
|
GatewayEvents["UserUpdate"] = "USER_UPDATE";
|
|
982
993
|
GatewayEvents["VoiceChannelEffectSend"] = "VOICE_CHANNEL_EFFECT_SEND";
|
|
994
|
+
GatewayEvents["VoiceChannelStartTimeUpdate"] = "VOICE_CHANNEL_START_TIME_UPDATE";
|
|
995
|
+
GatewayEvents["VoiceChannelStatusUpdate"] = "VOICE_CHANNEL_STATUS_UPDATE";
|
|
983
996
|
GatewayEvents["VoiceStateUpdate"] = "VOICE_STATE_UPDATE";
|
|
984
997
|
GatewayEvents["VoiceServerUpdate"] = "VOICE_SERVER_UPDATE";
|
|
985
998
|
GatewayEvents["WebhooksUpdate"] = "WEBHOOKS_UPDATE";
|
|
@@ -1036,6 +1049,7 @@ var OAuth2Scopes;
|
|
|
1036
1049
|
OAuth2Scopes["GuildsJoin"] = "guilds.join";
|
|
1037
1050
|
OAuth2Scopes["GuildsMembersRead"] = "guilds.members.read";
|
|
1038
1051
|
OAuth2Scopes["Identify"] = "identify";
|
|
1052
|
+
OAuth2Scopes["IdentifyPremium"] = "identify.premium";
|
|
1039
1053
|
OAuth2Scopes["MessagesRead"] = "messages.read";
|
|
1040
1054
|
OAuth2Scopes["RelationShipsRead"] = "relationships.read";
|
|
1041
1055
|
OAuth2Scopes["RoleConnectionsWrite"] = "role_connections.write";
|
|
@@ -1062,6 +1076,7 @@ var GatewayOPCodes;
|
|
|
1062
1076
|
GatewayOPCodes[GatewayOPCodes["Hello"] = 10] = "Hello";
|
|
1063
1077
|
GatewayOPCodes[GatewayOPCodes["HeartbeatACK"] = 11] = "HeartbeatACK";
|
|
1064
1078
|
GatewayOPCodes[GatewayOPCodes["RequestSoundboardSounds"] = 31] = "RequestSoundboardSounds";
|
|
1079
|
+
GatewayOPCodes[GatewayOPCodes["RequestChannelInfo"] = 43] = "RequestChannelInfo";
|
|
1065
1080
|
})(GatewayOPCodes || (exports.GatewayOPCodes = GatewayOPCodes = {}));
|
|
1066
1081
|
/** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes */
|
|
1067
1082
|
var GatewayCloseEventCodes;
|
|
@@ -1186,8 +1201,8 @@ var JSONErrorCodes;
|
|
|
1186
1201
|
JSONErrorCodes[JSONErrorCodes["OnlyBotsCanUseThisEndpoint"] = 20002] = "OnlyBotsCanUseThisEndpoint";
|
|
1187
1202
|
JSONErrorCodes[JSONErrorCodes["ExplicitContentCannotBeSentToTheDesiredRecipient"] = 20009] = "ExplicitContentCannotBeSentToTheDesiredRecipient";
|
|
1188
1203
|
JSONErrorCodes[JSONErrorCodes["NotAuthorizedToPerformThisActionOnThisApplication"] = 20012] = "NotAuthorizedToPerformThisActionOnThisApplication";
|
|
1204
|
+
JSONErrorCodes[JSONErrorCodes["ThisActionRequiresAPremiumSubscription"] = 20015] = "ThisActionRequiresAPremiumSubscription";
|
|
1189
1205
|
JSONErrorCodes[JSONErrorCodes["ActionCannotBePerformedDueToSlowmodeRateLimit"] = 20016] = "ActionCannotBePerformedDueToSlowmodeRateLimit";
|
|
1190
|
-
JSONErrorCodes[JSONErrorCodes["TheMazeIsntMeantForYou"] = 20017] = "TheMazeIsntMeantForYou";
|
|
1191
1206
|
JSONErrorCodes[JSONErrorCodes["OnlyTheOwnerOfThisAccountCanPerformThisAction"] = 20018] = "OnlyTheOwnerOfThisAccountCanPerformThisAction";
|
|
1192
1207
|
JSONErrorCodes[JSONErrorCodes["AnnouncementEditLimitExceeded"] = 20022] = "AnnouncementEditLimitExceeded";
|
|
1193
1208
|
JSONErrorCodes[JSONErrorCodes["UnderMinimumAge"] = 20024] = "UnderMinimumAge";
|
|
@@ -1236,6 +1251,7 @@ var JSONErrorCodes;
|
|
|
1236
1251
|
JSONErrorCodes[JSONErrorCodes["RequestEntityTooLarge"] = 40005] = "RequestEntityTooLarge";
|
|
1237
1252
|
JSONErrorCodes[JSONErrorCodes["FeatureTemporarilyDisabledServerSide"] = 40006] = "FeatureTemporarilyDisabledServerSide";
|
|
1238
1253
|
JSONErrorCodes[JSONErrorCodes["UserBannedFromThisGuild"] = 40007] = "UserBannedFromThisGuild";
|
|
1254
|
+
JSONErrorCodes[JSONErrorCodes["OnlyOneChannelCanHaveAParentIdModifiedAtATime"] = 40009] = "OnlyOneChannelCanHaveAParentIdModifiedAtATime";
|
|
1239
1255
|
JSONErrorCodes[JSONErrorCodes["ConnectionHasBeenRevoked"] = 40012] = "ConnectionHasBeenRevoked";
|
|
1240
1256
|
JSONErrorCodes[JSONErrorCodes["OnlyConsumableSKUsCanBeConsumed"] = 40018] = "OnlyConsumableSKUsCanBeConsumed";
|
|
1241
1257
|
JSONErrorCodes[JSONErrorCodes["YouCanOnlyDeleteSandboxEntitlements"] = 40019] = "YouCanOnlyDeleteSandboxEntitlements";
|
|
@@ -1319,6 +1335,7 @@ var JSONErrorCodes;
|
|
|
1319
1335
|
JSONErrorCodes[JSONErrorCodes["VoiceMessagesMustHaveSupportingMetadata"] = 50161] = "VoiceMessagesMustHaveSupportingMetadata";
|
|
1320
1336
|
JSONErrorCodes[JSONErrorCodes["VoiceMessagesCannotBeEdited"] = 50162] = "VoiceMessagesCannotBeEdited";
|
|
1321
1337
|
JSONErrorCodes[JSONErrorCodes["CannotDeleteGuildSubscriptionIntegration"] = 50163] = "CannotDeleteGuildSubscriptionIntegration";
|
|
1338
|
+
JSONErrorCodes[JSONErrorCodes["CannotSendVoiceEffectWhenUserIsServerMutedDeafenedOrSuppressed"] = 50167] = "CannotSendVoiceEffectWhenUserIsServerMutedDeafenedOrSuppressed";
|
|
1322
1339
|
JSONErrorCodes[JSONErrorCodes["YouCannotSendVoiceMessagesInThisChannel"] = 50173] = "YouCannotSendVoiceMessagesInThisChannel";
|
|
1323
1340
|
JSONErrorCodes[JSONErrorCodes["TheUserAccountMustFirstBeVerified"] = 50178] = "TheUserAccountMustFirstBeVerified";
|
|
1324
1341
|
JSONErrorCodes[JSONErrorCodes["TheProvidedFileDoesNotHaveAValidDuration"] = 50192] = "TheProvidedFileDoesNotHaveAValidDuration";
|
|
@@ -1337,6 +1354,7 @@ var JSONErrorCodes;
|
|
|
1337
1354
|
JSONErrorCodes[JSONErrorCodes["ThreadLocked"] = 160005] = "ThreadLocked";
|
|
1338
1355
|
JSONErrorCodes[JSONErrorCodes["MaximumActiveThreads"] = 160006] = "MaximumActiveThreads";
|
|
1339
1356
|
JSONErrorCodes[JSONErrorCodes["MaximumActiveAnnouncementThreads"] = 160007] = "MaximumActiveAnnouncementThreads";
|
|
1357
|
+
JSONErrorCodes[JSONErrorCodes["YouCannotForwardAMessageWhoseContentYouCannotRead"] = 160014] = "YouCannotForwardAMessageWhoseContentYouCannotRead";
|
|
1340
1358
|
JSONErrorCodes[JSONErrorCodes["InvalidJSONForUploadedLottieFile"] = 170001] = "InvalidJSONForUploadedLottieFile";
|
|
1341
1359
|
JSONErrorCodes[JSONErrorCodes["UploadedLottiesCannotContainRasterizedImages"] = 170002] = "UploadedLottiesCannotContainRasterizedImages";
|
|
1342
1360
|
JSONErrorCodes[JSONErrorCodes["StickerMaximumFramerateExceeded"] = 170003] = "StickerMaximumFramerateExceeded";
|
|
@@ -1353,6 +1371,7 @@ var JSONErrorCodes;
|
|
|
1353
1371
|
JSONErrorCodes[JSONErrorCodes["WebhooksCanOnlyCreateThreadsInForumChannels"] = 220003] = "WebhooksCanOnlyCreateThreadsInForumChannels";
|
|
1354
1372
|
JSONErrorCodes[JSONErrorCodes["WebhookServicesCannotBeUsedInForumChannels"] = 220004] = "WebhookServicesCannotBeUsedInForumChannels";
|
|
1355
1373
|
JSONErrorCodes[JSONErrorCodes["MessageBlockedByHarmfulLinksFilter"] = 240000] = "MessageBlockedByHarmfulLinksFilter";
|
|
1374
|
+
JSONErrorCodes[JSONErrorCodes["AccessToJoiningNewServersHasBeenLimitedForTheUser"] = 340015] = "AccessToJoiningNewServersHasBeenLimitedForTheUser";
|
|
1356
1375
|
JSONErrorCodes[JSONErrorCodes["CannotEnableOnboardingRequirementsAreNotMet"] = 350000] = "CannotEnableOnboardingRequirementsAreNotMet";
|
|
1357
1376
|
JSONErrorCodes[JSONErrorCodes["CannotUpdateOnboardingWhileBelowRequirements"] = 350001] = "CannotUpdateOnboardingWhileBelowRequirements";
|
|
1358
1377
|
JSONErrorCodes[JSONErrorCodes["AccessToFileUploadsHasBeenLimitedForThisGuild"] = 400001] = "AccessToFileUploadsHasBeenLimitedForThisGuild";
|
|
@@ -1444,6 +1463,7 @@ exports.BitwisePermissionFlags = {
|
|
|
1444
1463
|
CreateEvents: 1n << 44n,
|
|
1445
1464
|
UseExternalSounds: 1n << 45n,
|
|
1446
1465
|
SendVoiceMessages: 1n << 46n,
|
|
1466
|
+
SetVoiceChannelStatus: 1n << 48n,
|
|
1447
1467
|
SendPolls: 1n << 49n,
|
|
1448
1468
|
UseExternalApps: 1n << 50n,
|
|
1449
1469
|
PinMessages: 1n << 51n,
|
|
@@ -4,7 +4,7 @@ import type { RawAuditLogEntry } from "../types/audit-log";
|
|
|
4
4
|
import type { RawAutoModerationRule } from "../types/auto-moderation";
|
|
5
5
|
import type { RawChannel, RawThreadMember } from "../types/channel";
|
|
6
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";
|
|
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, RawChannelInfoEvent, RawVoiceChannelStatusUpdateEvent, RawVoiceChannelStartTimeUpdateEvent } from "../types/gateway-events";
|
|
8
8
|
import type { RawGuild, RawUnavailableGuild, RawGuildMember, RawIntegration } from "../types/guild";
|
|
9
9
|
import type { RawGuildScheduledEvent } from "../types/guild-scheduled-event";
|
|
10
10
|
import type { RawInteraction } from "../types/interaction";
|
|
@@ -36,6 +36,7 @@ export interface DispatchEvents {
|
|
|
36
36
|
[GatewayEvents.ChannelCreate]: RawChannel;
|
|
37
37
|
[GatewayEvents.ChannelUpdate]: RawChannel;
|
|
38
38
|
[GatewayEvents.ChannelDelete]: RawChannel;
|
|
39
|
+
[GatewayEvents.ChannelInfo]: RawChannelInfoEvent;
|
|
39
40
|
[GatewayEvents.ChannelPinsUpdate]: RawChannelPinsUpdateEvent;
|
|
40
41
|
[GatewayEvents.ThreadCreate]: RawChannel;
|
|
41
42
|
[GatewayEvents.ThreadUpdate]: RawChannel;
|
|
@@ -96,6 +97,8 @@ export interface DispatchEvents {
|
|
|
96
97
|
[GatewayEvents.TypingStart]: RawTypingStartEvent;
|
|
97
98
|
[GatewayEvents.UserUpdate]: RawUser;
|
|
98
99
|
[GatewayEvents.VoiceChannelEffectSend]: RawVoiceChannelEffectSendEvent;
|
|
100
|
+
[GatewayEvents.VoiceChannelStatusUpdate]: RawVoiceChannelStatusUpdateEvent;
|
|
101
|
+
[GatewayEvents.VoiceChannelStartTimeUpdate]: RawVoiceChannelStartTimeUpdateEvent;
|
|
99
102
|
[GatewayEvents.VoiceStateUpdate]: RawVoiceState;
|
|
100
103
|
[GatewayEvents.VoiceServerUpdate]: RawVoiceServerUpdateEvent;
|
|
101
104
|
[GatewayEvents.WebhooksUpdate]: RawWebhooksUpdateEvent;
|
|
@@ -67,6 +67,14 @@ exports.Handlers = {
|
|
|
67
67
|
[constants_1.GatewayEvents.ChannelCreate]: (shard, data) => shard.client.emit("channelCreate", transformers_1.Channels.channelFromRaw(data)),
|
|
68
68
|
[constants_1.GatewayEvents.ChannelUpdate]: (shard, data) => shard.client.emit("channelUpdate", transformers_1.Channels.channelFromRaw(data)),
|
|
69
69
|
[constants_1.GatewayEvents.ChannelDelete]: (shard, data) => shard.client.emit("channelDelete", transformers_1.Channels.channelFromRaw(data)),
|
|
70
|
+
[constants_1.GatewayEvents.ChannelInfo]: (shard, data) => shard.client.emit("channelInfo", {
|
|
71
|
+
guildId: data.guild_id,
|
|
72
|
+
channels: data.channels.map((channel) => ({
|
|
73
|
+
id: channel.id,
|
|
74
|
+
status: channel.status,
|
|
75
|
+
voiceStartTime: channel.voice_start_time,
|
|
76
|
+
})),
|
|
77
|
+
}),
|
|
70
78
|
[constants_1.GatewayEvents.ChannelPinsUpdate]: (shard, data) => shard.client.emit("channelPinsUpdate", {
|
|
71
79
|
guildId: data.guild_id,
|
|
72
80
|
channelId: data.channel_id,
|
|
@@ -329,6 +337,7 @@ exports.Handlers = {
|
|
|
329
337
|
? transformers_1.Guilds.guildMemberFromRaw(data.member)
|
|
330
338
|
: undefined,
|
|
331
339
|
mentions: data.mentions.map((mention) => transformers_1.Users.userFromRaw(mention)),
|
|
340
|
+
channelType: data.channel_type,
|
|
332
341
|
});
|
|
333
342
|
},
|
|
334
343
|
[constants_1.GatewayEvents.MessageUpdate]: (shard, data) => {
|
|
@@ -432,6 +441,16 @@ exports.Handlers = {
|
|
|
432
441
|
soundVolume: data.sound_volume,
|
|
433
442
|
});
|
|
434
443
|
},
|
|
444
|
+
[constants_1.GatewayEvents.VoiceChannelStatusUpdate]: (shard, data) => shard.client.emit("voiceChannelStatusUpdate", {
|
|
445
|
+
id: data.id,
|
|
446
|
+
guildId: data.guild_id,
|
|
447
|
+
status: data.status,
|
|
448
|
+
}),
|
|
449
|
+
[constants_1.GatewayEvents.VoiceChannelStartTimeUpdate]: (shard, data) => shard.client.emit("voiceChannelStartTimeUpdate", {
|
|
450
|
+
id: data.id,
|
|
451
|
+
guildId: data.guild_id,
|
|
452
|
+
voiceStartTime: data.voice_start_time,
|
|
453
|
+
}),
|
|
435
454
|
[constants_1.GatewayEvents.VoiceStateUpdate]: (shard, data) => {
|
|
436
455
|
shard.client.emit("voiceStateUpdate", transformers_1.Voice.voiceStateFromRaw(data));
|
|
437
456
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import WebSocket from "ws";
|
|
2
2
|
import { GatewayOPCodes } from "../constants";
|
|
3
|
-
import type { GatewayPresenceUpdate, GatewayVoiceStateUpdate, Identify, RequestGuildMembers, RequestSoundboardSounds, Resume } from "../types/gateway-events";
|
|
3
|
+
import type { GatewayPresenceUpdate, GatewayVoiceStateUpdate, Identify, RequestChannelInfo, RequestGuildMembers, RequestSoundboardSounds, Resume } from "../types/gateway-events";
|
|
4
4
|
export declare class Transmitter {
|
|
5
5
|
private ws;
|
|
6
6
|
constructor(ws: WebSocket | null);
|
|
@@ -13,6 +13,8 @@ export declare class Transmitter {
|
|
|
13
13
|
requestGuildMembers(options: RequestGuildMembers): void;
|
|
14
14
|
/** https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds */
|
|
15
15
|
requestSoundboardSounds(options: RequestSoundboardSounds): void;
|
|
16
|
+
/** https://discord.com/developers/docs/topics/gateway-events#request-channel-info */
|
|
17
|
+
requestChannelInfo(options: RequestChannelInfo): void;
|
|
16
18
|
/** https://discord.com/developers/docs/topics/gateway-events#resume */
|
|
17
19
|
resume(options: Resume): void;
|
|
18
20
|
/** https://discord.com/developers/docs/topics/gateway-events#update-presence */
|
|
@@ -37,6 +37,7 @@ class Transmitter {
|
|
|
37
37
|
shard: options.shard,
|
|
38
38
|
presence: options.presence,
|
|
39
39
|
intents: options.intents,
|
|
40
|
+
capabilities: options.capabilities,
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
43
|
/** https://discord.com/developers/docs/topics/gateway-events#request-guild-members */
|
|
@@ -56,6 +57,13 @@ class Transmitter {
|
|
|
56
57
|
guild_ids: options.guildIds,
|
|
57
58
|
});
|
|
58
59
|
}
|
|
60
|
+
/** https://discord.com/developers/docs/topics/gateway-events#request-channel-info */
|
|
61
|
+
requestChannelInfo(options) {
|
|
62
|
+
this.send(constants_1.GatewayOPCodes.RequestChannelInfo, {
|
|
63
|
+
guild_id: options.guildId,
|
|
64
|
+
fields: options.fields,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
59
67
|
/** https://discord.com/developers/docs/topics/gateway-events#resume */
|
|
60
68
|
resume(options) {
|
|
61
69
|
this.send(constants_1.GatewayOPCodes.Resume, {
|
|
@@ -60,13 +60,14 @@ export declare const channelPermission: (channelId: snowflake, overwriteId: snow
|
|
|
60
60
|
export declare const channelPin: (channelId: snowflake, messageId: snowflake) => `channels/${string}/messages/pins/${string}`;
|
|
61
61
|
export declare const channelPins: (channelId: snowflake) => `channels/${string}/messages/pins`;
|
|
62
62
|
export declare const channelRecipient: (channelId: snowflake, userId: snowflake) => `channels/${string}/recipients/${string}`;
|
|
63
|
-
export declare const channelThreads: (channelId: snowflake, archivedStatus: "public" | "private", joined: boolean) => `channels/${string}/threads/archived/
|
|
63
|
+
export declare const channelThreads: (channelId: snowflake, archivedStatus: "public" | "private", joined: boolean) => `channels/${string}/threads/archived/public` | `channels/${string}/threads/archived/private`;
|
|
64
64
|
export declare const channelTyping: (channelId: snowflake) => `channels/${string}/typing`;
|
|
65
65
|
export declare const channelWebhooks: (channelId: snowflake) => `channels/${string}/webhooks`;
|
|
66
66
|
export declare const threads: (channelId: snowflake, messageId?: snowflake) => `channels/${string}/threads`;
|
|
67
67
|
export declare const threadMembers: (threadId: snowflake, userId?: snowflake | "@me") => `channels/${string}/thread-members` | `channels/${string}/thread-members/${string}`;
|
|
68
68
|
export declare const pollAnswerVoters: (channelId: snowflake, messageId: snowflake, answerId: snowflake) => `channels/${string}/polls/${string}/answers/${string}`;
|
|
69
69
|
export declare const pollExpire: (channelId: snowflake, messageId: snowflake) => `channels/${string}/polls/${string}/expire`;
|
|
70
|
+
export declare const channelVoiceStatus: (channelId: snowflake) => `channels/${string}/voice-status`;
|
|
70
71
|
export declare const user: (userId?: snowflake | "@me") => `users/${string}`;
|
|
71
72
|
export declare const userApplicationRoleConnection: (applicationId: snowflake) => `users/@me/applications/${string}/role-connection`;
|
|
72
73
|
export declare const userChannels: () => "users/@me/channels";
|
|
@@ -112,7 +113,11 @@ export declare const sticker: (stickerId: snowflake) => `stickers/${string}`;
|
|
|
112
113
|
export declare const voiceRegions: () => "voice/regions";
|
|
113
114
|
export declare const lobbies: () => "lobbies";
|
|
114
115
|
export declare const lobby: (lobbyId: snowflake) => `lobbies/${string}`;
|
|
116
|
+
export declare const lobbyMessages: (lobbyId: snowflake) => `lobbies/${string}/messages`;
|
|
115
117
|
export declare const lobbyMember: (lobbyId: snowflake, userId?: snowflake | "@me") => `lobbies/${string}/members/${string}`;
|
|
118
|
+
export declare const lobbyChannelInvite: (lobbyId: snowflake, userId?: snowflake | "@me") => `lobbies/${string}/members/${string}/invites`;
|
|
116
119
|
export declare const lobbyChannelLinking: (lobbyId: snowflake) => `lobbies/${string}/channel-linking`;
|
|
120
|
+
export declare const lobbyMembersBulk: (lobbyId: snowflake) => `lobbies/${string}/members/bulk`;
|
|
121
|
+
export declare const lobbyMessageModerationMetadata: (lobbyId: snowflake, messageId: snowflake) => `lobbies/${string}/messages/${string}/moderation-metadata`;
|
|
117
122
|
export declare const inviteTargetUsers: (inviteCode: string) => `invites/${string}/target-users`;
|
|
118
123
|
export declare const inviteTargetUsersJobStatus: (inviteCode: string) => `invites/${string}/target-users/job-status`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
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.guildSoundboardSounds = exports.guildSoundboardSound = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRoleMemberCounts = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMessagesSearch = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildIncidentsActions = exports.guildEmojis = exports.guildEmoji = exports.guildMemberNickname = exports.guildChannels = exports.guildBulkBan = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.inviteTargetUsersJobStatus = exports.inviteTargetUsers = exports.lobbyChannelLinking = exports.lobbyMember = exports.lobby = exports.lobbies = exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = exports.oauth2Application = exports.oauth2Authorize = void 0;
|
|
4
|
+
exports.gateway = exports.soundboardDefaultSounds = exports.sendSoundboardSound = exports.skuSubscriptions = exports.skuSubscription = exports.stickerPacks = exports.stickerPack = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSKUs = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlementConsume = exports.applicationEntitlement = exports.applicationEmojis = exports.applicationEmoji = exports.applicationUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.applicationActivityInstance = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.channelVoiceStatus = 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 = exports.channelMessageCrosspost = exports.channelMessageAllReactions = exports.channelMessage = exports.channelInvites = exports.channelFollowers = void 0;
|
|
5
|
+
exports.inviteTargetUsersJobStatus = exports.inviteTargetUsers = exports.lobbyMessageModerationMetadata = exports.lobbyMembersBulk = exports.lobbyChannelLinking = exports.lobbyChannelInvite = exports.lobbyMember = exports.lobbyMessages = exports.lobby = exports.lobbies = exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = exports.oauth2Application = exports.oauth2Authorize = exports.gatewayBot = void 0;
|
|
6
6
|
// Guilds
|
|
7
7
|
const guild = (guildId) => `guilds/${guildId}`;
|
|
8
8
|
exports.guild = guild;
|
|
@@ -149,6 +149,8 @@ const pollAnswerVoters = (channelId, messageId, answerId) => `channels/${channel
|
|
|
149
149
|
exports.pollAnswerVoters = pollAnswerVoters;
|
|
150
150
|
const pollExpire = (channelId, messageId) => `channels/${channelId}/polls/${messageId}/expire`;
|
|
151
151
|
exports.pollExpire = pollExpire;
|
|
152
|
+
const channelVoiceStatus = (channelId) => `channels/${channelId}/voice-status`;
|
|
153
|
+
exports.channelVoiceStatus = channelVoiceStatus;
|
|
152
154
|
// Users
|
|
153
155
|
const user = (userId = "@me") => `users/${userId}`;
|
|
154
156
|
exports.user = user;
|
|
@@ -251,10 +253,18 @@ const lobbies = () => "lobbies";
|
|
|
251
253
|
exports.lobbies = lobbies;
|
|
252
254
|
const lobby = (lobbyId) => `lobbies/${lobbyId}`;
|
|
253
255
|
exports.lobby = lobby;
|
|
256
|
+
const lobbyMessages = (lobbyId) => `lobbies/${lobbyId}/messages`;
|
|
257
|
+
exports.lobbyMessages = lobbyMessages;
|
|
254
258
|
const lobbyMember = (lobbyId, userId = "@me") => `lobbies/${lobbyId}/members/${userId}`;
|
|
255
259
|
exports.lobbyMember = lobbyMember;
|
|
260
|
+
const lobbyChannelInvite = (lobbyId, userId = "@me") => `lobbies/${lobbyId}/members/${userId}/invites`;
|
|
261
|
+
exports.lobbyChannelInvite = lobbyChannelInvite;
|
|
256
262
|
const lobbyChannelLinking = (lobbyId) => `lobbies/${lobbyId}/channel-linking`;
|
|
257
263
|
exports.lobbyChannelLinking = lobbyChannelLinking;
|
|
264
|
+
const lobbyMembersBulk = (lobbyId) => `lobbies/${lobbyId}/members/bulk`;
|
|
265
|
+
exports.lobbyMembersBulk = lobbyMembersBulk;
|
|
266
|
+
const lobbyMessageModerationMetadata = (lobbyId, messageId) => `lobbies/${lobbyId}/messages/${messageId}/moderation-metadata`;
|
|
267
|
+
exports.lobbyMessageModerationMetadata = lobbyMessageModerationMetadata;
|
|
258
268
|
// Invites
|
|
259
269
|
const inviteTargetUsers = (inviteCode) => `invites/${inviteCode}/target-users`;
|
|
260
270
|
exports.inviteTargetUsers = inviteTargetUsers;
|
|
@@ -123,9 +123,8 @@ class RequestManager {
|
|
|
123
123
|
resolve(null);
|
|
124
124
|
}
|
|
125
125
|
else {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
resolve(blob);
|
|
126
|
+
if (data?.returnsBlob) {
|
|
127
|
+
resolve((await response.blob));
|
|
129
128
|
}
|
|
130
129
|
resolve((await response.json()));
|
|
131
130
|
}
|
|
@@ -64,6 +64,7 @@ class ApplicationCommands {
|
|
|
64
64
|
min_length: option.minLength,
|
|
65
65
|
max_length: option.maxLength,
|
|
66
66
|
autocomplete: option.autocomplete,
|
|
67
|
+
file_types: option.fileTypes,
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
70
|
static optionFromRaw(option) {
|
|
@@ -86,6 +87,7 @@ class ApplicationCommands {
|
|
|
86
87
|
minLength: option.min_length,
|
|
87
88
|
maxLength: option.max_length,
|
|
88
89
|
autocomplete: option.autocomplete,
|
|
90
|
+
fileTypes: option.file_types,
|
|
89
91
|
};
|
|
90
92
|
}
|
|
91
93
|
}
|
|
@@ -29,6 +29,7 @@ class Applications {
|
|
|
29
29
|
slug: application.slug,
|
|
30
30
|
coverImage: application.cover_image,
|
|
31
31
|
flags: application.flags,
|
|
32
|
+
flagsNew: application.flags_new,
|
|
32
33
|
approximateGuildCount: application.approximate_guild_count,
|
|
33
34
|
approximateUserInstallCount: application.approximate_user_install_count,
|
|
34
35
|
approximateUserAuthorizationCount: application.approximate_user_authorization_count,
|
|
@@ -79,6 +80,7 @@ class Applications {
|
|
|
79
80
|
slug: application.slug,
|
|
80
81
|
cover_image: application.coverImage,
|
|
81
82
|
flags: application.flags,
|
|
83
|
+
flags_new: application.flagsNew,
|
|
82
84
|
approximate_guild_count: application.approximateGuildCount,
|
|
83
85
|
approximate_user_install_count: application.approximateUserInstallCount,
|
|
84
86
|
approximate_user_authorization_count: application.approximateUserAuthorizationCount,
|
|
@@ -34,6 +34,7 @@ class AuditLogs {
|
|
|
34
34
|
roleName: auditLogEntry.options.role_name,
|
|
35
35
|
type: auditLogEntry.options.type,
|
|
36
36
|
integrationType: auditLogEntry.options.integration_type,
|
|
37
|
+
status: auditLogEntry.options.status
|
|
37
38
|
}
|
|
38
39
|
: undefined,
|
|
39
40
|
reason: auditLogEntry.reason,
|
|
@@ -64,6 +65,7 @@ class AuditLogs {
|
|
|
64
65
|
role_name: auditLogEntry.options.roleName,
|
|
65
66
|
type: auditLogEntry.options.type,
|
|
66
67
|
integration_type: auditLogEntry.options.integrationType,
|
|
68
|
+
status: auditLogEntry.options.status
|
|
67
69
|
}
|
|
68
70
|
: undefined,
|
|
69
71
|
reason: auditLogEntry.reason,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { RawChannel, Channel, RawThreadMember, ThreadMember } from "../types/channel";
|
|
2
|
+
import { AttachmentRequest, RawAttachmentRequest } from "../types/message";
|
|
2
3
|
export declare class Channels {
|
|
3
4
|
static channelFromRaw(channel: RawChannel): Channel;
|
|
4
5
|
static channelToRaw(channel: Channel): RawChannel;
|
|
5
6
|
static threadMemberFromRaw(threadMember: RawThreadMember): ThreadMember;
|
|
6
7
|
static threadMemberToRaw(threadMember: ThreadMember): RawThreadMember;
|
|
8
|
+
static attachmentRequestFromRaw(attachmentRequest: RawAttachmentRequest): AttachmentRequest;
|
|
9
|
+
static attachmentRequestToRaw(attachmentRequest: AttachmentRequest): RawAttachmentRequest;
|
|
7
10
|
}
|
|
@@ -49,6 +49,7 @@ class Channels {
|
|
|
49
49
|
: undefined,
|
|
50
50
|
defaultAutoArchiveDuration: channel.default_auto_archive_duration,
|
|
51
51
|
permissions: channel.permissions,
|
|
52
|
+
appPermissions: channel.app_permissions,
|
|
52
53
|
flags: channel.flags,
|
|
53
54
|
totalMessageSent: channel.total_message_sent,
|
|
54
55
|
availableTags: channel.available_tags?.map((availableTag) => ({
|
|
@@ -117,6 +118,7 @@ class Channels {
|
|
|
117
118
|
: undefined,
|
|
118
119
|
default_auto_archive_duration: channel.defaultAutoArchiveDuration,
|
|
119
120
|
permissions: channel.permissions,
|
|
121
|
+
app_permissions: channel.appPermissions,
|
|
120
122
|
flags: channel.flags,
|
|
121
123
|
total_message_sent: channel.totalMessageSent,
|
|
122
124
|
available_tags: channel.availableTags?.map((availableTag) => ({
|
|
@@ -162,5 +164,27 @@ class Channels {
|
|
|
162
164
|
: undefined,
|
|
163
165
|
};
|
|
164
166
|
}
|
|
167
|
+
static attachmentRequestFromRaw(attachmentRequest) {
|
|
168
|
+
return {
|
|
169
|
+
id: attachmentRequest.id,
|
|
170
|
+
filename: attachmentRequest.filename,
|
|
171
|
+
title: attachmentRequest.title,
|
|
172
|
+
description: attachmentRequest.description,
|
|
173
|
+
durationSecs: attachmentRequest.duration_secs,
|
|
174
|
+
waveform: attachmentRequest.waveform,
|
|
175
|
+
isSpoiler: attachmentRequest.is_spoiler,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
static attachmentRequestToRaw(attachmentRequest) {
|
|
179
|
+
return {
|
|
180
|
+
id: attachmentRequest.id,
|
|
181
|
+
filename: attachmentRequest.filename,
|
|
182
|
+
title: attachmentRequest.title,
|
|
183
|
+
description: attachmentRequest.description,
|
|
184
|
+
duration_secs: attachmentRequest.durationSecs,
|
|
185
|
+
waveform: attachmentRequest.waveform,
|
|
186
|
+
is_spoiler: attachmentRequest.isSpoiler,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
165
189
|
}
|
|
166
190
|
exports.Channels = Channels;
|
|
@@ -229,6 +229,7 @@ class Components {
|
|
|
229
229
|
minValues: fileUpload.min_values,
|
|
230
230
|
maxValues: fileUpload.max_values,
|
|
231
231
|
required: fileUpload.required,
|
|
232
|
+
fileTypes: fileUpload.file_types,
|
|
232
233
|
};
|
|
233
234
|
}
|
|
234
235
|
static fileUploadToRaw(fileUpload) {
|
|
@@ -239,6 +240,7 @@ class Components {
|
|
|
239
240
|
min_values: fileUpload.minValues,
|
|
240
241
|
max_values: fileUpload.maxValues,
|
|
241
242
|
required: fileUpload.required,
|
|
243
|
+
file_types: fileUpload.fileTypes,
|
|
242
244
|
};
|
|
243
245
|
}
|
|
244
246
|
static labelFromRaw(label) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { Lobby, LobbyMember, RawLobby, RawLobbyMember } from "../types/lobby";
|
|
1
|
+
import type { Lobby, LobbyMember, LobbyMessage, RawLobby, RawLobbyMember, RawLobbyMessage } from "../types/lobby";
|
|
2
2
|
export declare class Lobbies {
|
|
3
3
|
static lobbyFromRaw(lobby: RawLobby): Lobby;
|
|
4
4
|
static lobbyMemberFromRaw(lobbyMember: RawLobbyMember): LobbyMember;
|
|
5
5
|
static lobbyMemberToRaw(lobbyMember: LobbyMember): RawLobbyMember;
|
|
6
|
+
static lobbyMessageFromRaw(lobbyMessage: RawLobbyMessage): LobbyMessage;
|
|
7
|
+
static lobbyMessageToRaw(lobbyMessage: LobbyMessage): RawLobbyMessage;
|
|
6
8
|
static lobbyToRaw(lobby: Lobby): RawLobby;
|
|
7
9
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Lobbies = void 0;
|
|
4
|
+
const Users_1 = require("./Users");
|
|
4
5
|
class Lobbies {
|
|
5
6
|
static lobbyFromRaw(lobby) {
|
|
6
7
|
return {
|
|
@@ -16,6 +17,7 @@ class Lobbies {
|
|
|
16
17
|
id: lobbyMember.id,
|
|
17
18
|
metadata: lobbyMember.metadata,
|
|
18
19
|
flags: lobbyMember.flags,
|
|
20
|
+
additionalName: lobbyMember.additional_name,
|
|
19
21
|
};
|
|
20
22
|
}
|
|
21
23
|
static lobbyMemberToRaw(lobbyMember) {
|
|
@@ -23,6 +25,35 @@ class Lobbies {
|
|
|
23
25
|
id: lobbyMember.id,
|
|
24
26
|
metadata: lobbyMember.metadata,
|
|
25
27
|
flags: lobbyMember.flags,
|
|
28
|
+
additional_name: lobbyMember.additionalName,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
static lobbyMessageFromRaw(lobbyMessage) {
|
|
32
|
+
return {
|
|
33
|
+
id: lobbyMessage.id,
|
|
34
|
+
type: lobbyMessage.type,
|
|
35
|
+
content: lobbyMessage.content,
|
|
36
|
+
lobbyId: lobbyMessage.lobby_id,
|
|
37
|
+
channelId: lobbyMessage.channel_id,
|
|
38
|
+
author: Users_1.Users.userFromRaw(lobbyMessage.author),
|
|
39
|
+
metadata: lobbyMessage.metadata,
|
|
40
|
+
moderationMetadata: lobbyMessage.moderation_metadata,
|
|
41
|
+
flags: lobbyMessage.flags,
|
|
42
|
+
applicationId: lobbyMessage.application_id,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
static lobbyMessageToRaw(lobbyMessage) {
|
|
46
|
+
return {
|
|
47
|
+
id: lobbyMessage.id,
|
|
48
|
+
type: lobbyMessage.type,
|
|
49
|
+
content: lobbyMessage.content,
|
|
50
|
+
lobby_id: lobbyMessage.lobbyId,
|
|
51
|
+
channel_id: lobbyMessage.channelId,
|
|
52
|
+
author: Users_1.Users.userToRaw(lobbyMessage.author),
|
|
53
|
+
metadata: lobbyMessage.metadata,
|
|
54
|
+
moderation_metadata: lobbyMessage.moderationMetadata,
|
|
55
|
+
flags: lobbyMessage.flags,
|
|
56
|
+
application_id: lobbyMessage.applicationId,
|
|
26
57
|
};
|
|
27
58
|
}
|
|
28
59
|
static lobbyToRaw(lobby) {
|
|
@@ -36,6 +36,7 @@ export interface RawApplicationCommandOption {
|
|
|
36
36
|
min_length?: number;
|
|
37
37
|
max_length?: number;
|
|
38
38
|
autocomplete?: boolean;
|
|
39
|
+
file_types?: Array<"image" | "video" | "audio" | string>;
|
|
39
40
|
}
|
|
40
41
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */
|
|
41
42
|
export interface RawApplicationCommandOptionChoice {
|
|
@@ -92,6 +93,7 @@ export interface ApplicationCommandOption {
|
|
|
92
93
|
minLength?: number;
|
|
93
94
|
maxLength?: number;
|
|
94
95
|
autocomplete?: boolean;
|
|
96
|
+
fileTypes?: Array<"image" | "video" | "audio" | string>;
|
|
95
97
|
}
|
|
96
98
|
/** https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure */
|
|
97
99
|
export interface ApplicationCommandOptionChoice {
|
|
@@ -23,6 +23,7 @@ export interface RawApplication {
|
|
|
23
23
|
slug?: string;
|
|
24
24
|
cover_image?: string;
|
|
25
25
|
flags?: ApplicationFlags;
|
|
26
|
+
flags_new?: string;
|
|
26
27
|
approximate_guild_count?: number;
|
|
27
28
|
approximate_user_install_count?: number;
|
|
28
29
|
approximate_user_authorization_count?: number;
|
|
@@ -81,6 +82,7 @@ export interface Application {
|
|
|
81
82
|
slug?: string;
|
|
82
83
|
coverImage?: string;
|
|
83
84
|
flags?: ApplicationFlags;
|
|
85
|
+
flagsNew?: string;
|
|
84
86
|
approximateGuildCount?: number;
|
|
85
87
|
approximateUserInstallCount?: number;
|
|
86
88
|
approximateUserAuthorizationCount?: number;
|
|
@@ -42,6 +42,7 @@ export interface RawOptionalAuditLogEntryInfo {
|
|
|
42
42
|
role_name: string;
|
|
43
43
|
type: string;
|
|
44
44
|
integration_type: string;
|
|
45
|
+
status: string;
|
|
45
46
|
}
|
|
46
47
|
/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */
|
|
47
48
|
export interface RawAuditLogChange {
|
|
@@ -84,6 +85,7 @@ export interface OptionalAuditLogEntryInfo {
|
|
|
84
85
|
roleName: string;
|
|
85
86
|
type: string;
|
|
86
87
|
integrationType: string;
|
|
88
|
+
status: string;
|
|
87
89
|
}
|
|
88
90
|
/** https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */
|
|
89
91
|
export interface AuditLogChange {
|