disgroove 3.0.1-dev.c03cf79 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/lib/Client.d.ts +42 -11
- package/dist/lib/Client.js +62 -23
- package/dist/lib/constants.d.ts +20 -9
- package/dist/lib/constants.js +20 -8
- package/dist/lib/gateway/Dispatcher.js +1 -0
- package/dist/lib/gateway/Shard.js +1 -0
- package/dist/lib/gateway/Transmitter.js +2 -1
- package/dist/lib/rest/Endpoints.d.ts +3 -1
- package/dist/lib/rest/Endpoints.js +5 -1
- 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/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/channel.d.ts +4 -2
- package/dist/lib/types/components.d.ts +2 -0
- package/dist/lib/types/gateway-events.d.ts +9 -3
- package/dist/lib/types/lobby.d.ts +38 -1
- package/dist/lib/types/message.d.ts +20 -0
- package/dist/lib/utils/formatters.d.ts +2 -0
- package/dist/lib/utils/formatters.js +5 -0
- package/dist/package.json +6 -5
- package/package.json +7 -6
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright ©
|
|
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
|
|
package/dist/lib/Client.d.ts
CHANGED
|
@@ -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, type InviteTargetUsersJobStatusErrorCodes, type AuthorTypes, type SearchHasTypes, type SearchEmbedTypes, type SearchSortModes } 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";
|
|
@@ -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, SharedClientTheme } 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
|
|
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;
|
|
@@ -60,7 +62,7 @@ export declare class Client extends EventEmitter {
|
|
|
60
62
|
guildShardMap: Map<string, number>;
|
|
61
63
|
user: User | null;
|
|
62
64
|
guilds: Map<string, Guild>;
|
|
63
|
-
application: Pick<Application, "id" | "flags"> | null;
|
|
65
|
+
application: Pick<Application, "id" | "flags" | "flagsNew"> | null;
|
|
64
66
|
ws?: WebSocketOptions;
|
|
65
67
|
constructor(token: string, options?: ClientOptions);
|
|
66
68
|
/** https://discord.com/developers/docs/resources/channel#group-dm-add-recipient */
|
|
@@ -178,6 +180,7 @@ export declare class Client extends EventEmitter {
|
|
|
178
180
|
defaultSortOrder?: SortOrderTypes | null;
|
|
179
181
|
defaultForumLayout?: ForumLayoutTypes | null;
|
|
180
182
|
defaultThreadRateLimitPerUser?: number | null;
|
|
183
|
+
flags?: ChannelFlags;
|
|
181
184
|
}, reason?: string): Promise<Channel>;
|
|
182
185
|
/** https://discord.com/developers/docs/resources/channel#create-channel-invite */
|
|
183
186
|
createChannelInvite(channelId: snowflake, options: {
|
|
@@ -212,6 +215,7 @@ export declare class Client extends EventEmitter {
|
|
|
212
215
|
contexts?: Array<InteractionContextTypes>;
|
|
213
216
|
type?: ApplicationCommandTypes;
|
|
214
217
|
nsfw?: boolean;
|
|
218
|
+
handler?: EntryPointCommandHandlerTypes;
|
|
215
219
|
}): Promise<ApplicationCommand>;
|
|
216
220
|
/** https://discord.com/developers/docs/resources/user#create-group-dm */
|
|
217
221
|
createGroup(options: {
|
|
@@ -305,9 +309,15 @@ export declare class Client extends EventEmitter {
|
|
|
305
309
|
/** https://discord.com/developers/docs/resources/lobby#create-lobby */
|
|
306
310
|
createLobby(options?: {
|
|
307
311
|
metadata?: Record<string, string> | null;
|
|
308
|
-
members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags"
|
|
312
|
+
members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags"> & {
|
|
313
|
+
additionalName?: string | null;
|
|
314
|
+
}>;
|
|
309
315
|
idleTimeoutSeconds?: number;
|
|
310
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>;
|
|
311
321
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
|
312
322
|
createMessage(channelId: snowflake, options: {
|
|
313
323
|
content?: string;
|
|
@@ -319,7 +329,7 @@ export declare class Client extends EventEmitter {
|
|
|
319
329
|
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
320
330
|
stickersIds?: Array<snowflake>;
|
|
321
331
|
files?: Array<FileData>;
|
|
322
|
-
attachments?: Array<
|
|
332
|
+
attachments?: Array<AttachmentRequest>;
|
|
323
333
|
flags?: MessageFlags;
|
|
324
334
|
enforceNonce?: boolean;
|
|
325
335
|
poll?: PollCreateParams;
|
|
@@ -352,7 +362,7 @@ export declare class Client extends EventEmitter {
|
|
|
352
362
|
allowedMentions?: AllowedMentions;
|
|
353
363
|
components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container>;
|
|
354
364
|
stickerIds?: Array<snowflake>;
|
|
355
|
-
attachments?: Array<
|
|
365
|
+
attachments?: Array<AttachmentRequest>;
|
|
356
366
|
flags?: MessageFlags;
|
|
357
367
|
files?: Array<FileData>;
|
|
358
368
|
};
|
|
@@ -489,6 +499,7 @@ export declare class Client extends EventEmitter {
|
|
|
489
499
|
position?: number | null;
|
|
490
500
|
lockPermissions?: boolean | null;
|
|
491
501
|
parentId?: snowflake | null;
|
|
502
|
+
flags?: ChannelFlags;
|
|
492
503
|
}>): void;
|
|
493
504
|
/** https://discord.com/developers/docs/resources/user#modify-current-user */
|
|
494
505
|
editCurrentUser(options: {
|
|
@@ -533,6 +544,7 @@ export declare class Client extends EventEmitter {
|
|
|
533
544
|
integrationTypes?: Array<ApplicationIntegrationTypes>;
|
|
534
545
|
contexts?: Array<InteractionContextTypes>;
|
|
535
546
|
nsfw?: boolean;
|
|
547
|
+
handler?: EntryPointCommandHandlerTypes;
|
|
536
548
|
}): Promise<ApplicationCommand>;
|
|
537
549
|
/** https://discord.com/developers/docs/resources/guild#modify-guild */
|
|
538
550
|
editGuild(guildId: snowflake, options: {
|
|
@@ -655,7 +667,9 @@ export declare class Client extends EventEmitter {
|
|
|
655
667
|
/** https://discord.com/developers/docs/resources/lobby#modify-lobby */
|
|
656
668
|
editLobby(lobbyId: snowflake, options: {
|
|
657
669
|
metadata?: Record<string, string> | null;
|
|
658
|
-
members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags"
|
|
670
|
+
members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags"> & {
|
|
671
|
+
additionalName?: string | null;
|
|
672
|
+
}>;
|
|
659
673
|
idleTimeoutSeconds?: number;
|
|
660
674
|
}): Promise<Lobby>;
|
|
661
675
|
/** https://discord.com/developers/docs/resources/message#edit-message */
|
|
@@ -666,7 +680,7 @@ export declare class Client extends EventEmitter {
|
|
|
666
680
|
allowedMentions?: AllowedMentions | null;
|
|
667
681
|
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
|
|
668
682
|
files?: Array<FileData> | null;
|
|
669
|
-
attachments?: Array<
|
|
683
|
+
attachments?: Array<AttachmentRequest> | null;
|
|
670
684
|
}): Promise<Message>;
|
|
671
685
|
/** https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance */
|
|
672
686
|
editStageInstance(channelId: snowflake, options: {
|
|
@@ -713,7 +727,7 @@ export declare class Client extends EventEmitter {
|
|
|
713
727
|
allowedMentions?: AllowedMentions | null;
|
|
714
728
|
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
|
|
715
729
|
files?: Array<FileData> | null;
|
|
716
|
-
attachments?: Array<
|
|
730
|
+
attachments?: Array<AttachmentRequest> | null;
|
|
717
731
|
poll?: PollCreateParams | null;
|
|
718
732
|
threadId?: snowflake;
|
|
719
733
|
withComponents?: boolean;
|
|
@@ -735,7 +749,7 @@ export declare class Client extends EventEmitter {
|
|
|
735
749
|
allowedMentions?: AllowedMentions;
|
|
736
750
|
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
737
751
|
files?: Array<FileData>;
|
|
738
|
-
attachments?: Array<
|
|
752
|
+
attachments?: Array<AttachmentRequest>;
|
|
739
753
|
flags?: MessageFlags;
|
|
740
754
|
threadName?: string;
|
|
741
755
|
appliedTags?: Array<snowflake>;
|
|
@@ -983,6 +997,10 @@ export declare class Client extends EventEmitter {
|
|
|
983
997
|
}>;
|
|
984
998
|
/** https://discord.com/developers/docs/resources/lobby#get-lobby */
|
|
985
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>>;
|
|
986
1004
|
/** https://discord.com/developers/docs/resources/message#get-channel-message */
|
|
987
1005
|
getMessage(channelId: snowflake, messageId: snowflake): Promise<Message>;
|
|
988
1006
|
/** https://discord.com/developers/docs/resources/message#get-reactions */
|
|
@@ -1063,6 +1081,13 @@ export declare class Client extends EventEmitter {
|
|
|
1063
1081
|
}): Promise<Message>;
|
|
1064
1082
|
/** https://discord.com/developers/docs/resources/webhook#get-guild-webhooks */
|
|
1065
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>;
|
|
1066
1091
|
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
|
1067
1092
|
joinThread(channelId: snowflake): void;
|
|
1068
1093
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
|
@@ -1135,6 +1160,12 @@ export declare class Client extends EventEmitter {
|
|
|
1135
1160
|
threads?: Array<Channel>;
|
|
1136
1161
|
members?: Array<ThreadMember>;
|
|
1137
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>;
|
|
1138
1169
|
/** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
|
|
1139
1170
|
sendSoundboardSound(channelId: snowflake, options: {
|
|
1140
1171
|
soundId: snowflake;
|
package/dist/lib/Client.js
CHANGED
|
@@ -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;
|
|
@@ -235,6 +237,7 @@ class Client extends node_events_1.default {
|
|
|
235
237
|
default_sort_order: options.defaultSortOrder,
|
|
236
238
|
default_forum_layout: options.defaultForumLayout,
|
|
237
239
|
default_thread_rate_limit_per_user: options.defaultThreadRateLimitPerUser,
|
|
240
|
+
flags: options.flags,
|
|
238
241
|
},
|
|
239
242
|
reason,
|
|
240
243
|
});
|
|
@@ -294,6 +297,7 @@ class Client extends node_events_1.default {
|
|
|
294
297
|
contexts: options.contexts,
|
|
295
298
|
type: options.type,
|
|
296
299
|
nsfw: options.nsfw,
|
|
300
|
+
handler: options.handler,
|
|
297
301
|
},
|
|
298
302
|
});
|
|
299
303
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
@@ -610,12 +614,27 @@ class Client extends node_events_1.default {
|
|
|
610
614
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbies(), {
|
|
611
615
|
json: {
|
|
612
616
|
metadata: options?.metadata,
|
|
613
|
-
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
|
+
})),
|
|
614
623
|
idle_timeout_seconds: options?.idleTimeoutSeconds,
|
|
615
624
|
},
|
|
616
625
|
});
|
|
617
626
|
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
618
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
|
+
}
|
|
619
638
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
|
620
639
|
async createMessage(channelId, options) {
|
|
621
640
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(channelId), {
|
|
@@ -644,7 +663,7 @@ class Client extends node_events_1.default {
|
|
|
644
663
|
? transformers_1.Messages.componentsToRaw(options.components)
|
|
645
664
|
: undefined,
|
|
646
665
|
stickers_ids: options.stickersIds,
|
|
647
|
-
attachments: options.attachments,
|
|
666
|
+
attachments: options.attachments?.map((attachment) => transformers_1.Channels.attachmentRequestToRaw(attachment)),
|
|
648
667
|
flags: options.flags,
|
|
649
668
|
enforce_nonce: options.enforceNonce,
|
|
650
669
|
poll: options.poll !== undefined
|
|
@@ -720,7 +739,7 @@ class Client extends node_events_1.default {
|
|
|
720
739
|
}
|
|
721
740
|
: undefined,
|
|
722
741
|
sticker_ids: options.message.stickerIds,
|
|
723
|
-
attachments: options.message.attachments,
|
|
742
|
+
attachments: options.message.attachments?.map((attachment) => transformers_1.Channels.attachmentRequestToRaw(attachment)),
|
|
724
743
|
flags: options.message.flags,
|
|
725
744
|
},
|
|
726
745
|
applied_tags: options.appliedTags,
|
|
@@ -998,6 +1017,7 @@ class Client extends node_events_1.default {
|
|
|
998
1017
|
position: data.position,
|
|
999
1018
|
lock_permissions: data.lockPermissions,
|
|
1000
1019
|
parent_id: data.parentId,
|
|
1020
|
+
flags: data.flags,
|
|
1001
1021
|
})),
|
|
1002
1022
|
});
|
|
1003
1023
|
}
|
|
@@ -1070,6 +1090,7 @@ class Client extends node_events_1.default {
|
|
|
1070
1090
|
integration_types: options.integrationTypes,
|
|
1071
1091
|
contexts: options.contexts,
|
|
1072
1092
|
nsfw: options.nsfw,
|
|
1093
|
+
handler: options.handler,
|
|
1073
1094
|
},
|
|
1074
1095
|
});
|
|
1075
1096
|
return transformers_1.ApplicationCommands.applicationCommandFromRaw(response);
|
|
@@ -1321,7 +1342,12 @@ class Client extends node_events_1.default {
|
|
|
1321
1342
|
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobby(lobbyId), {
|
|
1322
1343
|
json: {
|
|
1323
1344
|
metadata: options.metadata,
|
|
1324
|
-
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
|
+
})),
|
|
1325
1351
|
idle_timeout_seconds: options.idleTimeoutSeconds,
|
|
1326
1352
|
},
|
|
1327
1353
|
});
|
|
@@ -1350,7 +1376,7 @@ class Client extends node_events_1.default {
|
|
|
1350
1376
|
? transformers_1.Messages.componentsToRaw(options.components)
|
|
1351
1377
|
: null
|
|
1352
1378
|
: undefined,
|
|
1353
|
-
attachments: options.attachments?.map((attachment) => transformers_1.
|
|
1379
|
+
attachments: options.attachments?.map((attachment) => transformers_1.Channels.attachmentRequestToRaw(attachment)),
|
|
1354
1380
|
flags: options.flags,
|
|
1355
1381
|
},
|
|
1356
1382
|
files: options.files,
|
|
@@ -1534,22 +1560,7 @@ class Client extends node_events_1.default {
|
|
|
1534
1560
|
? transformers_1.Messages.componentsToRaw(options.components)
|
|
1535
1561
|
: null
|
|
1536
1562
|
: undefined,
|
|
1537
|
-
attachments: options.attachments?.map((attachment) => (
|
|
1538
|
-
id: attachment.id,
|
|
1539
|
-
filename: attachment.filename,
|
|
1540
|
-
title: attachment.title,
|
|
1541
|
-
description: attachment.description,
|
|
1542
|
-
content_type: attachment.contentType,
|
|
1543
|
-
size: attachment.size,
|
|
1544
|
-
url: attachment.url,
|
|
1545
|
-
proxy_url: attachment.proxyURL,
|
|
1546
|
-
height: attachment.height,
|
|
1547
|
-
width: attachment.width,
|
|
1548
|
-
ephemeral: attachment.ephemeral,
|
|
1549
|
-
duration_secs: attachment.durationSecs,
|
|
1550
|
-
waveform: attachment.waveform,
|
|
1551
|
-
flags: attachment.flags,
|
|
1552
|
-
})),
|
|
1563
|
+
attachments: options.attachments?.map((attachment) => transformers_1.Channels.attachmentRequestToRaw(attachment)),
|
|
1553
1564
|
poll: options.poll !== undefined
|
|
1554
1565
|
? options.poll !== null
|
|
1555
1566
|
? {
|
|
@@ -1610,7 +1621,7 @@ class Client extends node_events_1.default {
|
|
|
1610
1621
|
components: options.components !== undefined
|
|
1611
1622
|
? transformers_1.Messages.componentsToRaw(options.components)
|
|
1612
1623
|
: undefined,
|
|
1613
|
-
attachments: options.attachments,
|
|
1624
|
+
attachments: options.attachments?.map((attachment) => transformers_1.Channels.attachmentRequestToRaw(attachment)),
|
|
1614
1625
|
flags: options.flags,
|
|
1615
1626
|
thread_name: options.threadName,
|
|
1616
1627
|
applied_tags: options.appliedTags,
|
|
@@ -2188,7 +2199,9 @@ class Client extends node_events_1.default {
|
|
|
2188
2199
|
}
|
|
2189
2200
|
/** https://discord.com/developers/docs/resources/invite#get-target-users */
|
|
2190
2201
|
getInviteTargetUser(inviteCode) {
|
|
2191
|
-
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
|
+
});
|
|
2192
2205
|
}
|
|
2193
2206
|
async getInviteTargetUserJobStatus(inviteCode) {
|
|
2194
2207
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.inviteTargetUsersJobStatus(inviteCode));
|
|
@@ -2220,6 +2233,13 @@ class Client extends node_events_1.default {
|
|
|
2220
2233
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobby(lobbyId));
|
|
2221
2234
|
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2222
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
|
+
}
|
|
2223
2243
|
/** https://discord.com/developers/docs/resources/message#get-channel-message */
|
|
2224
2244
|
async getMessage(channelId, messageId) {
|
|
2225
2245
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(channelId, messageId));
|
|
@@ -2400,6 +2420,18 @@ class Client extends node_events_1.default {
|
|
|
2400
2420
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.guildWebhooks(guildId));
|
|
2401
2421
|
return response.map((webhook) => transformers_1.Webhooks.webhookFromRaw(webhook));
|
|
2402
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
|
+
}
|
|
2403
2435
|
/** https://discord.com/developers/docs/resources/channel#join-thread */
|
|
2404
2436
|
joinThread(channelId) {
|
|
2405
2437
|
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelId));
|
|
@@ -2532,6 +2564,13 @@ class Client extends node_events_1.default {
|
|
|
2532
2564
|
members: response.members?.map((member) => transformers_1.Channels.threadMemberFromRaw(member)),
|
|
2533
2565
|
};
|
|
2534
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
|
+
}
|
|
2535
2574
|
/** https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound */
|
|
2536
2575
|
sendSoundboardSound(channelId, options) {
|
|
2537
2576
|
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.sendSoundboardSound(channelId), {
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -329,7 +329,9 @@ export declare enum VideoQualityModes {
|
|
|
329
329
|
export declare enum ChannelFlags {
|
|
330
330
|
Pinned = 2,
|
|
331
331
|
RequiredTag = 16,
|
|
332
|
-
HideMediaDownloadOptions = 32768
|
|
332
|
+
HideMediaDownloadOptions = 32768,
|
|
333
|
+
ChannelObfuscated = 131072,
|
|
334
|
+
IsSpoilerChannel = 2097152
|
|
333
335
|
}
|
|
334
336
|
/** https://discord.com/developers/docs/resources/channel#channel-object-sort-order-types */
|
|
335
337
|
export declare enum SortOrderTypes {
|
|
@@ -401,7 +403,10 @@ export declare enum GuildFeatures {
|
|
|
401
403
|
CreatorStorePage = "CREATOR_STORE_PAGE",
|
|
402
404
|
DeveloperSupportServer = "DEVELOPER_SUPPORT_SERVER",
|
|
403
405
|
Discoverable = "DISCOVERABLE",
|
|
406
|
+
EnhancedRoleColors = "ENHANCED_ROLE_COLORS",
|
|
404
407
|
Featurable = "FEATURABLE",
|
|
408
|
+
GuildTags = "GUILD_TAGS",
|
|
409
|
+
GuestsEnabled = "GUESTS_ENABLED",
|
|
405
410
|
InvitesDisabled = "INVITES_DISABLED",
|
|
406
411
|
InviteSplash = "INVITE_SPLASH",
|
|
407
412
|
MemberVerificationGateEnabled = "MEMBER_VERIFICATION_GATE_ENABLED",
|
|
@@ -410,6 +415,7 @@ export declare enum GuildFeatures {
|
|
|
410
415
|
News = "NEWS",
|
|
411
416
|
Partnered = "PARTNERED",
|
|
412
417
|
PreviewEnabled = "PREVIEW_ENABLED",
|
|
418
|
+
PruneRequiresAdmin = "PRUNE_REQUIRES_ADMIN",
|
|
413
419
|
RaidAlertsDisabled = "RAID_ALERTS_DISABLED",
|
|
414
420
|
RoleIcons = "ROLE_ICONS",
|
|
415
421
|
RoleSubscriptionsAvailableForPurchase = "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE",
|
|
@@ -419,10 +425,7 @@ export declare enum GuildFeatures {
|
|
|
419
425
|
VanityURL = "VANITY_URL",
|
|
420
426
|
Verified = "VERIFIED",
|
|
421
427
|
VipRegions = "VIP_REGIONS",
|
|
422
|
-
WelcomeScreenEnabled = "WELCOME_SCREEN_ENABLED"
|
|
423
|
-
GuestsEnabled = "GUESTS_ENABLED",
|
|
424
|
-
GuildTags = "GUILD_TAGS",
|
|
425
|
-
EnhancedRoleColors = "ENHANCED_ROLE_COLORS"
|
|
428
|
+
WelcomeScreenEnabled = "WELCOME_SCREEN_ENABLED"
|
|
426
429
|
}
|
|
427
430
|
/** https://discord.com/developers/docs/resources/guild#guild-object-mutable-guild-features */
|
|
428
431
|
export declare enum MutableGuildFeatures {
|
|
@@ -587,7 +590,8 @@ export declare enum MessageActivityTypes {
|
|
|
587
590
|
Join = 1,
|
|
588
591
|
Spectate = 2,
|
|
589
592
|
Listen = 3,
|
|
590
|
-
JoinRequest = 5
|
|
593
|
+
JoinRequest = 5,
|
|
594
|
+
StreamRequest = 6
|
|
591
595
|
}
|
|
592
596
|
/** https://discord.com/developers/docs/resources/message#message-object-message-flags */
|
|
593
597
|
export declare enum MessageFlags {
|
|
@@ -769,8 +773,8 @@ export declare enum VisibilityTypes {
|
|
|
769
773
|
/** https://discord.com/developers/docs/resources/subscription#subscription-statuses */
|
|
770
774
|
export declare enum SubscriptionStatuses {
|
|
771
775
|
Active = 0,
|
|
772
|
-
|
|
773
|
-
|
|
776
|
+
Inactive = 1,
|
|
777
|
+
Ending = 2
|
|
774
778
|
}
|
|
775
779
|
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */
|
|
776
780
|
export declare enum WebhookTypes {
|
|
@@ -819,6 +823,10 @@ export declare enum StatusTypes {
|
|
|
819
823
|
Invisible = "invisible",
|
|
820
824
|
Offline = "offline"
|
|
821
825
|
}
|
|
826
|
+
/** https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities */
|
|
827
|
+
export declare enum GatewayCapabilities {
|
|
828
|
+
ChannelObfuscation = 32768
|
|
829
|
+
}
|
|
822
830
|
/** https://discord.com/developers/docs/topics/gateway-events#receive-events */
|
|
823
831
|
export declare enum GatewayEvents {
|
|
824
832
|
Ready = "READY",
|
|
@@ -1093,8 +1101,8 @@ export declare enum JSONErrorCodes {
|
|
|
1093
1101
|
OnlyBotsCanUseThisEndpoint = 20002,
|
|
1094
1102
|
ExplicitContentCannotBeSentToTheDesiredRecipient = 20009,
|
|
1095
1103
|
NotAuthorizedToPerformThisActionOnThisApplication = 20012,
|
|
1104
|
+
ThisActionRequiresAPremiumSubscription = 20015,
|
|
1096
1105
|
ActionCannotBePerformedDueToSlowmodeRateLimit = 20016,
|
|
1097
|
-
TheMazeIsntMeantForYou = 20017,
|
|
1098
1106
|
OnlyTheOwnerOfThisAccountCanPerformThisAction = 20018,
|
|
1099
1107
|
AnnouncementEditLimitExceeded = 20022,
|
|
1100
1108
|
UnderMinimumAge = 20024,
|
|
@@ -1143,6 +1151,7 @@ export declare enum JSONErrorCodes {
|
|
|
1143
1151
|
RequestEntityTooLarge = 40005,
|
|
1144
1152
|
FeatureTemporarilyDisabledServerSide = 40006,
|
|
1145
1153
|
UserBannedFromThisGuild = 40007,
|
|
1154
|
+
OnlyOneChannelCanHaveAParentIdModifiedAtATime = 40009,
|
|
1146
1155
|
ConnectionHasBeenRevoked = 40012,
|
|
1147
1156
|
OnlyConsumableSKUsCanBeConsumed = 40018,
|
|
1148
1157
|
YouCanOnlyDeleteSandboxEntitlements = 40019,
|
|
@@ -1226,6 +1235,7 @@ export declare enum JSONErrorCodes {
|
|
|
1226
1235
|
VoiceMessagesMustHaveSupportingMetadata = 50161,
|
|
1227
1236
|
VoiceMessagesCannotBeEdited = 50162,
|
|
1228
1237
|
CannotDeleteGuildSubscriptionIntegration = 50163,
|
|
1238
|
+
CannotSendVoiceEffectWhenUserIsServerMutedDeafenedOrSuppressed = 50167,
|
|
1229
1239
|
YouCannotSendVoiceMessagesInThisChannel = 50173,
|
|
1230
1240
|
TheUserAccountMustFirstBeVerified = 50178,
|
|
1231
1241
|
TheProvidedFileDoesNotHaveAValidDuration = 50192,
|
|
@@ -1261,6 +1271,7 @@ export declare enum JSONErrorCodes {
|
|
|
1261
1271
|
WebhooksCanOnlyCreateThreadsInForumChannels = 220003,
|
|
1262
1272
|
WebhookServicesCannotBeUsedInForumChannels = 220004,
|
|
1263
1273
|
MessageBlockedByHarmfulLinksFilter = 240000,
|
|
1274
|
+
AccessToJoiningNewServersHasBeenLimitedForTheUser = 340015,
|
|
1264
1275
|
CannotEnableOnboardingRequirementsAreNotMet = 350000,
|
|
1265
1276
|
CannotUpdateOnboardingWhileBelowRequirements = 350001,
|
|
1266
1277
|
AccessToFileUploadsHasBeenLimitedForThisGuild = 400001,
|
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) {
|
|
@@ -364,6 +364,8 @@ var ChannelFlags;
|
|
|
364
364
|
ChannelFlags[ChannelFlags["Pinned"] = 2] = "Pinned";
|
|
365
365
|
ChannelFlags[ChannelFlags["RequiredTag"] = 16] = "RequiredTag";
|
|
366
366
|
ChannelFlags[ChannelFlags["HideMediaDownloadOptions"] = 32768] = "HideMediaDownloadOptions";
|
|
367
|
+
ChannelFlags[ChannelFlags["ChannelObfuscated"] = 131072] = "ChannelObfuscated";
|
|
368
|
+
ChannelFlags[ChannelFlags["IsSpoilerChannel"] = 2097152] = "IsSpoilerChannel";
|
|
367
369
|
})(ChannelFlags || (exports.ChannelFlags = ChannelFlags = {}));
|
|
368
370
|
/** https://discord.com/developers/docs/resources/channel#channel-object-sort-order-types */
|
|
369
371
|
var SortOrderTypes;
|
|
@@ -445,7 +447,10 @@ var GuildFeatures;
|
|
|
445
447
|
GuildFeatures["CreatorStorePage"] = "CREATOR_STORE_PAGE";
|
|
446
448
|
GuildFeatures["DeveloperSupportServer"] = "DEVELOPER_SUPPORT_SERVER";
|
|
447
449
|
GuildFeatures["Discoverable"] = "DISCOVERABLE";
|
|
450
|
+
GuildFeatures["EnhancedRoleColors"] = "ENHANCED_ROLE_COLORS";
|
|
448
451
|
GuildFeatures["Featurable"] = "FEATURABLE";
|
|
452
|
+
GuildFeatures["GuildTags"] = "GUILD_TAGS";
|
|
453
|
+
GuildFeatures["GuestsEnabled"] = "GUESTS_ENABLED";
|
|
449
454
|
GuildFeatures["InvitesDisabled"] = "INVITES_DISABLED";
|
|
450
455
|
GuildFeatures["InviteSplash"] = "INVITE_SPLASH";
|
|
451
456
|
GuildFeatures["MemberVerificationGateEnabled"] = "MEMBER_VERIFICATION_GATE_ENABLED";
|
|
@@ -454,6 +459,7 @@ var GuildFeatures;
|
|
|
454
459
|
GuildFeatures["News"] = "NEWS";
|
|
455
460
|
GuildFeatures["Partnered"] = "PARTNERED";
|
|
456
461
|
GuildFeatures["PreviewEnabled"] = "PREVIEW_ENABLED";
|
|
462
|
+
GuildFeatures["PruneRequiresAdmin"] = "PRUNE_REQUIRES_ADMIN";
|
|
457
463
|
GuildFeatures["RaidAlertsDisabled"] = "RAID_ALERTS_DISABLED";
|
|
458
464
|
GuildFeatures["RoleIcons"] = "ROLE_ICONS";
|
|
459
465
|
GuildFeatures["RoleSubscriptionsAvailableForPurchase"] = "ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE";
|
|
@@ -464,9 +470,6 @@ var GuildFeatures;
|
|
|
464
470
|
GuildFeatures["Verified"] = "VERIFIED";
|
|
465
471
|
GuildFeatures["VipRegions"] = "VIP_REGIONS";
|
|
466
472
|
GuildFeatures["WelcomeScreenEnabled"] = "WELCOME_SCREEN_ENABLED";
|
|
467
|
-
GuildFeatures["GuestsEnabled"] = "GUESTS_ENABLED";
|
|
468
|
-
GuildFeatures["GuildTags"] = "GUILD_TAGS";
|
|
469
|
-
GuildFeatures["EnhancedRoleColors"] = "ENHANCED_ROLE_COLORS";
|
|
470
473
|
})(GuildFeatures || (exports.GuildFeatures = GuildFeatures = {}));
|
|
471
474
|
/** https://discord.com/developers/docs/resources/guild#guild-object-mutable-guild-features */
|
|
472
475
|
var MutableGuildFeatures;
|
|
@@ -651,6 +654,7 @@ var MessageActivityTypes;
|
|
|
651
654
|
MessageActivityTypes[MessageActivityTypes["Spectate"] = 2] = "Spectate";
|
|
652
655
|
MessageActivityTypes[MessageActivityTypes["Listen"] = 3] = "Listen";
|
|
653
656
|
MessageActivityTypes[MessageActivityTypes["JoinRequest"] = 5] = "JoinRequest";
|
|
657
|
+
MessageActivityTypes[MessageActivityTypes["StreamRequest"] = 6] = "StreamRequest";
|
|
654
658
|
})(MessageActivityTypes || (exports.MessageActivityTypes = MessageActivityTypes = {}));
|
|
655
659
|
/** https://discord.com/developers/docs/resources/message#message-object-message-flags */
|
|
656
660
|
var MessageFlags;
|
|
@@ -854,8 +858,8 @@ var VisibilityTypes;
|
|
|
854
858
|
var SubscriptionStatuses;
|
|
855
859
|
(function (SubscriptionStatuses) {
|
|
856
860
|
SubscriptionStatuses[SubscriptionStatuses["Active"] = 0] = "Active";
|
|
857
|
-
SubscriptionStatuses[SubscriptionStatuses["
|
|
858
|
-
SubscriptionStatuses[SubscriptionStatuses["
|
|
861
|
+
SubscriptionStatuses[SubscriptionStatuses["Inactive"] = 1] = "Inactive";
|
|
862
|
+
SubscriptionStatuses[SubscriptionStatuses["Ending"] = 2] = "Ending";
|
|
859
863
|
})(SubscriptionStatuses || (exports.SubscriptionStatuses = SubscriptionStatuses = {}));
|
|
860
864
|
/** https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types */
|
|
861
865
|
var WebhookTypes;
|
|
@@ -908,6 +912,11 @@ var StatusTypes;
|
|
|
908
912
|
StatusTypes["Invisible"] = "invisible";
|
|
909
913
|
StatusTypes["Offline"] = "offline";
|
|
910
914
|
})(StatusTypes || (exports.StatusTypes = StatusTypes = {}));
|
|
915
|
+
/** https://docs.discord.com/developers/events/gateway-events#identify-gateway-capabilities */
|
|
916
|
+
var GatewayCapabilities;
|
|
917
|
+
(function (GatewayCapabilities) {
|
|
918
|
+
GatewayCapabilities[GatewayCapabilities["ChannelObfuscation"] = 32768] = "ChannelObfuscation";
|
|
919
|
+
})(GatewayCapabilities || (exports.GatewayCapabilities = GatewayCapabilities = {}));
|
|
911
920
|
/** https://discord.com/developers/docs/topics/gateway-events#receive-events */
|
|
912
921
|
var GatewayEvents;
|
|
913
922
|
(function (GatewayEvents) {
|
|
@@ -1193,8 +1202,8 @@ var JSONErrorCodes;
|
|
|
1193
1202
|
JSONErrorCodes[JSONErrorCodes["OnlyBotsCanUseThisEndpoint"] = 20002] = "OnlyBotsCanUseThisEndpoint";
|
|
1194
1203
|
JSONErrorCodes[JSONErrorCodes["ExplicitContentCannotBeSentToTheDesiredRecipient"] = 20009] = "ExplicitContentCannotBeSentToTheDesiredRecipient";
|
|
1195
1204
|
JSONErrorCodes[JSONErrorCodes["NotAuthorizedToPerformThisActionOnThisApplication"] = 20012] = "NotAuthorizedToPerformThisActionOnThisApplication";
|
|
1205
|
+
JSONErrorCodes[JSONErrorCodes["ThisActionRequiresAPremiumSubscription"] = 20015] = "ThisActionRequiresAPremiumSubscription";
|
|
1196
1206
|
JSONErrorCodes[JSONErrorCodes["ActionCannotBePerformedDueToSlowmodeRateLimit"] = 20016] = "ActionCannotBePerformedDueToSlowmodeRateLimit";
|
|
1197
|
-
JSONErrorCodes[JSONErrorCodes["TheMazeIsntMeantForYou"] = 20017] = "TheMazeIsntMeantForYou";
|
|
1198
1207
|
JSONErrorCodes[JSONErrorCodes["OnlyTheOwnerOfThisAccountCanPerformThisAction"] = 20018] = "OnlyTheOwnerOfThisAccountCanPerformThisAction";
|
|
1199
1208
|
JSONErrorCodes[JSONErrorCodes["AnnouncementEditLimitExceeded"] = 20022] = "AnnouncementEditLimitExceeded";
|
|
1200
1209
|
JSONErrorCodes[JSONErrorCodes["UnderMinimumAge"] = 20024] = "UnderMinimumAge";
|
|
@@ -1243,6 +1252,7 @@ var JSONErrorCodes;
|
|
|
1243
1252
|
JSONErrorCodes[JSONErrorCodes["RequestEntityTooLarge"] = 40005] = "RequestEntityTooLarge";
|
|
1244
1253
|
JSONErrorCodes[JSONErrorCodes["FeatureTemporarilyDisabledServerSide"] = 40006] = "FeatureTemporarilyDisabledServerSide";
|
|
1245
1254
|
JSONErrorCodes[JSONErrorCodes["UserBannedFromThisGuild"] = 40007] = "UserBannedFromThisGuild";
|
|
1255
|
+
JSONErrorCodes[JSONErrorCodes["OnlyOneChannelCanHaveAParentIdModifiedAtATime"] = 40009] = "OnlyOneChannelCanHaveAParentIdModifiedAtATime";
|
|
1246
1256
|
JSONErrorCodes[JSONErrorCodes["ConnectionHasBeenRevoked"] = 40012] = "ConnectionHasBeenRevoked";
|
|
1247
1257
|
JSONErrorCodes[JSONErrorCodes["OnlyConsumableSKUsCanBeConsumed"] = 40018] = "OnlyConsumableSKUsCanBeConsumed";
|
|
1248
1258
|
JSONErrorCodes[JSONErrorCodes["YouCanOnlyDeleteSandboxEntitlements"] = 40019] = "YouCanOnlyDeleteSandboxEntitlements";
|
|
@@ -1326,6 +1336,7 @@ var JSONErrorCodes;
|
|
|
1326
1336
|
JSONErrorCodes[JSONErrorCodes["VoiceMessagesMustHaveSupportingMetadata"] = 50161] = "VoiceMessagesMustHaveSupportingMetadata";
|
|
1327
1337
|
JSONErrorCodes[JSONErrorCodes["VoiceMessagesCannotBeEdited"] = 50162] = "VoiceMessagesCannotBeEdited";
|
|
1328
1338
|
JSONErrorCodes[JSONErrorCodes["CannotDeleteGuildSubscriptionIntegration"] = 50163] = "CannotDeleteGuildSubscriptionIntegration";
|
|
1339
|
+
JSONErrorCodes[JSONErrorCodes["CannotSendVoiceEffectWhenUserIsServerMutedDeafenedOrSuppressed"] = 50167] = "CannotSendVoiceEffectWhenUserIsServerMutedDeafenedOrSuppressed";
|
|
1329
1340
|
JSONErrorCodes[JSONErrorCodes["YouCannotSendVoiceMessagesInThisChannel"] = 50173] = "YouCannotSendVoiceMessagesInThisChannel";
|
|
1330
1341
|
JSONErrorCodes[JSONErrorCodes["TheUserAccountMustFirstBeVerified"] = 50178] = "TheUserAccountMustFirstBeVerified";
|
|
1331
1342
|
JSONErrorCodes[JSONErrorCodes["TheProvidedFileDoesNotHaveAValidDuration"] = 50192] = "TheProvidedFileDoesNotHaveAValidDuration";
|
|
@@ -1361,6 +1372,7 @@ var JSONErrorCodes;
|
|
|
1361
1372
|
JSONErrorCodes[JSONErrorCodes["WebhooksCanOnlyCreateThreadsInForumChannels"] = 220003] = "WebhooksCanOnlyCreateThreadsInForumChannels";
|
|
1362
1373
|
JSONErrorCodes[JSONErrorCodes["WebhookServicesCannotBeUsedInForumChannels"] = 220004] = "WebhookServicesCannotBeUsedInForumChannels";
|
|
1363
1374
|
JSONErrorCodes[JSONErrorCodes["MessageBlockedByHarmfulLinksFilter"] = 240000] = "MessageBlockedByHarmfulLinksFilter";
|
|
1375
|
+
JSONErrorCodes[JSONErrorCodes["AccessToJoiningNewServersHasBeenLimitedForTheUser"] = 340015] = "AccessToJoiningNewServersHasBeenLimitedForTheUser";
|
|
1364
1376
|
JSONErrorCodes[JSONErrorCodes["CannotEnableOnboardingRequirementsAreNotMet"] = 350000] = "CannotEnableOnboardingRequirementsAreNotMet";
|
|
1365
1377
|
JSONErrorCodes[JSONErrorCodes["CannotUpdateOnboardingWhileBelowRequirements"] = 350001] = "CannotUpdateOnboardingWhileBelowRequirements";
|
|
1366
1378
|
JSONErrorCodes[JSONErrorCodes["AccessToFileUploadsHasBeenLimitedForThisGuild"] = 400001] = "AccessToFileUploadsHasBeenLimitedForThisGuild";
|
|
@@ -337,6 +337,7 @@ exports.Handlers = {
|
|
|
337
337
|
? transformers_1.Guilds.guildMemberFromRaw(data.member)
|
|
338
338
|
: undefined,
|
|
339
339
|
mentions: data.mentions.map((mention) => transformers_1.Users.userFromRaw(mention)),
|
|
340
|
+
channelType: data.channel_type,
|
|
340
341
|
});
|
|
341
342
|
},
|
|
342
343
|
[constants_1.GatewayEvents.MessageUpdate]: (shard, data) => {
|
|
@@ -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 */
|
|
@@ -60,7 +61,7 @@ class Transmitter {
|
|
|
60
61
|
requestChannelInfo(options) {
|
|
61
62
|
this.send(constants_1.GatewayOPCodes.RequestChannelInfo, {
|
|
62
63
|
guild_id: options.guildId,
|
|
63
|
-
fields: options.fields
|
|
64
|
+
fields: options.fields,
|
|
64
65
|
});
|
|
65
66
|
}
|
|
66
67
|
/** https://discord.com/developers/docs/topics/gateway-events#resume */
|
|
@@ -60,7 +60,7 @@ 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`;
|
|
@@ -113,7 +113,9 @@ export declare const sticker: (stickerId: snowflake) => `stickers/${string}`;
|
|
|
113
113
|
export declare const voiceRegions: () => "voice/regions";
|
|
114
114
|
export declare const lobbies: () => "lobbies";
|
|
115
115
|
export declare const lobby: (lobbyId: snowflake) => `lobbies/${string}`;
|
|
116
|
+
export declare const lobbyMessages: (lobbyId: snowflake) => `lobbies/${string}/messages`;
|
|
116
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`;
|
|
117
119
|
export declare const lobbyChannelLinking: (lobbyId: snowflake) => `lobbies/${string}/channel-linking`;
|
|
118
120
|
export declare const lobbyMembersBulk: (lobbyId: snowflake) => `lobbies/${string}/members/bulk`;
|
|
119
121
|
export declare const lobbyMessageModerationMetadata: (lobbyId: snowflake, messageId: snowflake) => `lobbies/${string}/messages/${string}/moderation-metadata`;
|
|
@@ -2,7 +2,7 @@
|
|
|
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
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.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 = exports.gatewayBot = 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;
|
|
@@ -253,8 +253,12 @@ const lobbies = () => "lobbies";
|
|
|
253
253
|
exports.lobbies = lobbies;
|
|
254
254
|
const lobby = (lobbyId) => `lobbies/${lobbyId}`;
|
|
255
255
|
exports.lobby = lobby;
|
|
256
|
+
const lobbyMessages = (lobbyId) => `lobbies/${lobbyId}/messages`;
|
|
257
|
+
exports.lobbyMessages = lobbyMessages;
|
|
256
258
|
const lobbyMember = (lobbyId, userId = "@me") => `lobbies/${lobbyId}/members/${userId}`;
|
|
257
259
|
exports.lobbyMember = lobbyMember;
|
|
260
|
+
const lobbyChannelInvite = (lobbyId, userId = "@me") => `lobbies/${lobbyId}/members/${userId}/invites`;
|
|
261
|
+
exports.lobbyChannelInvite = lobbyChannelInvite;
|
|
258
262
|
const lobbyChannelLinking = (lobbyId) => `lobbies/${lobbyId}/channel-linking`;
|
|
259
263
|
exports.lobbyChannelLinking = lobbyChannelLinking;
|
|
260
264
|
const lobbyMembersBulk = (lobbyId) => `lobbies/${lobbyId}/members/bulk`;
|
|
@@ -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
|
}
|
|
@@ -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 {
|
|
@@ -19,7 +19,7 @@ export interface RawChannel {
|
|
|
19
19
|
recipients?: Array<RawUser>;
|
|
20
20
|
icon?: string | null;
|
|
21
21
|
owner_id?: snowflake;
|
|
22
|
-
application_id?: snowflake;
|
|
22
|
+
application_id?: snowflake | null;
|
|
23
23
|
managed?: boolean;
|
|
24
24
|
parent_id?: snowflake | null;
|
|
25
25
|
last_pin_timestamp?: timestamp | null;
|
|
@@ -31,6 +31,7 @@ export interface RawChannel {
|
|
|
31
31
|
member?: RawThreadMember;
|
|
32
32
|
default_auto_archive_duration?: number;
|
|
33
33
|
permissions?: string;
|
|
34
|
+
app_permissions?: string;
|
|
34
35
|
flags?: ChannelFlags;
|
|
35
36
|
total_message_sent?: number;
|
|
36
37
|
available_tags?: Array<RawForumTag>;
|
|
@@ -99,7 +100,7 @@ export interface Channel {
|
|
|
99
100
|
recipients?: Array<User>;
|
|
100
101
|
icon?: string | null;
|
|
101
102
|
ownerId?: snowflake;
|
|
102
|
-
applicationId?: snowflake;
|
|
103
|
+
applicationId?: snowflake | null;
|
|
103
104
|
managed?: boolean;
|
|
104
105
|
parentId?: snowflake | null;
|
|
105
106
|
lastPinTimestamp?: timestamp | null;
|
|
@@ -111,6 +112,7 @@ export interface Channel {
|
|
|
111
112
|
member?: ThreadMember;
|
|
112
113
|
defaultAutoArchiveDuration?: number;
|
|
113
114
|
permissions?: string;
|
|
115
|
+
appPermissions?: string;
|
|
114
116
|
flags?: ChannelFlags;
|
|
115
117
|
totalMessageSent?: number;
|
|
116
118
|
availableTags?: Array<ForumTag>;
|
|
@@ -238,6 +238,7 @@ export interface RawFileUpload {
|
|
|
238
238
|
min_values?: number;
|
|
239
239
|
max_values?: number;
|
|
240
240
|
required?: boolean;
|
|
241
|
+
file_types?: Array<"image" | "video" | "audio" | string>;
|
|
241
242
|
}
|
|
242
243
|
/** https://discord.com/developers/docs/components/reference#file-upload-file-upload-interaction-response-structure */
|
|
243
244
|
export interface RawFileUploadInteractionResponse {
|
|
@@ -554,6 +555,7 @@ export interface FileUpload {
|
|
|
554
555
|
minValues?: number;
|
|
555
556
|
maxValues?: number;
|
|
556
557
|
required?: boolean;
|
|
558
|
+
fileTypes?: Array<"image" | "video" | "audio" | string>;
|
|
557
559
|
}
|
|
558
560
|
/** https://discord.com/developers/docs/components/reference#file-upload-file-upload-interaction-response-structure */
|
|
559
561
|
export interface FileUploadInteractionResponse {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActivityFlags, ActivityType, AnimationTypes, GatewayEvents, GatewayIntents, GatewayOPCodes, GuildMemberFlags, InviteTargetTypes, ReactionTypes, StatusTypes, TriggerTypes } from "../constants";
|
|
1
|
+
import type { ActivityFlags, ActivityType, AnimationTypes, ChannelTypes, GatewayCapabilities, GatewayEvents, GatewayIntents, GatewayOPCodes, GuildMemberFlags, InviteTargetTypes, ReactionTypes, StatusTypes, TriggerTypes } from "../constants";
|
|
2
2
|
import type { RawApplication, Application } from "./application";
|
|
3
3
|
import type { RawAutoModerationAction, AutoModerationAction } from "./auto-moderation";
|
|
4
4
|
import type { RawChannel, RawThreadMember, Channel, ThreadMember } from "./channel";
|
|
@@ -28,6 +28,7 @@ export interface RawIdentify {
|
|
|
28
28
|
shard?: [number, number];
|
|
29
29
|
presence?: Partial<Pick<RawGatewayPresenceUpdate, "since" | "activities" | "status" | "afk">>;
|
|
30
30
|
intents: GatewayIntents;
|
|
31
|
+
capabilities?: GatewayCapabilities;
|
|
31
32
|
}
|
|
32
33
|
/** https://discord.com/developers/docs/events/gateway-events#identify-identify-connection-properties */
|
|
33
34
|
export interface RawIdentifyConnectionProperties {
|
|
@@ -81,7 +82,7 @@ export interface RawReadyEvent {
|
|
|
81
82
|
session_id: string;
|
|
82
83
|
resume_gateway_url: string;
|
|
83
84
|
shard?: [number, number];
|
|
84
|
-
application: Pick<RawApplication, "id" | "flags">;
|
|
85
|
+
application: Pick<RawApplication, "id" | "flags" | "flags_new">;
|
|
85
86
|
}
|
|
86
87
|
/** https://discord.com/developers/docs/events/gateway-events#auto-moderation-action-execution-auto-moderation-action-execution-event-fields */
|
|
87
88
|
export interface RawAutoModerationActionExecutionEvent {
|
|
@@ -309,6 +310,7 @@ export interface RawMessageCreateEventExtra {
|
|
|
309
310
|
guild_id?: snowflake;
|
|
310
311
|
member?: RawGuildMember;
|
|
311
312
|
mentions: Array<RawUser>;
|
|
313
|
+
channel_type?: ChannelTypes;
|
|
312
314
|
}
|
|
313
315
|
/** https://discord.com/developers/docs/events/gateway-events#message-delete-message-delete-event-fields */
|
|
314
316
|
export interface RawMessageDeleteEvent {
|
|
@@ -371,6 +373,7 @@ export interface RawClientStatus {
|
|
|
371
373
|
desktop?: string;
|
|
372
374
|
mobile?: string;
|
|
373
375
|
web?: string;
|
|
376
|
+
vr?: string;
|
|
374
377
|
}
|
|
375
378
|
/** https://discord.com/developers/docs/events/gateway-events#activity-object-activity-structure */
|
|
376
379
|
export interface RawActivity {
|
|
@@ -497,6 +500,7 @@ export interface Identify {
|
|
|
497
500
|
shard?: [number, number];
|
|
498
501
|
presence?: Partial<Pick<GatewayPresenceUpdate, "since" | "activities" | "status" | "afk">>;
|
|
499
502
|
intents: GatewayIntents;
|
|
503
|
+
capabilities?: GatewayCapabilities;
|
|
500
504
|
}
|
|
501
505
|
/** https://discord.com/developers/docs/events/gateway-events#identify-identify-connection-properties */
|
|
502
506
|
export interface IdentifyConnectionProperties {
|
|
@@ -550,7 +554,7 @@ export interface ReadyEvent {
|
|
|
550
554
|
sessionId: string;
|
|
551
555
|
resumeGatewayURL: string;
|
|
552
556
|
shard?: [number, number];
|
|
553
|
-
application: Pick<Application, "id" | "flags">;
|
|
557
|
+
application: Pick<Application, "id" | "flags" | "flagsNew">;
|
|
554
558
|
}
|
|
555
559
|
/** https://discord.com/developers/docs/events/gateway-events#auto-moderation-action-execution-auto-moderation-action-execution-event-fields */
|
|
556
560
|
export interface AutoModerationActionExecutionEvent {
|
|
@@ -778,6 +782,7 @@ export interface MessageCreateEventExtra {
|
|
|
778
782
|
guildId?: snowflake;
|
|
779
783
|
member?: GuildMember;
|
|
780
784
|
mentions: Array<User>;
|
|
785
|
+
channelType?: ChannelTypes;
|
|
781
786
|
}
|
|
782
787
|
/** https://discord.com/developers/docs/events/gateway-events#message-delete-message-delete-event-fields */
|
|
783
788
|
export interface MessageDeleteEvent {
|
|
@@ -840,6 +845,7 @@ export interface ClientStatus {
|
|
|
840
845
|
desktop?: string;
|
|
841
846
|
mobile?: string;
|
|
842
847
|
web?: string;
|
|
848
|
+
vr?: string;
|
|
843
849
|
}
|
|
844
850
|
/** https://discord.com/developers/docs/events/gateway-events#activity-object-activity-structure */
|
|
845
851
|
export interface Activity {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { LobbyMemberFlags } from "../constants";
|
|
1
|
+
import type { LobbyMemberFlags, MessageFlags, MessageTypes } from "../constants";
|
|
2
2
|
import type { RawChannel } from "./channel";
|
|
3
3
|
import type { snowflake } from "./common";
|
|
4
|
+
import { RawUser, User } from "./user";
|
|
4
5
|
/** https://discord.com/developers/docs/resources/lobby#lobby-object */
|
|
5
6
|
export interface RawLobby {
|
|
6
7
|
id: snowflake;
|
|
@@ -14,6 +15,24 @@ export interface RawLobbyMember {
|
|
|
14
15
|
id: snowflake;
|
|
15
16
|
metadata?: Record<string, string> | null;
|
|
16
17
|
flags?: LobbyMemberFlags;
|
|
18
|
+
additional_name?: string;
|
|
19
|
+
}
|
|
20
|
+
/** https://docs.discord.com/developers/resources/lobby#lobby-message-object */
|
|
21
|
+
export interface RawLobbyMessage {
|
|
22
|
+
id: snowflake;
|
|
23
|
+
type: MessageTypes;
|
|
24
|
+
content: string;
|
|
25
|
+
lobby_id: snowflake;
|
|
26
|
+
channel_id: snowflake;
|
|
27
|
+
author: RawUser;
|
|
28
|
+
metadata?: Record<string, string> | null;
|
|
29
|
+
moderation_metadata?: Record<string, string> | null;
|
|
30
|
+
flags: MessageFlags;
|
|
31
|
+
application_id: snowflake;
|
|
32
|
+
}
|
|
33
|
+
/** https://docs.discord.com/developers/resources/lobby#create-lobby-channel-invite-for-user#lobby-invite-object */
|
|
34
|
+
export interface RawLobbyInvite {
|
|
35
|
+
code: string;
|
|
17
36
|
}
|
|
18
37
|
/** https://discord.com/developers/docs/resources/lobby#lobby-object */
|
|
19
38
|
export interface Lobby {
|
|
@@ -28,4 +47,22 @@ export interface LobbyMember {
|
|
|
28
47
|
id: snowflake;
|
|
29
48
|
metadata?: Record<string, string> | null;
|
|
30
49
|
flags?: LobbyMemberFlags;
|
|
50
|
+
additionalName?: string;
|
|
51
|
+
}
|
|
52
|
+
/** https://docs.discord.com/developers/resources/lobby#lobby-message-object */
|
|
53
|
+
export interface LobbyMessage {
|
|
54
|
+
id: snowflake;
|
|
55
|
+
type: MessageTypes;
|
|
56
|
+
content: string;
|
|
57
|
+
lobbyId: snowflake;
|
|
58
|
+
channelId: snowflake;
|
|
59
|
+
author: User;
|
|
60
|
+
metadata?: Record<string, string> | null;
|
|
61
|
+
moderationMetadata?: Record<string, string> | null;
|
|
62
|
+
flags: MessageFlags;
|
|
63
|
+
applicationId: snowflake;
|
|
64
|
+
}
|
|
65
|
+
/** https://docs.discord.com/developers/resources/lobby#create-lobby-channel-invite-for-user#lobby-invite-object */
|
|
66
|
+
export interface LobbyInvite {
|
|
67
|
+
code: string;
|
|
31
68
|
}
|
|
@@ -197,6 +197,16 @@ export interface RawAttachment {
|
|
|
197
197
|
clip_created_at?: timestamp;
|
|
198
198
|
application?: RawApplication | null;
|
|
199
199
|
}
|
|
200
|
+
/** https://docs.discord.com/developers/resources/message#attachment-object-attachment-request-structure */
|
|
201
|
+
export interface RawAttachmentRequest {
|
|
202
|
+
id: snowflake | number;
|
|
203
|
+
filename?: string;
|
|
204
|
+
title?: string;
|
|
205
|
+
description?: string;
|
|
206
|
+
duration_secs?: number;
|
|
207
|
+
waveform?: string;
|
|
208
|
+
is_spoiler?: boolean;
|
|
209
|
+
}
|
|
200
210
|
/** https://discord.com/developers/docs/resources/message#channel-mention-object-channel-mention-structure */
|
|
201
211
|
export interface RawChannelMention {
|
|
202
212
|
id: snowflake;
|
|
@@ -419,6 +429,16 @@ export interface Attachment {
|
|
|
419
429
|
clipCreatedAt?: timestamp;
|
|
420
430
|
application?: Application | null;
|
|
421
431
|
}
|
|
432
|
+
/** https://docs.discord.com/developers/resources/message#attachment-object-attachment-request-structure */
|
|
433
|
+
export interface AttachmentRequest {
|
|
434
|
+
id: snowflake | number;
|
|
435
|
+
filename?: string;
|
|
436
|
+
title?: string;
|
|
437
|
+
description?: string;
|
|
438
|
+
durationSecs?: number;
|
|
439
|
+
waveform?: string;
|
|
440
|
+
isSpoiler?: boolean;
|
|
441
|
+
}
|
|
422
442
|
/** https://discord.com/developers/docs/resources/message#channel-mention-object-channel-mention-structure */
|
|
423
443
|
export interface ChannelMention {
|
|
424
444
|
id: snowflake;
|
|
@@ -7,6 +7,8 @@ export declare function channelMention(channelId: snowflake): string;
|
|
|
7
7
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
|
8
8
|
export declare function roleMention(roleId: snowflake): string;
|
|
9
9
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
|
10
|
+
export declare function gameProfile(gameId: snowflake): string;
|
|
11
|
+
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
|
10
12
|
export declare function slashCommandMention(commandName: string, commandId: snowflake, subCommandName?: string, subCommandGroupName?: string): string;
|
|
11
13
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
|
12
14
|
export declare function customEmoji(emojiName: string, emojiId: snowflake, animated?: boolean): string;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.userMention = userMention;
|
|
4
4
|
exports.channelMention = channelMention;
|
|
5
5
|
exports.roleMention = roleMention;
|
|
6
|
+
exports.gameProfile = gameProfile;
|
|
6
7
|
exports.slashCommandMention = slashCommandMention;
|
|
7
8
|
exports.customEmoji = customEmoji;
|
|
8
9
|
exports.unixTimestamp = unixTimestamp;
|
|
@@ -23,6 +24,10 @@ function roleMention(roleId) {
|
|
|
23
24
|
return `<@&${roleId}>`;
|
|
24
25
|
}
|
|
25
26
|
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
|
27
|
+
function gameProfile(gameId) {
|
|
28
|
+
return `<@$${gameId}>`;
|
|
29
|
+
}
|
|
30
|
+
/** https://discord.com/developers/docs/reference#message-formatting-formats */
|
|
26
31
|
function slashCommandMention(commandName, commandId, subCommandName, subCommandGroupName) {
|
|
27
32
|
return subCommandName
|
|
28
33
|
? subCommandGroupName
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "disgroove",
|
|
3
|
-
"version": "3.0.1
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "A module to interface with Discord",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"types": "./dist/lib/index.d.ts",
|
|
@@ -18,19 +18,20 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"wrapper"
|
|
20
20
|
],
|
|
21
|
-
"author": "
|
|
21
|
+
"author": "Sergio Gotuzzo",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"bugs": {
|
|
24
24
|
"url": "https://github.com/sergiogotuzzo/disgroove/issues"
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/sergiogotuzzo/disgroove#readme",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@types/node": "^22.
|
|
28
|
+
"@types/node": "^22.20.1",
|
|
29
29
|
"@types/ws": "^8.18.1",
|
|
30
30
|
"typescript": "^5.9.3",
|
|
31
|
-
"undici-types": "^7.
|
|
31
|
+
"undici-types": "^7.29.1",
|
|
32
|
+
"@types/bun": "latest"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"ws": "^8.
|
|
35
|
+
"ws": "^8.21.3"
|
|
35
36
|
}
|
|
36
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "disgroove",
|
|
3
|
-
"version": "3.0.1
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "A module to interface with Discord",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"types": "./dist/lib/index.d.ts",
|
|
@@ -18,19 +18,20 @@
|
|
|
18
18
|
"rest",
|
|
19
19
|
"wrapper"
|
|
20
20
|
],
|
|
21
|
-
"author": "
|
|
21
|
+
"author": "Sergio Gotuzzo",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"bugs": {
|
|
24
24
|
"url": "https://github.com/sergiogotuzzo/disgroove/issues"
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/sergiogotuzzo/disgroove#readme",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@types/node": "^22.
|
|
28
|
+
"@types/node": "^22.20.1",
|
|
29
29
|
"@types/ws": "^8.18.1",
|
|
30
30
|
"typescript": "^5.9.3",
|
|
31
|
-
"undici-types": "^7.
|
|
31
|
+
"undici-types": "^7.29.1",
|
|
32
|
+
"@types/bun": "latest"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"ws": "^8.
|
|
35
|
+
"ws": "^8.21.3"
|
|
35
36
|
}
|
|
36
|
-
}
|
|
37
|
+
}
|