disgroove 3.0.1-dev.6e60c8d → 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.
Files changed (39) hide show
  1. package/LICENSE +1 -1
  2. package/dist/lib/Client.d.ts +95 -11
  3. package/dist/lib/Client.js +133 -23
  4. package/dist/lib/constants.d.ts +89 -9
  5. package/dist/lib/constants.js +95 -5
  6. package/dist/lib/gateway/Dispatcher.d.ts +4 -1
  7. package/dist/lib/gateway/Dispatcher.js +25 -1
  8. package/dist/lib/gateway/Shard.js +1 -0
  9. package/dist/lib/gateway/Transmitter.d.ts +3 -1
  10. package/dist/lib/gateway/Transmitter.js +8 -0
  11. package/dist/lib/rest/Endpoints.d.ts +7 -1
  12. package/dist/lib/rest/Endpoints.js +15 -3
  13. package/dist/lib/rest/RequestManager.d.ts +1 -0
  14. package/dist/lib/rest/RequestManager.js +2 -3
  15. package/dist/lib/transformers/ApplicationCommands.js +2 -0
  16. package/dist/lib/transformers/Applications.js +2 -0
  17. package/dist/lib/transformers/AuditLogs.js +2 -0
  18. package/dist/lib/transformers/Channels.d.ts +3 -0
  19. package/dist/lib/transformers/Channels.js +24 -0
  20. package/dist/lib/transformers/Components.d.ts +1 -1
  21. package/dist/lib/transformers/Components.js +10 -0
  22. package/dist/lib/transformers/Guilds.js +10 -0
  23. package/dist/lib/transformers/Lobbies.d.ts +3 -1
  24. package/dist/lib/transformers/Lobbies.js +31 -0
  25. package/dist/lib/transformers/Messages.d.ts +1 -1
  26. package/dist/lib/transformers/Messages.js +78 -20
  27. package/dist/lib/transformers/Users.d.ts +3 -1
  28. package/dist/lib/transformers/Users.js +16 -10
  29. package/dist/lib/types/application-command.d.ts +2 -0
  30. package/dist/lib/types/application.d.ts +4 -2
  31. package/dist/lib/types/audit-log.d.ts +2 -0
  32. package/dist/lib/types/channel.d.ts +4 -2
  33. package/dist/lib/types/components.d.ts +11 -3
  34. package/dist/lib/types/gateway-events.d.ts +66 -2
  35. package/dist/lib/types/guild.d.ts +3 -1
  36. package/dist/lib/types/lobby.d.ts +38 -1
  37. package/dist/lib/types/message.d.ts +86 -1
  38. package/dist/package.json +4 -3
  39. package/package.json +5 -4
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright © 2024 XenKys
3
+ Copyright © 2026 Sergio Gotuzzo
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -1,4 +1,4 @@
1
- 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, InviteTargetUsersJobStatusErrorCodes } from "./constants";
1
+ 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, type InviteTargetUsersJobStatusErrorCodes, type AuthorTypes, type SearchHasTypes, type SearchEmbedTypes, type SearchSortModes, EntryPointCommandHandlerTypes, GatewayCapabilities } from "./constants";
2
2
  import { RequestManager, type FileData } from "./rest";
3
3
  import EventEmitter from "node:events";
4
4
  import { Shard } from "./gateway";
@@ -11,7 +11,7 @@ import type { Channel, FollowedChannel, ThreadMember, Overwrite, DefaultReaction
11
11
  import type { LocaleMap, snowflake, timestamp } from "./types/common";
12
12
  import type { Emoji } from "./types/emoji";
13
13
  import type { Entitlement } from "./types/entitlements";
14
- import type { AutoModerationActionExecutionEvent, ChannelPinsUpdateEvent, ThreadListSyncEvent, ThreadMemberUpdateEventExtra, ThreadMembersUpdateEvent, GuildCreateEventExtra, GuildAuditLogEntryCreateExtra, GuildBanAddEvent, GuildBanRemoveEvent, GuildMemberAddEventExtra, GuildMemberRemoveEvent, GuildMemberUpdateEvent, GuildMembersChunkEvent, IntegrationCreateEventExtra, IntegrationUpdateEventExtra, IntegrationDeleteEvent, InviteCreateEvent, InviteDeleteEvent, MessageCreateEventExtra, MessageDeleteEvent, MessageDeleteBulkEvent, MessageReactionAddEvent, MessageReactionRemoveEvent, MessageReactionRemoveAllEvent, MessageReactionRemoveEmojiEvent, PresenceUpdateEvent, TypingStartEvent, VoiceServerUpdateEvent, MessagePollVoteAddEvent, MessagePollVoteRemoveEvent, GatewayPresenceUpdate, RawPayload, IdentifyConnectionProperties, VoiceChannelEffectSendEvent, GuildSoundboardSoundDeleteEvent, RateLimitedEvent } from "./types/gateway-events";
14
+ import type { AutoModerationActionExecutionEvent, ChannelPinsUpdateEvent, ThreadListSyncEvent, ThreadMemberUpdateEventExtra, ThreadMembersUpdateEvent, GuildCreateEventExtra, GuildAuditLogEntryCreateExtra, GuildBanAddEvent, GuildBanRemoveEvent, GuildMemberAddEventExtra, GuildMemberRemoveEvent, GuildMemberUpdateEvent, GuildMembersChunkEvent, IntegrationCreateEventExtra, IntegrationUpdateEventExtra, IntegrationDeleteEvent, InviteCreateEvent, InviteDeleteEvent, MessageCreateEventExtra, MessageDeleteEvent, MessageDeleteBulkEvent, MessageReactionAddEvent, MessageReactionRemoveEvent, MessageReactionRemoveAllEvent, MessageReactionRemoveEmojiEvent, PresenceUpdateEvent, TypingStartEvent, VoiceServerUpdateEvent, MessagePollVoteAddEvent, MessagePollVoteRemoveEvent, GatewayPresenceUpdate, RawPayload, IdentifyConnectionProperties, VoiceChannelEffectSendEvent, GuildSoundboardSoundDeleteEvent, RateLimitedEvent, ChannelInfoEvent, VoiceChannelStatusUpdateEvent, VoiceChannelStartTimeUpdateEvent } from "./types/gateway-events";
15
15
  import type { Guild, GuildMember, WelcomeScreen, GuildWidgetSettings, Ban, Integration, GuildOnboarding, GuildPreview, GuildWidget, UnavailableGuild, OnboardingPrompt, WelcomeScreenChannel, IncidentsData } from "./types/guild";
16
16
  import type { GuildScheduledEvent, GuildScheduledEventUser, GuildScheduledEventEntityMetadata, GuildScheduledEventRecurrenceRule } from "./types/guild-scheduled-event";
17
17
  import type { GuildTemplate } from "./types/guild-template";
@@ -26,17 +26,18 @@ import type { User, ApplicationRoleConnection, Connection } from "./types/user";
26
26
  import type { VoiceRegion, VoiceState } from "./types/voice";
27
27
  import type { Webhook } from "./types/webhook";
28
28
  import type { ClientOptions as WebSocketOptions } from "ws";
29
- import type { Embed, AllowedMentions, Attachment, Message, MessageReference, MessagePin } from "./types/message";
29
+ import type { Embed, AllowedMentions, Attachment, Message, MessageReference, MessagePin, SharedClientTheme, AttachmentRequest } from "./types/message";
30
30
  import type { Subscription } from "./types/subscription";
31
31
  import type { SoundboardSound } from "./types/soundboard";
32
32
  import type { ActionRow, Button, ChannelSelect, Container, File, MediaGallery, MentionableSelect, RoleSelect, Section, Separator, StringSelect, TextDisplay, Thumbnail, UserSelect } from "./types/components";
33
- import type { Lobby, LobbyMember } from "./types/lobby";
33
+ import { LobbyInvite, type Lobby, type LobbyMember, type LobbyMessage } from "./types/lobby";
34
34
  export interface GatewayOptions {
35
35
  properties?: IdentifyConnectionProperties;
36
36
  compress?: boolean;
37
37
  largeThreshold?: number;
38
38
  presence?: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>;
39
39
  intents?: number | Array<number>;
40
+ capabilities?: GatewayCapabilities;
40
41
  }
41
42
  export interface ClientOptions {
42
43
  shardsCount?: number | "auto";
@@ -52,6 +53,7 @@ export declare class Client extends EventEmitter {
52
53
  largeThreshold?: number;
53
54
  presence?: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>;
54
55
  intents: GatewayIntents | number;
56
+ capabilities?: GatewayCapabilities;
55
57
  shardsCount: number | "auto";
56
58
  auth: "Bot" | "Bearer";
57
59
  reconnect: boolean;
@@ -131,6 +133,13 @@ export declare class Client extends EventEmitter {
131
133
  type?: ApplicationCommandTypes;
132
134
  nsfw?: boolean;
133
135
  }>): Promise<Array<ApplicationCommand>>;
136
+ /** https://docs.discord.com/developers/resources/lobby#bulk-update-lobby-members */
137
+ bulkUpdateLobbyMembers(lobbyId: snowflake, options: {
138
+ id: snowflake;
139
+ metadata?: Record<string, string> | null;
140
+ flags?: LobbyMemberFlags;
141
+ removeMember?: boolean;
142
+ }): Promise<Array<LobbyMember>>;
134
143
  /** https://discord.com/developers/docs/topics/gateway#connections */
135
144
  connect(): Promise<void>;
136
145
  /** https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement */
@@ -171,6 +180,7 @@ export declare class Client extends EventEmitter {
171
180
  defaultSortOrder?: SortOrderTypes | null;
172
181
  defaultForumLayout?: ForumLayoutTypes | null;
173
182
  defaultThreadRateLimitPerUser?: number | null;
183
+ flags?: ChannelFlags;
174
184
  }, reason?: string): Promise<Channel>;
175
185
  /** https://discord.com/developers/docs/resources/channel#create-channel-invite */
176
186
  createChannelInvite(channelId: snowflake, options: {
@@ -205,6 +215,7 @@ export declare class Client extends EventEmitter {
205
215
  contexts?: Array<InteractionContextTypes>;
206
216
  type?: ApplicationCommandTypes;
207
217
  nsfw?: boolean;
218
+ handler?: EntryPointCommandHandlerTypes;
208
219
  }): Promise<ApplicationCommand>;
209
220
  /** https://discord.com/developers/docs/resources/user#create-group-dm */
210
221
  createGroup(options: {
@@ -298,9 +309,15 @@ export declare class Client extends EventEmitter {
298
309
  /** https://discord.com/developers/docs/resources/lobby#create-lobby */
299
310
  createLobby(options?: {
300
311
  metadata?: Record<string, string> | null;
301
- members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags">>;
312
+ members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags"> & {
313
+ additionalName?: string | null;
314
+ }>;
302
315
  idleTimeoutSeconds?: number;
303
316
  }): Promise<Lobby>;
317
+ /** https://docs.discord.com/developers/resources/lobby#create-lobby-channel-invite-for-self */
318
+ createLobbyChannelSelfInvite(lobbyId: snowflake): Promise<LobbyInvite>;
319
+ /** https://docs.discord.com/developers/resources/lobby#create-lobby-channel-invite-for-user */
320
+ createLobbyChannelUserInvite(lobbyId: snowflake, userId: snowflake): Promise<LobbyInvite>;
304
321
  /** https://discord.com/developers/docs/resources/message#create-message */
305
322
  createMessage(channelId: snowflake, options: {
306
323
  content?: string;
@@ -312,10 +329,11 @@ export declare class Client extends EventEmitter {
312
329
  components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
313
330
  stickersIds?: Array<snowflake>;
314
331
  files?: Array<FileData>;
315
- attachments?: Array<Pick<Attachment, "filename" | "description">>;
332
+ attachments?: Array<AttachmentRequest>;
316
333
  flags?: MessageFlags;
317
334
  enforceNonce?: boolean;
318
335
  poll?: PollCreateParams;
336
+ sharedClientTheme?: SharedClientTheme;
319
337
  }): Promise<Message>;
320
338
  /** https://discord.com/developers/docs/resources/message#create-reaction */
321
339
  createMessageReaction(channelId: snowflake, messageId: snowflake, emoji: string): void;
@@ -344,7 +362,7 @@ export declare class Client extends EventEmitter {
344
362
  allowedMentions?: AllowedMentions;
345
363
  components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container>;
346
364
  stickerIds?: Array<snowflake>;
347
- attachments?: Array<Pick<Attachment, "filename" | "description">>;
365
+ attachments?: Array<AttachmentRequest>;
348
366
  flags?: MessageFlags;
349
367
  files?: Array<FileData>;
350
368
  };
@@ -376,6 +394,8 @@ export declare class Client extends EventEmitter {
376
394
  deleteChannel(channelId: snowflake, reason?: string): Promise<Channel>;
377
395
  /** https://discord.com/developers/docs/resources/channel#delete-channel-permission */
378
396
  deleteChannelPermission(channelId: snowflake, overwriteId: snowflake, reason?: string): void;
397
+ /** https://docs.discord.com/developers/resources/user#delete-current-user-application-role-connection */
398
+ deleteCurrentUserApplicationRoleConnection(applicationId: snowflake): void;
379
399
  /** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
380
400
  deleteGlobalApplicationCommand(applicationId: snowflake, commandId: snowflake): void;
381
401
  /** https://discord.com/developers/docs/interactions/application-commands#delete-guild-application-command */
@@ -479,6 +499,7 @@ export declare class Client extends EventEmitter {
479
499
  position?: number | null;
480
500
  lockPermissions?: boolean | null;
481
501
  parentId?: snowflake | null;
502
+ flags?: ChannelFlags;
482
503
  }>): void;
483
504
  /** https://discord.com/developers/docs/resources/user#modify-current-user */
484
505
  editCurrentUser(options: {
@@ -523,6 +544,7 @@ export declare class Client extends EventEmitter {
523
544
  integrationTypes?: Array<ApplicationIntegrationTypes>;
524
545
  contexts?: Array<InteractionContextTypes>;
525
546
  nsfw?: boolean;
547
+ handler?: EntryPointCommandHandlerTypes;
526
548
  }): Promise<ApplicationCommand>;
527
549
  /** https://discord.com/developers/docs/resources/guild#modify-guild */
528
550
  editGuild(guildId: snowflake, options: {
@@ -645,7 +667,9 @@ export declare class Client extends EventEmitter {
645
667
  /** https://discord.com/developers/docs/resources/lobby#modify-lobby */
646
668
  editLobby(lobbyId: snowflake, options: {
647
669
  metadata?: Record<string, string> | null;
648
- members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags">>;
670
+ members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags"> & {
671
+ additionalName?: string | null;
672
+ }>;
649
673
  idleTimeoutSeconds?: number;
650
674
  }): Promise<Lobby>;
651
675
  /** https://discord.com/developers/docs/resources/message#edit-message */
@@ -656,7 +680,7 @@ export declare class Client extends EventEmitter {
656
680
  allowedMentions?: AllowedMentions | null;
657
681
  components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
658
682
  files?: Array<FileData> | null;
659
- attachments?: Array<Attachment> | null;
683
+ attachments?: Array<AttachmentRequest> | null;
660
684
  }): Promise<Message>;
661
685
  /** https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance */
662
686
  editStageInstance(channelId: snowflake, options: {
@@ -703,7 +727,7 @@ export declare class Client extends EventEmitter {
703
727
  allowedMentions?: AllowedMentions | null;
704
728
  components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
705
729
  files?: Array<FileData> | null;
706
- attachments?: Array<Partial<Attachment>> | null;
730
+ attachments?: Array<AttachmentRequest> | null;
707
731
  poll?: PollCreateParams | null;
708
732
  threadId?: snowflake;
709
733
  withComponents?: boolean;
@@ -725,7 +749,7 @@ export declare class Client extends EventEmitter {
725
749
  allowedMentions?: AllowedMentions;
726
750
  components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
727
751
  files?: Array<FileData>;
728
- attachments?: Array<Pick<Attachment, "filename" | "description">>;
752
+ attachments?: Array<AttachmentRequest>;
729
753
  flags?: MessageFlags;
730
754
  threadName?: string;
731
755
  appliedTags?: Array<snowflake>;
@@ -973,6 +997,10 @@ export declare class Client extends EventEmitter {
973
997
  }>;
974
998
  /** https://discord.com/developers/docs/resources/lobby#get-lobby */
975
999
  getLobby(lobbyId: snowflake): Promise<Lobby>;
1000
+ /** https://docs.discord.com/developers/resources/lobby#get-lobby-messages */
1001
+ getLobbyMessages(lobbyId: snowflake, options?: {
1002
+ limit?: number;
1003
+ }): Promise<Array<LobbyMessage>>;
976
1004
  /** https://discord.com/developers/docs/resources/message#get-channel-message */
977
1005
  getMessage(channelId: snowflake, messageId: snowflake): Promise<Message>;
978
1006
  /** https://discord.com/developers/docs/resources/message#get-reactions */
@@ -1053,6 +1081,13 @@ export declare class Client extends EventEmitter {
1053
1081
  }): Promise<Message>;
1054
1082
  /** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */
1055
1083
  getWebhooks(guildId: snowflake): Promise<Array<Webhook>>;
1084
+ /** https://docs.discord.com/developers/resources/lobby#create-or-join-lobby */
1085
+ joinLobby(options: {
1086
+ secret: string;
1087
+ idleTimeoutSeconds?: number;
1088
+ lobbyMetadata?: Record<string, string> | null;
1089
+ memberMetadata?: Record<string, string> | null;
1090
+ }): Promise<Lobby>;
1056
1091
  /** https://discord.com/developers/docs/resources/channel#join-thread */
1057
1092
  joinThread(channelId: snowflake): void;
1058
1093
  /** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
@@ -1091,6 +1126,46 @@ export declare class Client extends EventEmitter {
1091
1126
  query: string;
1092
1127
  limit?: number;
1093
1128
  }): Promise<Array<GuildMember>>;
1129
+ /** https://docs.discord.com/developers/resources/message#search-guild-messages */
1130
+ searchGuildMessages(guildId: snowflake, options?: {
1131
+ limit?: number;
1132
+ offset?: number;
1133
+ maxId?: snowflake;
1134
+ minId?: snowflake;
1135
+ slop?: number;
1136
+ content?: string;
1137
+ channelId?: snowflake;
1138
+ authorType?: Array<AuthorTypes>;
1139
+ authorId?: Array<snowflake>;
1140
+ mentions?: Array<snowflake>;
1141
+ mentionsRolesId?: Array<snowflake>;
1142
+ mentionEveryone?: boolean;
1143
+ repliedToUserId?: Array<snowflake>;
1144
+ repliedToMessageId?: Array<snowflake>;
1145
+ pinned?: boolean;
1146
+ has?: Array<SearchHasTypes>;
1147
+ embedType?: Array<SearchEmbedTypes>;
1148
+ embedProvider?: Array<string>;
1149
+ linkHostname?: Array<string>;
1150
+ attachmentFilename?: Array<string>;
1151
+ attachmentExtension?: Array<string>;
1152
+ sortBy?: SearchSortModes;
1153
+ sortOrder?: string;
1154
+ includeNfsw?: boolean;
1155
+ }): Promise<{
1156
+ doingDeepHistoricalIndex: boolean;
1157
+ documentsIndexed?: number;
1158
+ totalResults: number;
1159
+ messages: Array<Message>;
1160
+ threads?: Array<Channel>;
1161
+ members?: Array<ThreadMember>;
1162
+ }>;
1163
+ /** https://docs.discord.com/developers/resources/lobby#send-lobby-message */
1164
+ sendLobbyMessage(lobbyId: snowflake, options: {
1165
+ content: string;
1166
+ metadata?: Record<string, string> | null;
1167
+ flags?: MessageFlags;
1168
+ }): Promise<LobbyMessage>;
1094
1169
  /** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
1095
1170
  sendSoundboardSound(channelId: snowflake, options: {
1096
1171
  soundId: snowflake;
@@ -1098,6 +1173,10 @@ export declare class Client extends EventEmitter {
1098
1173
  }): void;
1099
1174
  /** https://discord.com/developers/docs/topics/gateway-events#update-presence */
1100
1175
  setPresence(options: Partial<Pick<GatewayPresenceUpdate, "activities" | "status" | "afk">>): void;
1176
+ /** https://docs.discord.com/developers/resources/channel#set-voice-channel-status */
1177
+ setVoiceChannelStatus(channelId: snowflake, options: {
1178
+ status: string | null;
1179
+ }, reason?: string): void;
1101
1180
  /** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
1102
1181
  syncGuildTemplate(guildId: snowflake, code: string): Promise<GuildTemplate>;
1103
1182
  /** https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */
@@ -1114,6 +1193,8 @@ export declare class Client extends EventEmitter {
1114
1193
  }): Promise<ApplicationRoleConnection>;
1115
1194
  /** https://discord.com/developers/docs/resources/invite#update-target-users */
1116
1195
  updateInviteTargetUser(inviteCode: string, targetUsersFile: FileData): void;
1196
+ /** https://docs.discord.com/developers/resources/lobby#update-lobby-message-moderation-metadata */
1197
+ updateLobbyMessageModerationMetadata(lobbyId: snowflake, messageId: snowflake, metadata: Record<string, string>): void;
1117
1198
  /** https://discord.com/developers/docs/resources/channel#unpin-message */
1118
1199
  unpinMessage(channelId: snowflake, messageId: snowflake, reason?: string): void;
1119
1200
  }
@@ -1153,6 +1234,7 @@ export interface ClientEvents {
1153
1234
  channelCreate: [channel: Channel];
1154
1235
  channelUpdate: [channel: Channel];
1155
1236
  channelDelete: [channel: Channel];
1237
+ channelInfo: [info: ChannelInfoEvent];
1156
1238
  channelPinsUpdate: [pins: ChannelPinsUpdateEvent];
1157
1239
  threadCreate: [thread: Channel];
1158
1240
  threadUpdate: [thread: Channel];
@@ -1228,6 +1310,8 @@ export interface ClientEvents {
1228
1310
  typingStart: [typing: TypingStartEvent];
1229
1311
  userUpdate: [user: User];
1230
1312
  voiceChannelEffectSend: [voiceEffect: VoiceChannelEffectSendEvent];
1313
+ voiceChannelStatusUpdate: [voiceChannel: VoiceChannelStatusUpdateEvent];
1314
+ voiceChannelStartTimeUpdate: [voiceChannel: VoiceChannelStartTimeUpdateEvent];
1231
1315
  voiceStateUpdate: [voiceState: VoiceState];
1232
1316
  voiceServerUpdate: [voiceServer: VoiceServerUpdateEvent];
1233
1317
  webhooksUpdate: [channelId: snowflake, guildId: snowflake];
@@ -16,6 +16,7 @@ class Client extends node_events_1.default {
16
16
  largeThreshold;
17
17
  presence;
18
18
  intents;
19
+ capabilities;
19
20
  shardsCount;
20
21
  auth;
21
22
  reconnect;
@@ -39,6 +40,7 @@ class Client extends node_events_1.default {
39
40
  ? options.gateway.intents.reduce((sum, num) => sum + num, 0)
40
41
  : options.gateway.intents
41
42
  : 0;
43
+ this.capabilities = options?.gateway?.capabilities;
42
44
  this.shardsCount = options?.shardsCount ?? "auto";
43
45
  this.auth = options?.auth ?? "Bot";
44
46
  this.reconnect = options?.reconnect ?? true;
@@ -159,6 +161,13 @@ class Client extends node_events_1.default {
159
161
  });
160
162
  return response.map((c) => transformers_1.ApplicationCommands.applicationCommandFromRaw(c));
161
163
  }
164
+ /** https://docs.discord.com/developers/resources/lobby#bulk-update-lobby-members */
165
+ async bulkUpdateLobbyMembers(lobbyId, options) {
166
+ const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbyMembersBulk(lobbyId), {
167
+ json: options,
168
+ });
169
+ return response.map((lobbyMember) => transformers_1.Lobbies.lobbyMemberFromRaw(lobbyMember));
170
+ }
162
171
  /** https://discord.com/developers/docs/topics/gateway#connections */
163
172
  async connect() {
164
173
  this.shardsCount =
@@ -228,6 +237,7 @@ class Client extends node_events_1.default {
228
237
  default_sort_order: options.defaultSortOrder,
229
238
  default_forum_layout: options.defaultForumLayout,
230
239
  default_thread_rate_limit_per_user: options.defaultThreadRateLimitPerUser,
240
+ flags: options.flags,
231
241
  },
232
242
  reason,
233
243
  });
@@ -287,6 +297,7 @@ class Client extends node_events_1.default {
287
297
  contexts: options.contexts,
288
298
  type: options.type,
289
299
  nsfw: options.nsfw,
300
+ handler: options.handler,
290
301
  },
291
302
  });
292
303
  return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
@@ -603,12 +614,27 @@ class Client extends node_events_1.default {
603
614
  const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbies(), {
604
615
  json: {
605
616
  metadata: options?.metadata,
606
- members: options?.members,
617
+ members: options?.members?.map((member) => ({
618
+ id: member.id,
619
+ metadata: member.metadata,
620
+ flags: member.flags,
621
+ additional_name: member.additionalName,
622
+ })),
607
623
  idle_timeout_seconds: options?.idleTimeoutSeconds,
608
624
  },
609
625
  });
610
626
  return transformers_1.Lobbies.lobbyFromRaw(response);
611
627
  }
628
+ /** https://docs.discord.com/developers/resources/lobby#create-lobby-channel-invite-for-self */
629
+ async createLobbyChannelSelfInvite(lobbyId) {
630
+ const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbyChannelInvite(lobbyId));
631
+ return response;
632
+ }
633
+ /** https://docs.discord.com/developers/resources/lobby#create-lobby-channel-invite-for-user */
634
+ async createLobbyChannelUserInvite(lobbyId, userId) {
635
+ const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbyChannelInvite(lobbyId, userId));
636
+ return response;
637
+ }
612
638
  /** https://discord.com/developers/docs/resources/message#create-message */
613
639
  async createMessage(channelId, options) {
614
640
  const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(channelId), {
@@ -637,7 +663,7 @@ class Client extends node_events_1.default {
637
663
  ? transformers_1.Messages.componentsToRaw(options.components)
638
664
  : undefined,
639
665
  stickers_ids: options.stickersIds,
640
- attachments: options.attachments,
666
+ attachments: options.attachments?.map((attachment) => transformers_1.Channels.attachmentRequestToRaw(attachment)),
641
667
  flags: options.flags,
642
668
  enforce_nonce: options.enforceNonce,
643
669
  poll: options.poll !== undefined
@@ -652,6 +678,14 @@ class Client extends node_events_1.default {
652
678
  layout_type: options.poll.layoutType,
653
679
  }
654
680
  : undefined,
681
+ shared_client_theme: options.sharedClientTheme !== undefined
682
+ ? {
683
+ colors: options.sharedClientTheme.colors,
684
+ gradient_angle: options.sharedClientTheme.gradientAngle,
685
+ base_mix: options.sharedClientTheme.baseMix,
686
+ base_theme: options.sharedClientTheme.baseTheme,
687
+ }
688
+ : undefined,
655
689
  },
656
690
  files: options.files,
657
691
  });
@@ -705,7 +739,7 @@ class Client extends node_events_1.default {
705
739
  }
706
740
  : undefined,
707
741
  sticker_ids: options.message.stickerIds,
708
- attachments: options.message.attachments,
742
+ attachments: options.message.attachments?.map((attachment) => transformers_1.Channels.attachmentRequestToRaw(attachment)),
709
743
  flags: options.message.flags,
710
744
  },
711
745
  applied_tags: options.appliedTags,
@@ -773,6 +807,10 @@ class Client extends node_events_1.default {
773
807
  reason,
774
808
  });
775
809
  }
810
+ /** https://docs.discord.com/developers/resources/user#delete-current-user-application-role-connection */
811
+ deleteCurrentUserApplicationRoleConnection(applicationId) {
812
+ this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userApplicationRoleConnection(applicationId));
813
+ }
776
814
  /** https://discord.com/developers/docs/interactions/application-commands#delete-global-application-command */
777
815
  deleteGlobalApplicationCommand(applicationId, commandId) {
778
816
  this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.applicationCommand(applicationId, commandId));
@@ -979,6 +1017,7 @@ class Client extends node_events_1.default {
979
1017
  position: data.position,
980
1018
  lock_permissions: data.lockPermissions,
981
1019
  parent_id: data.parentId,
1020
+ flags: data.flags,
982
1021
  })),
983
1022
  });
984
1023
  }
@@ -1051,6 +1090,7 @@ class Client extends node_events_1.default {
1051
1090
  integration_types: options.integrationTypes,
1052
1091
  contexts: options.contexts,
1053
1092
  nsfw: options.nsfw,
1093
+ handler: options.handler,
1054
1094
  },
1055
1095
  });
1056
1096
  return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
@@ -1302,7 +1342,12 @@ class Client extends node_events_1.default {
1302
1342
  const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobby(lobbyId), {
1303
1343
  json: {
1304
1344
  metadata: options.metadata,
1305
- members: options.members,
1345
+ members: options.members?.map((member) => ({
1346
+ id: member.id,
1347
+ metadata: member.metadata,
1348
+ flags: member.flags,
1349
+ additional_name: member.additionalName,
1350
+ })),
1306
1351
  idle_timeout_seconds: options.idleTimeoutSeconds,
1307
1352
  },
1308
1353
  });
@@ -1331,7 +1376,7 @@ class Client extends node_events_1.default {
1331
1376
  ? transformers_1.Messages.componentsToRaw(options.components)
1332
1377
  : null
1333
1378
  : undefined,
1334
- attachments: options.attachments?.map((attachment) => transformers_1.Messages.attachmentToRaw(attachment)),
1379
+ attachments: options.attachments?.map((attachment) => transformers_1.Channels.attachmentRequestToRaw(attachment)),
1335
1380
  flags: options.flags,
1336
1381
  },
1337
1382
  files: options.files,
@@ -1515,22 +1560,7 @@ class Client extends node_events_1.default {
1515
1560
  ? transformers_1.Messages.componentsToRaw(options.components)
1516
1561
  : null
1517
1562
  : undefined,
1518
- attachments: options.attachments?.map((attachment) => ({
1519
- id: attachment.id,
1520
- filename: attachment.filename,
1521
- title: attachment.title,
1522
- description: attachment.description,
1523
- content_type: attachment.contentType,
1524
- size: attachment.size,
1525
- url: attachment.url,
1526
- proxy_url: attachment.proxyURL,
1527
- height: attachment.height,
1528
- width: attachment.width,
1529
- ephemeral: attachment.ephemeral,
1530
- duration_secs: attachment.durationSecs,
1531
- waveform: attachment.waveform,
1532
- flags: attachment.flags,
1533
- })),
1563
+ attachments: options.attachments?.map((attachment) => transformers_1.Channels.attachmentRequestToRaw(attachment)),
1534
1564
  poll: options.poll !== undefined
1535
1565
  ? options.poll !== null
1536
1566
  ? {
@@ -1591,7 +1621,7 @@ class Client extends node_events_1.default {
1591
1621
  components: options.components !== undefined
1592
1622
  ? transformers_1.Messages.componentsToRaw(options.components)
1593
1623
  : undefined,
1594
- attachments: options.attachments,
1624
+ attachments: options.attachments?.map((attachment) => transformers_1.Channels.attachmentRequestToRaw(attachment)),
1595
1625
  flags: options.flags,
1596
1626
  thread_name: options.threadName,
1597
1627
  applied_tags: options.appliedTags,
@@ -2169,7 +2199,9 @@ class Client extends node_events_1.default {
2169
2199
  }
2170
2200
  /** https://discord.com/developers/docs/resources/invite#get-target-users */
2171
2201
  getInviteTargetUser(inviteCode) {
2172
- return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.inviteTargetUsers(inviteCode));
2202
+ return this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.inviteTargetUsers(inviteCode), {
2203
+ returnsBlob: true,
2204
+ });
2173
2205
  }
2174
2206
  async getInviteTargetUserJobStatus(inviteCode) {
2175
2207
  const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.inviteTargetUsersJobStatus(inviteCode));
@@ -2201,6 +2233,13 @@ class Client extends node_events_1.default {
2201
2233
  const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobby(lobbyId));
2202
2234
  return transformers_1.Lobbies.lobbyFromRaw(response);
2203
2235
  }
2236
+ /** https://docs.discord.com/developers/resources/lobby#get-lobby-messages */
2237
+ async getLobbyMessages(lobbyId, options) {
2238
+ const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobbyMessages(lobbyId), {
2239
+ query: options,
2240
+ });
2241
+ return response.map((lobbyMessage) => transformers_1.Lobbies.lobbyMessageFromRaw(lobbyMessage));
2242
+ }
2204
2243
  /** https://discord.com/developers/docs/resources/message#get-channel-message */
2205
2244
  async getMessage(channelId, messageId) {
2206
2245
  const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(channelId, messageId));
@@ -2381,6 +2420,18 @@ class Client extends node_events_1.default {
2381
2420
  const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWebhooks(guildId));
2382
2421
  return response.map((webhook) => transformers_1.Webhooks.webhookFromRaw(webhook));
2383
2422
  }
2423
+ /** https://docs.discord.com/developers/resources/lobby#create-or-join-lobby */
2424
+ async joinLobby(options) {
2425
+ const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.lobbies(), {
2426
+ json: {
2427
+ secret: options.secret,
2428
+ idle_timeout_seconds: options.idleTimeoutSeconds,
2429
+ lobby_metadata: options.lobbyMetadata,
2430
+ member_metadata: options.memberMetadata,
2431
+ },
2432
+ });
2433
+ return transformers_1.Lobbies.lobbyFromRaw(response);
2434
+ }
2384
2435
  /** https://discord.com/developers/docs/resources/channel#join-thread */
2385
2436
  joinThread(channelId) {
2386
2437
  this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelId));
@@ -2474,6 +2525,52 @@ class Client extends node_events_1.default {
2474
2525
  });
2475
2526
  return response.map((guildMember) => transformers_1.Guilds.guildMemberFromRaw(guildMember));
2476
2527
  }
2528
+ /** https://docs.discord.com/developers/resources/message#search-guild-messages */
2529
+ async searchGuildMessages(guildId, options) {
2530
+ const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildMessagesSearch(guildId), {
2531
+ query: {
2532
+ limit: options?.limit,
2533
+ offset: options?.offset,
2534
+ max_id: options?.maxId,
2535
+ min_id: options?.minId,
2536
+ slop: options?.slop,
2537
+ content: options?.content,
2538
+ channel_id: options?.channelId,
2539
+ author_type: options?.authorType,
2540
+ author_id: options?.authorId,
2541
+ mentions: options?.mentions,
2542
+ mentions_roles_id: options?.mentionsRolesId,
2543
+ mention_everyone: options?.mentionEveryone,
2544
+ replied_to_user_id: options?.repliedToUserId,
2545
+ replied_to_message_id: options?.repliedToMessageId,
2546
+ pinned: options?.pinned,
2547
+ has: options?.has,
2548
+ embed_type: options?.embedType,
2549
+ embed_provider: options?.embedProvider,
2550
+ link_hostname: options?.linkHostname,
2551
+ attachment_filename: options?.attachmentFilename,
2552
+ attachment_extension: options?.attachmentExtension,
2553
+ sort_by: options?.sortBy,
2554
+ sort_order: options?.sortOrder,
2555
+ include_nsfw: options?.includeNfsw,
2556
+ },
2557
+ });
2558
+ return {
2559
+ doingDeepHistoricalIndex: response.doing_deep_historical_index,
2560
+ documentsIndexed: response.documents_indexed,
2561
+ totalResults: response.total_results,
2562
+ messages: response.messages.map((message) => transformers_1.Messages.messageFromRaw(message)),
2563
+ threads: response.threads?.map((thread) => transformers_1.Channels.channelFromRaw(thread)),
2564
+ members: response.members?.map((member) => transformers_1.Channels.threadMemberFromRaw(member)),
2565
+ };
2566
+ }
2567
+ /** https://docs.discord.com/developers/resources/lobby#send-lobby-message */
2568
+ async sendLobbyMessage(lobbyId, options) {
2569
+ const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbyMessages(lobbyId), {
2570
+ json: options,
2571
+ });
2572
+ return transformers_1.Lobbies.lobbyMessageFromRaw(response);
2573
+ }
2477
2574
  /** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
2478
2575
  sendSoundboardSound(channelId, options) {
2479
2576
  this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.sendSoundboardSound(channelId), {
@@ -2487,6 +2584,13 @@ class Client extends node_events_1.default {
2487
2584
  setPresence(options) {
2488
2585
  this.shards.forEach((shard) => shard.transmitter.updatePresence(options));
2489
2586
  }
2587
+ /** https://docs.discord.com/developers/resources/channel#set-voice-channel-status */
2588
+ setVoiceChannelStatus(channelId, options, reason) {
2589
+ this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelVoiceStatus(channelId), {
2590
+ json: options,
2591
+ reason,
2592
+ });
2593
+ }
2490
2594
  /** https://discord.com/developers/docs/resources/guild-template#sync-guild-template */
2491
2595
  async syncGuildTemplate(guildId, code) {
2492
2596
  const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.guildTemplate(guildId, code));
@@ -2529,6 +2633,12 @@ class Client extends node_events_1.default {
2529
2633
  files: [targetUsersFile],
2530
2634
  });
2531
2635
  }
2636
+ /** https://docs.discord.com/developers/resources/lobby#update-lobby-message-moderation-metadata */
2637
+ updateLobbyMessageModerationMetadata(lobbyId, messageId, metadata) {
2638
+ this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.lobbyMessageModerationMetadata(lobbyId, messageId), {
2639
+ json: metadata,
2640
+ });
2641
+ }
2532
2642
  /** https://discord.com/developers/docs/resources/channel#unpin-message */
2533
2643
  unpinMessage(channelId, messageId, reason) {
2534
2644
  this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelPin(channelId, messageId), {