disgroove 2.2.7-dev.8886fa2 → 2.2.7-dev.90fe2f0

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.
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  /// <reference types="node" />
4
- import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type ReactionTypes, type ApplicationCommandTypes, type EventTypes, type TriggerTypes, type ChannelTypes, type VideoQualityModes, type SortOrderTypes, type ForumLayoutTypes, type InviteTargetTypes, type VerificationLevel, type DefaultMessageNotificationLevel, type ExplicitContentFilterLevel, type SystemChannelFlags, type ApplicationFlags, type ApplicationIntegrationTypes, type ChannelFlags, type GuildFeatures, type GuildScheduledEventEntityTypes, type GuildScheduledEventPrivacyLevel, type GuildScheduledEventStatus, type MessageFlags, type OnboardingMode, type PrivacyLevel, type GuildMemberFlags, type InteractionContextTypes } from "./constants";
4
+ import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type ReactionTypes, type ApplicationCommandTypes, type EventTypes, type TriggerTypes, type ChannelTypes, type VideoQualityModes, type SortOrderTypes, type ForumLayoutTypes, type InviteTargetTypes, type VerificationLevel, type DefaultMessageNotificationLevel, type ExplicitContentFilterLevel, type SystemChannelFlags, type ApplicationFlags, type ApplicationIntegrationTypes, type ChannelFlags, type GuildFeatures, type GuildScheduledEventEntityTypes, type GuildScheduledEventPrivacyLevel, type GuildScheduledEventStatus, type MessageFlags, type OnboardingMode, type PrivacyLevel, type GuildMemberFlags, type InteractionContextTypes, type LobbyMemberFlags } from "./constants";
5
5
  import { RequestManager, type FileData } from "./rest";
6
6
  import EventEmitter from "node:events";
7
7
  import { Shard } from "./gateway";
@@ -33,6 +33,7 @@ import type { Embed, AllowedMentions, Attachment, Message, MessageReference, Mes
33
33
  import type { Subscription } from "./types/subscription";
34
34
  import type { SoundboardSound } from "./types/soundboard";
35
35
  import type { ActionRow, Button, ChannelSelect, Container, File, MediaGallery, MentionableSelect, RoleSelect, Section, Separator, StringSelect, TextDisplay, Thumbnail, UserSelect } from "./types/message-components";
36
+ import type { Lobby, LobbyMember } from "./types/lobby";
36
37
  export interface GatewayOptions {
37
38
  properties?: IdentifyConnectionProperties;
38
39
  compress?: boolean;
@@ -78,6 +79,11 @@ export declare class Client extends EventEmitter {
78
79
  }): Promise<GuildMember | null>;
79
80
  /** https://discord.com/developers/docs/resources/guild#add-guild-member-role */
80
81
  addGuildMemberRole(guildID: snowflake, userID: snowflake, roleID: snowflake, reason?: string): void;
82
+ /** https://discord.com/developers/docs/resources/lobby#add-a-member-to-a-lobby */
83
+ addLobbyMember(lobbyID: snowflake, userID: snowflake, options: {
84
+ metadata?: Record<string, string> | null;
85
+ flags?: LobbyMemberFlags;
86
+ }): Promise<LobbyMember>;
81
87
  /** https://discord.com/developers/docs/resources/channel#add-thread-member */
82
88
  addThreadMember(channelID: snowflake, userID: snowflake): void;
83
89
  /** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
@@ -288,6 +294,12 @@ export declare class Client extends EventEmitter {
288
294
  createInteractionResponse(interactionID: snowflake, interactionToken: string, options: InteractionResponse & {
289
295
  withResponse?: boolean;
290
296
  }): Promise<void | InteractionCallbackResponse>;
297
+ /** https://discord.com/developers/docs/resources/lobby#create-lobby */
298
+ createLobby(options: {
299
+ metadata?: Record<string, string> | null;
300
+ members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags">>;
301
+ idleTimeoutSeconds?: number;
302
+ }): Promise<Lobby>;
291
303
  /** https://discord.com/developers/docs/resources/message#create-message */
292
304
  createMessage(channelID: snowflake, options: {
293
305
  content?: string;
@@ -387,6 +399,8 @@ export declare class Client extends EventEmitter {
387
399
  deleteInteractionFollowupMessage(applicationID: snowflake, interactionToken: string, messageID: snowflake): void;
388
400
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response */
389
401
  deleteInteractionResponse(applicationID: snowflake, interactionToken: string): void;
402
+ /** https://discord.com/developers/docs/resources/lobby#delete-lobby */
403
+ deleteLobby(lobbyID: snowflake): void;
390
404
  /** https://discord.com/developers/docs/resources/message#delete-message */
391
405
  deleteMessage(channelID: snowflake, messageID: snowflake, reason?: string): void;
392
406
  /** https://discord.com/developers/docs/resources/message#delete-user-reaction */
@@ -623,6 +637,12 @@ export declare class Client extends EventEmitter {
623
637
  enabled?: boolean;
624
638
  channelID?: boolean;
625
639
  }, reason?: string): Promise<GuildWidgetSettings>;
640
+ /** https://discord.com/developers/docs/resources/lobby#modify-lobby */
641
+ editLobby(lobbyID: snowflake, options: {
642
+ metadata?: Record<string, string> | null;
643
+ members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags">>;
644
+ idleTimeoutSeconds?: number;
645
+ }): Promise<Lobby>;
626
646
  /** https://discord.com/developers/docs/resources/message#edit-message */
627
647
  editMessage(channelID: snowflake, messageID: snowflake, options: {
628
648
  content?: string | null;
@@ -934,6 +954,8 @@ export declare class Client extends EventEmitter {
934
954
  members: Array<ThreadMember>;
935
955
  hasMore: boolean;
936
956
  }>;
957
+ /** https://discord.com/developers/docs/resources/lobby#get-lobby */
958
+ getLobby(lobbyID: snowflake): Promise<Lobby>;
937
959
  /** https://discord.com/developers/docs/resources/message#get-channel-message */
938
960
  getMessage(channelID: snowflake, messageID: snowflake): Promise<Message>;
939
961
  /** https://discord.com/developers/docs/resources/message#get-reactions */
@@ -1023,10 +1045,16 @@ export declare class Client extends EventEmitter {
1023
1045
  }): void;
1024
1046
  /** https://discord.com/developers/docs/resources/user#leave-guild */
1025
1047
  leaveGuild(guildID: snowflake): void;
1048
+ /** https://discord.com/developers/docs/resources/lobby#leave-lobby */
1049
+ leaveLobby(lobbyID: snowflake): void;
1026
1050
  /** https://discord.com/developers/docs/resources/channel#leave-thread */
1027
1051
  leaveThread(channelID: snowflake): void;
1028
1052
  /** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
1029
1053
  leaveVoiceChannel(guildID: snowflake): void;
1054
+ /** discord.com/developers/docs/resources/lobby#link-channel-to-lobby */
1055
+ linkChannel(lobbyID: snowflake, options: {
1056
+ channelID: snowflake;
1057
+ }): Promise<Lobby>;
1030
1058
  /** https://discord.com/developers/docs/resources/channel#pin-message */
1031
1059
  pinMessage(channelID: snowflake, messageID: snowflake, reason?: string): void;
1032
1060
  /** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
@@ -1037,6 +1065,8 @@ export declare class Client extends EventEmitter {
1037
1065
  removeGuildMember(guildID: snowflake, userID: snowflake, reason?: string): void;
1038
1066
  /** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
1039
1067
  removeGuildMemberRole(guildID: snowflake, userID: snowflake, roleID: snowflake, reason?: string): void;
1068
+ /** https://discord.com/developers/docs/resources/lobby#remove-a-member-from-a-lobby */
1069
+ removeLobbyMember(lobbyID: snowflake, userID: snowflake): void;
1040
1070
  /** https://discord.com/developers/docs/resources/channel#remove-thread-member */
1041
1071
  removeThreadMember(channelID: snowflake, userID: snowflake): void;
1042
1072
  /** https://discord.com/developers/docs/resources/guild#search-guild-members */
@@ -1055,6 +1085,8 @@ export declare class Client extends EventEmitter {
1055
1085
  syncGuildTemplate(guildID: snowflake, code: string): Promise<GuildTemplate>;
1056
1086
  /** https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */
1057
1087
  triggerTypingIndicator(channelID: snowflake): void;
1088
+ /** https://discord.com/developers/docs/resources/lobby#unlink-channel-from-lobby */
1089
+ unlinkChannel(lobbyID: snowflake): Promise<Lobby>;
1058
1090
  /** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
1059
1091
  updateApplicationRoleConnectionMetadataRecords(applicationID: snowflake): Promise<Array<ApplicationRoleConnectionMetadata>>;
1060
1092
  /** https://discord.com/developers/docs/resources/user#update-current-user-application-role-connection */
@@ -76,6 +76,13 @@ class Client extends node_events_1.default {
76
76
  reason,
77
77
  });
78
78
  }
79
+ /** https://discord.com/developers/docs/resources/lobby#add-a-member-to-a-lobby */
80
+ async addLobbyMember(lobbyID, userID, options) {
81
+ const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.lobbyMember(lobbyID, userID), {
82
+ json: options,
83
+ });
84
+ return transformers_1.Lobbies.lobbyMemberFromRaw(response);
85
+ }
79
86
  /** https://discord.com/developers/docs/resources/channel#add-thread-member */
80
87
  addThreadMember(channelID, userID) {
81
88
  this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelID, userID));
@@ -580,6 +587,17 @@ class Client extends node_events_1.default {
580
587
  });
581
588
  }
582
589
  }
590
+ /** https://discord.com/developers/docs/resources/lobby#create-lobby */
591
+ async createLobby(options) {
592
+ const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbies(), {
593
+ json: {
594
+ metadata: options.metadata,
595
+ members: options.members,
596
+ idle_timeout_seconds: options.idleTimeoutSeconds,
597
+ },
598
+ });
599
+ return transformers_1.Lobbies.lobbyFromRaw(response);
600
+ }
583
601
  /** https://discord.com/developers/docs/resources/message#create-message */
584
602
  async createMessage(channelID, options) {
585
603
  const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(channelID), {
@@ -806,6 +824,10 @@ class Client extends node_events_1.default {
806
824
  deleteInteractionResponse(applicationID, interactionToken) {
807
825
  this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(applicationID, interactionToken));
808
826
  }
827
+ /** https://discord.com/developers/docs/resources/lobby#delete-lobby */
828
+ deleteLobby(lobbyID) {
829
+ this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobby(lobbyID));
830
+ }
809
831
  /** https://discord.com/developers/docs/resources/message#delete-message */
810
832
  deleteMessage(channelID, messageID, reason) {
811
833
  this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessage(channelID, messageID), {
@@ -1260,6 +1282,17 @@ class Client extends node_events_1.default {
1260
1282
  channelID: response.channel_id,
1261
1283
  };
1262
1284
  }
1285
+ /** https://discord.com/developers/docs/resources/lobby#modify-lobby */
1286
+ async editLobby(lobbyID, options) {
1287
+ const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobby(lobbyID), {
1288
+ json: {
1289
+ metadata: options.metadata,
1290
+ members: options.members,
1291
+ idle_timeout_seconds: options.idleTimeoutSeconds,
1292
+ },
1293
+ });
1294
+ return transformers_1.Lobbies.lobbyFromRaw(response);
1295
+ }
1263
1296
  /** https://discord.com/developers/docs/resources/message#edit-message */
1264
1297
  async editMessage(channelID, messageID, options) {
1265
1298
  const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channelMessage(channelID, messageID), {
@@ -2128,6 +2161,11 @@ class Client extends node_events_1.default {
2128
2161
  hasMore: response.has_more,
2129
2162
  };
2130
2163
  }
2164
+ /** https://discord.com/developers/docs/resources/lobby#get-lobby */
2165
+ async getLobby(lobbyID) {
2166
+ const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobby(lobbyID));
2167
+ return transformers_1.Lobbies.lobbyFromRaw(response);
2168
+ }
2131
2169
  /** https://discord.com/developers/docs/resources/message#get-channel-message */
2132
2170
  async getMessage(channelID, messageID) {
2133
2171
  const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(channelID, messageID));
@@ -2325,6 +2363,10 @@ class Client extends node_events_1.default {
2325
2363
  leaveGuild(guildID) {
2326
2364
  this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userGuild(guildID));
2327
2365
  }
2366
+ /** https://discord.com/developers/docs/resources/lobby#leave-lobby */
2367
+ leaveLobby(lobbyID) {
2368
+ this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(lobbyID));
2369
+ }
2328
2370
  /** https://discord.com/developers/docs/resources/channel#leave-thread */
2329
2371
  leaveThread(channelID) {
2330
2372
  this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelID, "@me"));
@@ -2338,6 +2380,15 @@ class Client extends node_events_1.default {
2338
2380
  selfDeaf: false,
2339
2381
  });
2340
2382
  }
2383
+ /** discord.com/developers/docs/resources/lobby#link-channel-to-lobby */
2384
+ async linkChannel(lobbyID, options) {
2385
+ const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(lobbyID), {
2386
+ json: {
2387
+ channel_id: options.channelID,
2388
+ },
2389
+ });
2390
+ return transformers_1.Lobbies.lobbyFromRaw(response);
2391
+ }
2341
2392
  /** https://discord.com/developers/docs/resources/channel#pin-message */
2342
2393
  pinMessage(channelID, messageID, reason) {
2343
2394
  this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPin(channelID, messageID), {
@@ -2366,6 +2417,10 @@ class Client extends node_events_1.default {
2366
2417
  reason,
2367
2418
  });
2368
2419
  }
2420
+ /** https://discord.com/developers/docs/resources/lobby#remove-a-member-from-a-lobby */
2421
+ removeLobbyMember(lobbyID, userID) {
2422
+ this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(lobbyID, userID));
2423
+ }
2369
2424
  /** https://discord.com/developers/docs/resources/channel#remove-thread-member */
2370
2425
  removeThreadMember(channelID, userID) {
2371
2426
  this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelID, userID));
@@ -2402,6 +2457,11 @@ class Client extends node_events_1.default {
2402
2457
  triggerTypingIndicator(channelID) {
2403
2458
  this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelTyping(channelID));
2404
2459
  }
2460
+ /** https://discord.com/developers/docs/resources/lobby#unlink-channel-from-lobby */
2461
+ async unlinkChannel(lobbyID) {
2462
+ const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(lobbyID));
2463
+ return transformers_1.Lobbies.lobbyFromRaw(response);
2464
+ }
2405
2465
  /** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
2406
2466
  async updateApplicationRoleConnectionMetadataRecords(applicationID) {
2407
2467
  const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationRoleConnectionMetadata(applicationID));
@@ -519,6 +519,10 @@ export declare enum InviteTargetTypes {
519
519
  export declare enum GuildInviteFlags {
520
520
  IsGuestInvite = 1
521
521
  }
522
+ /** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-flags */
523
+ export declare enum LobbyMemberFlags {
524
+ CanLinkLobby = 1
525
+ }
522
526
  /** https://discord.com/developers/docs/resources/message#message-object-message-types */
523
527
  export declare enum MessageTypes {
524
528
  Default = 0,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
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.GuildInviteFlags = exports.InviteTargetTypes = exports.InviteTypes = 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) {
@@ -576,6 +576,11 @@ var GuildInviteFlags;
576
576
  (function (GuildInviteFlags) {
577
577
  GuildInviteFlags[GuildInviteFlags["IsGuestInvite"] = 1] = "IsGuestInvite";
578
578
  })(GuildInviteFlags || (exports.GuildInviteFlags = GuildInviteFlags = {}));
579
+ /** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-flags */
580
+ var LobbyMemberFlags;
581
+ (function (LobbyMemberFlags) {
582
+ LobbyMemberFlags[LobbyMemberFlags["CanLinkLobby"] = 1] = "CanLinkLobby";
583
+ })(LobbyMemberFlags || (exports.LobbyMemberFlags = LobbyMemberFlags = {}));
579
584
  /** https://discord.com/developers/docs/resources/message#message-object-message-types */
580
585
  var MessageTypes;
581
586
  (function (MessageTypes) {
@@ -108,3 +108,7 @@ export declare const stageInstance: (channelID: snowflake) => `stage-instances/$
108
108
  export declare const stageInstances: () => "stage-instances";
109
109
  export declare const sticker: (stickerID: snowflake) => `stickers/${string}`;
110
110
  export declare const voiceRegions: () => "voice/regions";
111
+ export declare const lobbies: () => "lobbies";
112
+ export declare const lobby: (lobbyID: snowflake) => `lobbies/${string}`;
113
+ export declare const lobbyMember: (lobbyID: snowflake, userID?: snowflake | "@me") => `lobbies/${string}/members/${string}`;
114
+ export declare const lobbyChannelLinking: (lobbyID: snowflake) => `lobbies/${string}/channel-linking`;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  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.guildSoundboardSounds = exports.guildSoundboardSound = 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.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
4
  exports.oauth2Application = exports.oauth2Authorize = exports.gatewayBot = 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.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 = void 0;
5
- exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = void 0;
5
+ 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 = void 0;
6
6
  // Guilds
7
7
  const guild = (guildID) => `guilds/${guildID}`;
8
8
  exports.guild = guild;
@@ -242,3 +242,12 @@ const sticker = (stickerID) => `stickers/${stickerID}`;
242
242
  exports.sticker = sticker;
243
243
  const voiceRegions = () => "voice/regions";
244
244
  exports.voiceRegions = voiceRegions;
245
+ // Lobbies
246
+ const lobbies = () => "lobbies";
247
+ exports.lobbies = lobbies;
248
+ const lobby = (lobbyID) => `lobbies/${lobbyID}`;
249
+ exports.lobby = lobby;
250
+ const lobbyMember = (lobbyID, userID = "@me") => `lobbies/${lobbyID}/members/${userID}`;
251
+ exports.lobbyMember = lobbyMember;
252
+ const lobbyChannelLinking = (lobbyID) => `lobbies/${lobbyID}/channel-linking`;
253
+ exports.lobbyChannelLinking = lobbyChannelLinking;
@@ -74,11 +74,59 @@ class Interactions {
74
74
  components: interaction.data?.components?.map((component) => {
75
75
  switch (component.type) {
76
76
  case constants_1.ComponentTypes.ActionRow:
77
- return Components_1.Components.actionRowFromRaw(component);
77
+ return {
78
+ type: constants_1.ComponentTypes.ActionRow,
79
+ components: component.components.map((c) => {
80
+ switch (c.type) {
81
+ case constants_1.ComponentTypes.StringSelect:
82
+ return {
83
+ type: c.type,
84
+ componentType: c.component_type,
85
+ id: c.id,
86
+ customID: c.custom_id,
87
+ values: c.values,
88
+ };
89
+ case constants_1.ComponentTypes.TextInput:
90
+ return {
91
+ type: c.type,
92
+ id: c.id,
93
+ customID: c.custom_id,
94
+ value: c.value,
95
+ };
96
+ }
97
+ }),
98
+ };
78
99
  case constants_1.ComponentTypes.TextDisplay:
79
100
  return Components_1.Components.textDisplayFromRaw(component);
80
- case constants_1.ComponentTypes.Label:
81
- return Components_1.Components.labelFromRaw(component);
101
+ case constants_1.ComponentTypes.Label: {
102
+ let c;
103
+ switch (component.component.type) {
104
+ case constants_1.ComponentTypes.StringSelect:
105
+ c = {
106
+ type: component.component.type,
107
+ componentType: component.component.component_type,
108
+ id: component.component.id,
109
+ customID: component.component.custom_id,
110
+ values: component.component.values,
111
+ };
112
+ break;
113
+ case constants_1.ComponentTypes.TextInput:
114
+ c = {
115
+ type: component.component.type,
116
+ id: component.component.id,
117
+ customID: component.component.custom_id,
118
+ value: component.component.value,
119
+ };
120
+ break;
121
+ }
122
+ return {
123
+ type: component.type,
124
+ id: component.id,
125
+ label: component.label,
126
+ description: component.description,
127
+ component: c,
128
+ };
129
+ }
82
130
  }
83
131
  }),
84
132
  }
@@ -171,11 +219,59 @@ class Interactions {
171
219
  components: interaction.data?.components?.map((component) => {
172
220
  switch (component.type) {
173
221
  case constants_1.ComponentTypes.ActionRow:
174
- return Components_1.Components.actionRowToRaw(component);
222
+ return {
223
+ type: constants_1.ComponentTypes.ActionRow,
224
+ components: component.components.map((c) => {
225
+ switch (c.type) {
226
+ case constants_1.ComponentTypes.StringSelect:
227
+ return {
228
+ type: c.type,
229
+ component_type: c.componentType,
230
+ id: c.id,
231
+ custom_id: c.customID,
232
+ values: c.values,
233
+ };
234
+ case constants_1.ComponentTypes.TextInput:
235
+ return {
236
+ type: c.type,
237
+ id: c.id,
238
+ custom_id: c.customID,
239
+ value: c.value,
240
+ };
241
+ }
242
+ }),
243
+ };
175
244
  case constants_1.ComponentTypes.TextDisplay:
176
245
  return Components_1.Components.textDisplayToRaw(component);
177
- case constants_1.ComponentTypes.Label:
178
- return Components_1.Components.labelToRaw(component);
246
+ case constants_1.ComponentTypes.Label: {
247
+ let c;
248
+ switch (component.component.type) {
249
+ case constants_1.ComponentTypes.StringSelect:
250
+ c = {
251
+ type: component.component.type,
252
+ component_type: component.component.componentType,
253
+ id: component.component.id,
254
+ custom_id: component.component.customID,
255
+ values: component.component.values,
256
+ };
257
+ break;
258
+ case constants_1.ComponentTypes.TextInput:
259
+ c = {
260
+ type: component.component.type,
261
+ id: component.component.id,
262
+ custom_id: component.component.customID,
263
+ value: component.component.value,
264
+ };
265
+ break;
266
+ }
267
+ return {
268
+ type: component.type,
269
+ id: component.id,
270
+ label: component.label,
271
+ description: component.description,
272
+ component: c,
273
+ };
274
+ }
179
275
  }
180
276
  }),
181
277
  }
@@ -0,0 +1,7 @@
1
+ import type { Lobby, LobbyMember, RawLobby, RawLobbyMember } from "../types/lobby";
2
+ export declare class Lobbies {
3
+ static lobbyFromRaw(lobby: RawLobby): Lobby;
4
+ static lobbyMemberFromRaw(lobbyMember: RawLobbyMember): LobbyMember;
5
+ static lobbyMemberToRaw(lobbyMember: LobbyMember): RawLobbyMember;
6
+ static lobbyToRaw(lobby: Lobby): RawLobby;
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Lobbies = void 0;
4
+ class Lobbies {
5
+ static lobbyFromRaw(lobby) {
6
+ return {
7
+ id: lobby.id,
8
+ applicationID: lobby.application_id,
9
+ metadata: lobby.metadata,
10
+ members: lobby.members,
11
+ linkedChannel: lobby.linked_channel,
12
+ };
13
+ }
14
+ static lobbyMemberFromRaw(lobbyMember) {
15
+ return {
16
+ id: lobbyMember.id,
17
+ metadata: lobbyMember.metadata,
18
+ flags: lobbyMember.flags,
19
+ };
20
+ }
21
+ static lobbyMemberToRaw(lobbyMember) {
22
+ return {
23
+ id: lobbyMember.id,
24
+ metadata: lobbyMember.metadata,
25
+ flags: lobbyMember.flags,
26
+ };
27
+ }
28
+ static lobbyToRaw(lobby) {
29
+ return {
30
+ id: lobby.id,
31
+ application_id: lobby.applicationID,
32
+ metadata: lobby.metadata,
33
+ members: lobby.members,
34
+ linked_channel: lobby.linkedChannel,
35
+ };
36
+ }
37
+ }
38
+ exports.Lobbies = Lobbies;
@@ -4,7 +4,7 @@ export * from "./Applications";
4
4
  export * from "./AuditLogs";
5
5
  export * from "./AutoModeration";
6
6
  export * from "./Channels";
7
- export * from "./Components.js";
7
+ export * from "./Components";
8
8
  export * from "./Emojis";
9
9
  export * from "./Entitlements";
10
10
  export * from "./Guilds";
@@ -12,6 +12,7 @@ export * from "./GuildScheduledEvents";
12
12
  export * from "./GuildTemplates";
13
13
  export * from "./Interactions";
14
14
  export * from "./Invites";
15
+ export * from "./Lobbies";
15
16
  export * from "./Messages";
16
17
  export * from "./Polls";
17
18
  export * from "./Presences";
@@ -20,7 +20,7 @@ __exportStar(require("./Applications"), exports);
20
20
  __exportStar(require("./AuditLogs"), exports);
21
21
  __exportStar(require("./AutoModeration"), exports);
22
22
  __exportStar(require("./Channels"), exports);
23
- __exportStar(require("./Components.js"), exports);
23
+ __exportStar(require("./Components"), exports);
24
24
  __exportStar(require("./Emojis"), exports);
25
25
  __exportStar(require("./Entitlements"), exports);
26
26
  __exportStar(require("./Guilds"), exports);
@@ -28,6 +28,7 @@ __exportStar(require("./GuildScheduledEvents"), exports);
28
28
  __exportStar(require("./GuildTemplates"), exports);
29
29
  __exportStar(require("./Interactions"), exports);
30
30
  __exportStar(require("./Invites"), exports);
31
+ __exportStar(require("./Lobbies"), exports);
31
32
  __exportStar(require("./Messages"), exports);
32
33
  __exportStar(require("./Polls"), exports);
33
34
  __exportStar(require("./Presences"), exports);
@@ -6,7 +6,7 @@ import type { snowflake } from "./common";
6
6
  import type { RawEntitlement, Entitlement } from "./entitlements";
7
7
  import type { RawGuildMember, GuildMember, Guild, RawGuild } from "./guild";
8
8
  import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions } from "./message";
9
- import type { ActionRow, Container, File, Label, MediaGallery, RawActionRow, RawContainer, RawFile, RawLabel, RawMediaGallery, RawSection, RawSeparator, RawTextDisplay, Section, Separator, TextDisplay } from "./message-components";
9
+ import type { ActionRow, Container, File, Label, MediaGallery, RawActionRow, RawContainer, RawFile, RawLabel, RawMediaGallery, RawSection, RawSeparator, RawStringSelectInteractionResponse, RawTextDisplay, RawTextInputInteractionResponse, Section, Separator, StringSelectInteractionResponse, TextDisplay, TextInputInteractionResponse } from "./message-components";
10
10
  import type { RawPollCreateParams, PollCreateParams } from "./poll";
11
11
  import type { RawRole, Role } from "./role";
12
12
  import type { RawUser, User } from "./user";
@@ -54,7 +54,12 @@ export interface RawMessageComponentData {
54
54
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure */
55
55
  export interface RawModalSubmitData {
56
56
  custom_id: string;
57
- components: Array<RawActionRow | RawTextDisplay | RawLabel>;
57
+ components: Array<{
58
+ type: ComponentTypes.ActionRow;
59
+ components: Array<RawStringSelectInteractionResponse | RawTextInputInteractionResponse>;
60
+ } | RawTextDisplay | (Omit<RawLabel, "component"> & {
61
+ component: RawStringSelectInteractionResponse | RawTextInputInteractionResponse;
62
+ })>;
58
63
  }
59
64
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
60
65
  export interface RawResolvedData {
@@ -165,7 +170,12 @@ export interface MessageComponentData {
165
170
  }
166
171
  export interface ModalSubmitData {
167
172
  customID: string;
168
- components: Array<ActionRow | TextDisplay | Label>;
173
+ components: Array<{
174
+ type: ComponentTypes.ActionRow;
175
+ components: Array<StringSelectInteractionResponse | TextInputInteractionResponse>;
176
+ } | TextDisplay | (Omit<Label, "component"> & {
177
+ component: StringSelectInteractionResponse | TextInputInteractionResponse;
178
+ })>;
169
179
  }
170
180
  export interface ResolvedData {
171
181
  users?: Record<snowflake, User>;
@@ -0,0 +1,29 @@
1
+ import type { LobbyMemberFlags } from "../constants";
2
+ import type { RawChannel } from "./channel";
3
+ import type { snowflake } from "./common";
4
+ /** https://discord.com/developers/docs/resources/lobby#lobby-object */
5
+ export interface RawLobby {
6
+ id: snowflake;
7
+ application_id: snowflake;
8
+ metadata: Record<string, string> | null;
9
+ members: Array<RawLobbyMember>;
10
+ linked_channel: RawChannel;
11
+ }
12
+ /** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-structure */
13
+ export interface RawLobbyMember {
14
+ id: snowflake;
15
+ metadata?: Record<string, string> | null;
16
+ flags?: LobbyMemberFlags;
17
+ }
18
+ export interface Lobby {
19
+ id: snowflake;
20
+ applicationID: snowflake;
21
+ metadata: Record<string, string> | null;
22
+ members: Array<LobbyMember>;
23
+ linkedChannel: RawChannel;
24
+ }
25
+ export interface LobbyMember {
26
+ id: snowflake;
27
+ metadata?: Record<string, string> | null;
28
+ flags?: LobbyMemberFlags;
29
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,7 @@
1
1
  import type { ButtonStyles, ChannelTypes, ComponentTypes, SeparatorSpacing, TextInputStyles } from "../constants";
2
2
  import type { snowflake } from "./common";
3
3
  import type { RawEmoji, Emoji } from "./emoji";
4
+ import type { RawResolvedData, ResolvedData } from "./interaction";
4
5
  /** https://discord.com/developers/docs/components/reference#action-row-action-row-structure */
5
6
  export interface RawActionRow {
6
7
  type: ComponentTypes.ActionRow;
@@ -31,6 +32,14 @@ export interface RawStringSelect {
31
32
  required?: boolean;
32
33
  disabled?: boolean;
33
34
  }
35
+ /** https://discord.com/developers/docs/components/reference#string-select-string-select-interaction-response-structure */
36
+ export interface RawStringSelectInteractionResponse {
37
+ type: ComponentTypes.StringSelect;
38
+ component_type: ComponentTypes.StringSelect;
39
+ id: number;
40
+ custom_id: string;
41
+ values: Array<string>;
42
+ }
34
43
  /** https://discord.com/developers/docs/components/reference#string-select-select-option-structure */
35
44
  export interface RawSelectOption {
36
45
  label: string;
@@ -52,6 +61,13 @@ export interface RawTextInput {
52
61
  placeholder?: string;
53
62
  label: string;
54
63
  }
64
+ /** https://discord.com/developers/docs/components/reference#text-input-text-input-interaction-response-structure */
65
+ export interface RawTextInputInteractionResponse {
66
+ type: ComponentTypes.TextInput;
67
+ id: number;
68
+ custom_id: string;
69
+ value: string;
70
+ }
55
71
  /** https://discord.com/developers/docs/components/reference#user-select-user-select-structure */
56
72
  export interface RawUserSelect {
57
73
  type: ComponentTypes.UserSelect;
@@ -63,6 +79,14 @@ export interface RawUserSelect {
63
79
  max_values?: number;
64
80
  disabled?: boolean;
65
81
  }
82
+ /** https://discord.com/developers/docs/components/reference#user-select-user-select-interaction-response-structure */
83
+ export interface RawUserSelectInteractionResponse {
84
+ component_type: ComponentTypes.UserSelect;
85
+ id: number;
86
+ custom_id: string;
87
+ resolved: RawResolvedData;
88
+ values: Array<snowflake>;
89
+ }
66
90
  /** https://discord.com/developers/docs/components/reference#user-select-select-default-value-structure */
67
91
  export interface RawDefaultValue {
68
92
  id: snowflake;
@@ -79,6 +103,14 @@ export interface RawRoleSelect {
79
103
  max_values?: number;
80
104
  disabled?: boolean;
81
105
  }
106
+ /** https://discord.com/developers/docs/components/reference#role-select-role-select-interaction-response-structure */
107
+ export interface RawRoleSelectInteractionResponse {
108
+ component_type: ComponentTypes.RoleSelect;
109
+ id: number;
110
+ custom_id: string;
111
+ resolved: RawResolvedData;
112
+ values: Array<snowflake>;
113
+ }
82
114
  /** https://discord.com/developers/docs/components/reference#mentionable-select-mentionable-select-structure */
83
115
  export interface RawMentionableSelect {
84
116
  type: ComponentTypes.MentionableSelect;
@@ -90,6 +122,14 @@ export interface RawMentionableSelect {
90
122
  max_values?: number;
91
123
  disabled?: boolean;
92
124
  }
125
+ /** https://discord.com/developers/docs/components/reference#mentionable-select-mentionable-select-interaction-response-structure */
126
+ export interface RawMentionableSelectInteractionResponse {
127
+ component_type: ComponentTypes.MentionableSelect;
128
+ id: number;
129
+ custom_id: string;
130
+ resolved: RawResolvedData;
131
+ values: Array<snowflake>;
132
+ }
93
133
  /** https://discord.com/developers/docs/components/reference#channel-select-channel-select-structure */
94
134
  export interface RawChannelSelect {
95
135
  type: ComponentTypes.ChannelSelect;
@@ -102,6 +142,14 @@ export interface RawChannelSelect {
102
142
  max_values?: number;
103
143
  disabled?: boolean;
104
144
  }
145
+ /** https://discord.com/developers/docs/components/reference#channel-select-channel-select-interaction-response-structure */
146
+ export interface RawChannelSelectInteractionResponse {
147
+ component_type: ComponentTypes.ChannelSelect;
148
+ id: number;
149
+ custom_id: string;
150
+ resolved: RawResolvedData;
151
+ values: Array<snowflake>;
152
+ }
105
153
  /** https://discord.com/developers/docs/components/reference#section-section-structure */
106
154
  export interface RawSection {
107
155
  type: ComponentTypes.Section;
@@ -203,6 +251,13 @@ export interface StringSelect {
203
251
  required?: boolean;
204
252
  disabled?: boolean;
205
253
  }
254
+ export interface StringSelectInteractionResponse {
255
+ type: ComponentTypes.StringSelect;
256
+ componentType: ComponentTypes.StringSelect;
257
+ id: number;
258
+ customID: string;
259
+ values: Array<string>;
260
+ }
206
261
  export interface SelectOption {
207
262
  label: string;
208
263
  value: string;
@@ -222,6 +277,12 @@ export interface TextInput {
222
277
  placeholder?: string;
223
278
  label: string;
224
279
  }
280
+ export interface TextInputInteractionResponse {
281
+ type: ComponentTypes.TextInput;
282
+ id: number;
283
+ customID: string;
284
+ value: string;
285
+ }
225
286
  export interface UserSelect {
226
287
  type: ComponentTypes.UserSelect;
227
288
  id?: number;
@@ -232,6 +293,13 @@ export interface UserSelect {
232
293
  maxValues?: number;
233
294
  disabled?: boolean;
234
295
  }
296
+ export interface UserSelectInteractionResponse {
297
+ component_type: ComponentTypes.UserSelect;
298
+ id: number;
299
+ customID: string;
300
+ resolved: ResolvedData;
301
+ values: Array<snowflake>;
302
+ }
235
303
  export interface DefaultValue {
236
304
  id: snowflake;
237
305
  type: "user" | "role" | "channel";
@@ -246,6 +314,13 @@ export interface RoleSelect {
246
314
  maxValues?: number;
247
315
  disabled?: boolean;
248
316
  }
317
+ export interface RoleSelectInteractionResponse {
318
+ componentType: ComponentTypes.RoleSelect;
319
+ id: number;
320
+ customID: string;
321
+ resolved: ResolvedData;
322
+ values: Array<snowflake>;
323
+ }
249
324
  export interface MentionableSelect {
250
325
  type: ComponentTypes.MentionableSelect;
251
326
  id?: number;
@@ -256,6 +331,13 @@ export interface MentionableSelect {
256
331
  maxValues?: number;
257
332
  disabled?: boolean;
258
333
  }
334
+ export interface MentionableSelectInteractionResponse {
335
+ componentType: ComponentTypes.MentionableSelect;
336
+ id: number;
337
+ customID: string;
338
+ resolved: ResolvedData;
339
+ values: Array<snowflake>;
340
+ }
259
341
  export interface ChannelSelect {
260
342
  type: ComponentTypes.ChannelSelect;
261
343
  id?: number;
@@ -267,6 +349,13 @@ export interface ChannelSelect {
267
349
  maxValues?: number;
268
350
  disabled?: boolean;
269
351
  }
352
+ export interface ChannelSelectInteractionResponse {
353
+ componentType: ComponentTypes.ChannelSelect;
354
+ id: number;
355
+ customID: string;
356
+ resolved: ResolvedData;
357
+ values: Array<snowflake>;
358
+ }
270
359
  export interface Section {
271
360
  type: ComponentTypes.Section;
272
361
  id?: number;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.2.7-dev.8886fa2",
3
+ "version": "2.2.7-dev.90fe2f0",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.2.7-dev.8886fa2",
3
+ "version": "2.2.7-dev.90fe2f0",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",