disgroove 2.2.7-dev.045389f → 2.2.7-dev.3f5b5fb
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/dist/lib/Client.d.ts +40 -8
- package/dist/lib/Client.js +64 -18
- package/dist/lib/constants.d.ts +4 -0
- package/dist/lib/constants.js +6 -1
- package/dist/lib/rest/Endpoints.d.ts +4 -0
- package/dist/lib/rest/Endpoints.js +10 -1
- package/dist/lib/transformers/Components.d.ts +2 -2
- package/dist/lib/transformers/Components.js +54 -24
- package/dist/lib/transformers/Interactions.js +50 -8
- package/dist/lib/transformers/Lobbies.d.ts +7 -0
- package/dist/lib/transformers/Lobbies.js +38 -0
- package/dist/lib/transformers/Messages.d.ts +3 -3
- package/dist/lib/transformers/Messages.js +0 -28
- package/dist/lib/transformers/index.d.ts +2 -1
- package/dist/lib/transformers/index.js +2 -1
- package/dist/lib/types/interaction.d.ts +11 -5
- package/dist/lib/types/lobby.d.ts +29 -0
- package/dist/lib/types/lobby.js +2 -0
- package/dist/lib/types/message-components.d.ts +93 -2
- package/dist/lib/types/message.d.ts +3 -3
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/lib/Client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
/// <reference types="node" />
|
|
4
|
-
import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type ReactionTypes, type ApplicationCommandTypes, type EventTypes, type TriggerTypes, type ChannelTypes, type VideoQualityModes, type SortOrderTypes, type ForumLayoutTypes, type InviteTargetTypes, type VerificationLevel, type DefaultMessageNotificationLevel, type ExplicitContentFilterLevel, type SystemChannelFlags, type ApplicationFlags, type ApplicationIntegrationTypes, type ChannelFlags, type GuildFeatures, type GuildScheduledEventEntityTypes, type GuildScheduledEventPrivacyLevel, type GuildScheduledEventStatus, type MessageFlags, type OnboardingMode, type PrivacyLevel, type GuildMemberFlags, type InteractionContextTypes } from "./constants";
|
|
4
|
+
import { GatewayIntents, type OAuth2Scopes, type ActionTypes, type ImageWidgetStyleOptions, type ReactionTypes, type ApplicationCommandTypes, type EventTypes, type TriggerTypes, type ChannelTypes, type VideoQualityModes, type SortOrderTypes, type ForumLayoutTypes, type InviteTargetTypes, type VerificationLevel, type DefaultMessageNotificationLevel, type ExplicitContentFilterLevel, type SystemChannelFlags, type ApplicationFlags, type ApplicationIntegrationTypes, type ChannelFlags, type GuildFeatures, type GuildScheduledEventEntityTypes, type GuildScheduledEventPrivacyLevel, type GuildScheduledEventStatus, type MessageFlags, type OnboardingMode, type PrivacyLevel, type GuildMemberFlags, type InteractionContextTypes, type LobbyMemberFlags } from "./constants";
|
|
5
5
|
import { RequestManager, type FileData } from "./rest";
|
|
6
6
|
import EventEmitter from "node:events";
|
|
7
7
|
import { Shard } from "./gateway";
|
|
@@ -33,6 +33,7 @@ import type { Embed, AllowedMentions, Attachment, Message, MessageReference, Mes
|
|
|
33
33
|
import type { Subscription } from "./types/subscription";
|
|
34
34
|
import type { SoundboardSound } from "./types/soundboard";
|
|
35
35
|
import type { ActionRow, Button, ChannelSelect, Container, File, MediaGallery, MentionableSelect, RoleSelect, Section, Separator, StringSelect, TextDisplay, Thumbnail, UserSelect } from "./types/message-components";
|
|
36
|
+
import type { Lobby, LobbyMember } from "./types/lobby";
|
|
36
37
|
export interface GatewayOptions {
|
|
37
38
|
properties?: IdentifyConnectionProperties;
|
|
38
39
|
compress?: boolean;
|
|
@@ -78,6 +79,11 @@ export declare class Client extends EventEmitter {
|
|
|
78
79
|
}): Promise<GuildMember | null>;
|
|
79
80
|
/** https://discord.com/developers/docs/resources/guild#add-guild-member-role */
|
|
80
81
|
addGuildMemberRole(guildID: snowflake, userID: snowflake, roleID: snowflake, reason?: string): void;
|
|
82
|
+
/** https://discord.com/developers/docs/resources/lobby#add-a-member-to-a-lobby */
|
|
83
|
+
addLobbyMember(lobbyID: snowflake, userID: snowflake, options: {
|
|
84
|
+
metadata?: Record<string, string> | null;
|
|
85
|
+
flags?: LobbyMemberFlags;
|
|
86
|
+
}): Promise<LobbyMember>;
|
|
81
87
|
/** https://discord.com/developers/docs/resources/channel#add-thread-member */
|
|
82
88
|
addThreadMember(channelID: snowflake, userID: snowflake): void;
|
|
83
89
|
/** https://discord.com/developers/docs/resources/guild#begin-guild-prune */
|
|
@@ -276,7 +282,7 @@ export declare class Client extends EventEmitter {
|
|
|
276
282
|
tts?: boolean;
|
|
277
283
|
embeds?: Array<Embed>;
|
|
278
284
|
allowedMentions?: AllowedMentions;
|
|
279
|
-
components?: Array<ActionRow |
|
|
285
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
280
286
|
files?: Array<FileData> | null;
|
|
281
287
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
282
288
|
flags?: MessageFlags;
|
|
@@ -288,6 +294,12 @@ export declare class Client extends EventEmitter {
|
|
|
288
294
|
createInteractionResponse(interactionID: snowflake, interactionToken: string, options: InteractionResponse & {
|
|
289
295
|
withResponse?: boolean;
|
|
290
296
|
}): Promise<void | InteractionCallbackResponse>;
|
|
297
|
+
/** https://discord.com/developers/docs/resources/lobby#create-lobby */
|
|
298
|
+
createLobby(options: {
|
|
299
|
+
metadata?: Record<string, string> | null;
|
|
300
|
+
members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags">>;
|
|
301
|
+
idleTimeoutSeconds?: number;
|
|
302
|
+
}): Promise<Lobby>;
|
|
291
303
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
|
292
304
|
createMessage(channelID: snowflake, options: {
|
|
293
305
|
content?: string;
|
|
@@ -296,7 +308,7 @@ export declare class Client extends EventEmitter {
|
|
|
296
308
|
embeds?: Array<Embed>;
|
|
297
309
|
allowedMentions?: AllowedMentions;
|
|
298
310
|
messageReference?: MessageReference;
|
|
299
|
-
components?: Array<ActionRow |
|
|
311
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
300
312
|
stickersIDs?: Array<snowflake>;
|
|
301
313
|
files?: Array<FileData>;
|
|
302
314
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
@@ -387,6 +399,8 @@ export declare class Client extends EventEmitter {
|
|
|
387
399
|
deleteInteractionFollowupMessage(applicationID: snowflake, interactionToken: string, messageID: snowflake): void;
|
|
388
400
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#delete-original-interaction-response */
|
|
389
401
|
deleteInteractionResponse(applicationID: snowflake, interactionToken: string): void;
|
|
402
|
+
/** https://discord.com/developers/docs/resources/lobby#delete-lobby */
|
|
403
|
+
deleteLobby(lobbyID: snowflake): void;
|
|
390
404
|
/** https://discord.com/developers/docs/resources/message#delete-message */
|
|
391
405
|
deleteMessage(channelID: snowflake, messageID: snowflake, reason?: string): void;
|
|
392
406
|
/** https://discord.com/developers/docs/resources/message#delete-user-reaction */
|
|
@@ -623,13 +637,19 @@ export declare class Client extends EventEmitter {
|
|
|
623
637
|
enabled?: boolean;
|
|
624
638
|
channelID?: boolean;
|
|
625
639
|
}, reason?: string): Promise<GuildWidgetSettings>;
|
|
640
|
+
/** https://discord.com/developers/docs/resources/lobby#modify-lobby */
|
|
641
|
+
editLobby(lobbyID: snowflake, options: {
|
|
642
|
+
metadata?: Record<string, string> | null;
|
|
643
|
+
members?: Array<Pick<LobbyMember, "id" | "metadata" | "flags">>;
|
|
644
|
+
idleTimeoutSeconds?: number;
|
|
645
|
+
}): Promise<Lobby>;
|
|
626
646
|
/** https://discord.com/developers/docs/resources/message#edit-message */
|
|
627
647
|
editMessage(channelID: snowflake, messageID: snowflake, options: {
|
|
628
648
|
content?: string | null;
|
|
629
649
|
embeds?: Array<Embed> | null;
|
|
630
650
|
flags?: MessageFlags | null;
|
|
631
651
|
allowedMentions?: AllowedMentions | null;
|
|
632
|
-
components?: Array<ActionRow |
|
|
652
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
|
|
633
653
|
files?: Array<FileData> | null;
|
|
634
654
|
attachments?: Array<Attachment> | null;
|
|
635
655
|
}): Promise<Message>;
|
|
@@ -643,7 +663,7 @@ export declare class Client extends EventEmitter {
|
|
|
643
663
|
content?: string | null;
|
|
644
664
|
embeds?: Array<Embed> | null;
|
|
645
665
|
allowedMentions?: AllowedMentions | null;
|
|
646
|
-
components?: Array<ActionRow |
|
|
666
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
|
|
647
667
|
files?: Array<FileData> | null;
|
|
648
668
|
attachments?: Array<Partial<Attachment>> | null;
|
|
649
669
|
poll?: PollCreateParams | null;
|
|
@@ -654,7 +674,7 @@ export declare class Client extends EventEmitter {
|
|
|
654
674
|
content?: string | null;
|
|
655
675
|
embeds?: Array<Embed> | null;
|
|
656
676
|
allowedMentions?: AllowedMentions | null;
|
|
657
|
-
components?: Array<ActionRow |
|
|
677
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
|
|
658
678
|
files?: Array<FileData> | null;
|
|
659
679
|
attachments?: Array<Partial<Attachment>> | null;
|
|
660
680
|
poll?: PollCreateParams | null;
|
|
@@ -676,7 +696,7 @@ export declare class Client extends EventEmitter {
|
|
|
676
696
|
content?: string | null;
|
|
677
697
|
embeds?: Array<Embed> | null;
|
|
678
698
|
allowedMentions?: AllowedMentions | null;
|
|
679
|
-
components?: Array<ActionRow |
|
|
699
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
|
|
680
700
|
files?: Array<FileData> | null;
|
|
681
701
|
attachments?: Array<Partial<Attachment>> | null;
|
|
682
702
|
poll?: PollCreateParams | null;
|
|
@@ -698,7 +718,7 @@ export declare class Client extends EventEmitter {
|
|
|
698
718
|
tts?: boolean;
|
|
699
719
|
embeds?: Array<Embed>;
|
|
700
720
|
allowedMentions?: AllowedMentions;
|
|
701
|
-
components?: Array<ActionRow |
|
|
721
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
702
722
|
files?: Array<FileData>;
|
|
703
723
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
704
724
|
flags?: MessageFlags;
|
|
@@ -934,6 +954,8 @@ export declare class Client extends EventEmitter {
|
|
|
934
954
|
members: Array<ThreadMember>;
|
|
935
955
|
hasMore: boolean;
|
|
936
956
|
}>;
|
|
957
|
+
/** https://discord.com/developers/docs/resources/lobby#get-lobby */
|
|
958
|
+
getLobby(lobbyID: snowflake): Promise<Lobby>;
|
|
937
959
|
/** https://discord.com/developers/docs/resources/message#get-channel-message */
|
|
938
960
|
getMessage(channelID: snowflake, messageID: snowflake): Promise<Message>;
|
|
939
961
|
/** https://discord.com/developers/docs/resources/message#get-reactions */
|
|
@@ -1023,10 +1045,16 @@ export declare class Client extends EventEmitter {
|
|
|
1023
1045
|
}): void;
|
|
1024
1046
|
/** https://discord.com/developers/docs/resources/user#leave-guild */
|
|
1025
1047
|
leaveGuild(guildID: snowflake): void;
|
|
1048
|
+
/** https://discord.com/developers/docs/resources/lobby#leave-lobby */
|
|
1049
|
+
leaveLobby(lobbyID: snowflake): void;
|
|
1026
1050
|
/** https://discord.com/developers/docs/resources/channel#leave-thread */
|
|
1027
1051
|
leaveThread(channelID: snowflake): void;
|
|
1028
1052
|
/** https://discord.com/developers/docs/topics/gateway-events#update-voice-state */
|
|
1029
1053
|
leaveVoiceChannel(guildID: snowflake): void;
|
|
1054
|
+
/** discord.com/developers/docs/resources/lobby#link-channel-to-lobby */
|
|
1055
|
+
linkChannel(lobbyID: snowflake, options: {
|
|
1056
|
+
channelID: snowflake;
|
|
1057
|
+
}): Promise<Lobby>;
|
|
1030
1058
|
/** https://discord.com/developers/docs/resources/channel#pin-message */
|
|
1031
1059
|
pinMessage(channelID: snowflake, messageID: snowflake, reason?: string): void;
|
|
1032
1060
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-ban */
|
|
@@ -1037,6 +1065,8 @@ export declare class Client extends EventEmitter {
|
|
|
1037
1065
|
removeGuildMember(guildID: snowflake, userID: snowflake, reason?: string): void;
|
|
1038
1066
|
/** https://discord.com/developers/docs/resources/guild#remove-guild-member-role */
|
|
1039
1067
|
removeGuildMemberRole(guildID: snowflake, userID: snowflake, roleID: snowflake, reason?: string): void;
|
|
1068
|
+
/** https://discord.com/developers/docs/resources/lobby#remove-a-member-from-a-lobby */
|
|
1069
|
+
removeLobbyMember(lobbyID: snowflake, userID: snowflake): void;
|
|
1040
1070
|
/** https://discord.com/developers/docs/resources/channel#remove-thread-member */
|
|
1041
1071
|
removeThreadMember(channelID: snowflake, userID: snowflake): void;
|
|
1042
1072
|
/** https://discord.com/developers/docs/resources/guild#search-guild-members */
|
|
@@ -1055,6 +1085,8 @@ export declare class Client extends EventEmitter {
|
|
|
1055
1085
|
syncGuildTemplate(guildID: snowflake, code: string): Promise<GuildTemplate>;
|
|
1056
1086
|
/** https://discord.com/developers/docs/resources/channel#trigger-typing-indicator */
|
|
1057
1087
|
triggerTypingIndicator(channelID: snowflake): void;
|
|
1088
|
+
/** https://discord.com/developers/docs/resources/lobby#unlink-channel-from-lobby */
|
|
1089
|
+
unlinkChannel(lobbyID: snowflake): Promise<Lobby>;
|
|
1058
1090
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
|
|
1059
1091
|
updateApplicationRoleConnectionMetadataRecords(applicationID: snowflake): Promise<Array<ApplicationRoleConnectionMetadata>>;
|
|
1060
1092
|
/** https://discord.com/developers/docs/resources/user#update-current-user-application-role-connection */
|
package/dist/lib/Client.js
CHANGED
|
@@ -76,6 +76,13 @@ class Client extends node_events_1.default {
|
|
|
76
76
|
reason,
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
+
/** https://discord.com/developers/docs/resources/lobby#add-a-member-to-a-lobby */
|
|
80
|
+
async addLobbyMember(lobbyID, userID, options) {
|
|
81
|
+
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.lobbyMember(lobbyID, userID), {
|
|
82
|
+
json: options,
|
|
83
|
+
});
|
|
84
|
+
return transformers_1.Lobbies.lobbyMemberFromRaw(response);
|
|
85
|
+
}
|
|
79
86
|
/** https://discord.com/developers/docs/resources/channel#add-thread-member */
|
|
80
87
|
addThreadMember(channelID, userID) {
|
|
81
88
|
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.threadMembers(channelID, userID));
|
|
@@ -469,24 +476,10 @@ class Client extends node_events_1.default {
|
|
|
469
476
|
switch (component.type) {
|
|
470
477
|
case constants_1.ComponentTypes.ActionRow:
|
|
471
478
|
return transformers_1.Components.actionRowToRaw(component);
|
|
472
|
-
case constants_1.ComponentTypes.Button:
|
|
473
|
-
return transformers_1.Components.buttonToRaw(component);
|
|
474
|
-
case constants_1.ComponentTypes.StringSelect:
|
|
475
|
-
return transformers_1.Components.stringSelectToRaw(component);
|
|
476
|
-
case constants_1.ComponentTypes.UserSelect:
|
|
477
|
-
return transformers_1.Components.userSelectToRaw(component);
|
|
478
|
-
case constants_1.ComponentTypes.RoleSelect:
|
|
479
|
-
return transformers_1.Components.roleSelectToRaw(component);
|
|
480
|
-
case constants_1.ComponentTypes.MentionableSelect:
|
|
481
|
-
return transformers_1.Components.mentionableSelectToRaw(component);
|
|
482
|
-
case constants_1.ComponentTypes.ChannelSelect:
|
|
483
|
-
return transformers_1.Components.channelSelectToRaw(component);
|
|
484
479
|
case constants_1.ComponentTypes.Section:
|
|
485
480
|
return transformers_1.Components.sectionToRaw(component);
|
|
486
481
|
case constants_1.ComponentTypes.TextDisplay:
|
|
487
482
|
return transformers_1.Components.textDisplayToRaw(component);
|
|
488
|
-
case constants_1.ComponentTypes.Thumbnail:
|
|
489
|
-
return transformers_1.Components.thumbnailToRaw(component);
|
|
490
483
|
case constants_1.ComponentTypes.MediaGallery:
|
|
491
484
|
return transformers_1.Components.mediaGalleryToRaw(component);
|
|
492
485
|
case constants_1.ComponentTypes.File:
|
|
@@ -550,10 +543,10 @@ class Client extends node_events_1.default {
|
|
|
550
543
|
components: options.data?.components !== undefined
|
|
551
544
|
? options.data?.components.map((component) => {
|
|
552
545
|
switch (component.type) {
|
|
553
|
-
case constants_1.ComponentTypes.
|
|
554
|
-
return transformers_1.Components.
|
|
555
|
-
case constants_1.ComponentTypes.
|
|
556
|
-
return transformers_1.Components.
|
|
546
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
547
|
+
return transformers_1.Components.actionRowToRaw(component);
|
|
548
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
549
|
+
return transformers_1.Components.textDisplayToRaw(component);
|
|
557
550
|
case constants_1.ComponentTypes.Label:
|
|
558
551
|
return transformers_1.Components.labelToRaw(component);
|
|
559
552
|
}
|
|
@@ -594,6 +587,17 @@ class Client extends node_events_1.default {
|
|
|
594
587
|
});
|
|
595
588
|
}
|
|
596
589
|
}
|
|
590
|
+
/** https://discord.com/developers/docs/resources/lobby#create-lobby */
|
|
591
|
+
async createLobby(options) {
|
|
592
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbies(), {
|
|
593
|
+
json: {
|
|
594
|
+
metadata: options.metadata,
|
|
595
|
+
members: options.members,
|
|
596
|
+
idle_timeout_seconds: options.idleTimeoutSeconds,
|
|
597
|
+
},
|
|
598
|
+
});
|
|
599
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
600
|
+
}
|
|
597
601
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
|
598
602
|
async createMessage(channelID, options) {
|
|
599
603
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(channelID), {
|
|
@@ -820,6 +824,10 @@ class Client extends node_events_1.default {
|
|
|
820
824
|
deleteInteractionResponse(applicationID, interactionToken) {
|
|
821
825
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(applicationID, interactionToken));
|
|
822
826
|
}
|
|
827
|
+
/** https://discord.com/developers/docs/resources/lobby#delete-lobby */
|
|
828
|
+
deleteLobby(lobbyID) {
|
|
829
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobby(lobbyID));
|
|
830
|
+
}
|
|
823
831
|
/** https://discord.com/developers/docs/resources/message#delete-message */
|
|
824
832
|
deleteMessage(channelID, messageID, reason) {
|
|
825
833
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessage(channelID, messageID), {
|
|
@@ -1274,6 +1282,17 @@ class Client extends node_events_1.default {
|
|
|
1274
1282
|
channelID: response.channel_id,
|
|
1275
1283
|
};
|
|
1276
1284
|
}
|
|
1285
|
+
/** https://discord.com/developers/docs/resources/lobby#modify-lobby */
|
|
1286
|
+
async editLobby(lobbyID, options) {
|
|
1287
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobby(lobbyID), {
|
|
1288
|
+
json: {
|
|
1289
|
+
metadata: options.metadata,
|
|
1290
|
+
members: options.members,
|
|
1291
|
+
idle_timeout_seconds: options.idleTimeoutSeconds,
|
|
1292
|
+
},
|
|
1293
|
+
});
|
|
1294
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
1295
|
+
}
|
|
1277
1296
|
/** https://discord.com/developers/docs/resources/message#edit-message */
|
|
1278
1297
|
async editMessage(channelID, messageID, options) {
|
|
1279
1298
|
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channelMessage(channelID, messageID), {
|
|
@@ -2142,6 +2161,11 @@ class Client extends node_events_1.default {
|
|
|
2142
2161
|
hasMore: response.has_more,
|
|
2143
2162
|
};
|
|
2144
2163
|
}
|
|
2164
|
+
/** https://discord.com/developers/docs/resources/lobby#get-lobby */
|
|
2165
|
+
async getLobby(lobbyID) {
|
|
2166
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobby(lobbyID));
|
|
2167
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2168
|
+
}
|
|
2145
2169
|
/** https://discord.com/developers/docs/resources/message#get-channel-message */
|
|
2146
2170
|
async getMessage(channelID, messageID) {
|
|
2147
2171
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(channelID, messageID));
|
|
@@ -2339,6 +2363,10 @@ class Client extends node_events_1.default {
|
|
|
2339
2363
|
leaveGuild(guildID) {
|
|
2340
2364
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userGuild(guildID));
|
|
2341
2365
|
}
|
|
2366
|
+
/** https://discord.com/developers/docs/resources/lobby#leave-lobby */
|
|
2367
|
+
leaveLobby(lobbyID) {
|
|
2368
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(lobbyID));
|
|
2369
|
+
}
|
|
2342
2370
|
/** https://discord.com/developers/docs/resources/channel#leave-thread */
|
|
2343
2371
|
leaveThread(channelID) {
|
|
2344
2372
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelID, "@me"));
|
|
@@ -2352,6 +2380,15 @@ class Client extends node_events_1.default {
|
|
|
2352
2380
|
selfDeaf: false,
|
|
2353
2381
|
});
|
|
2354
2382
|
}
|
|
2383
|
+
/** discord.com/developers/docs/resources/lobby#link-channel-to-lobby */
|
|
2384
|
+
async linkChannel(lobbyID, options) {
|
|
2385
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(lobbyID), {
|
|
2386
|
+
json: {
|
|
2387
|
+
channel_id: options.channelID,
|
|
2388
|
+
},
|
|
2389
|
+
});
|
|
2390
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2391
|
+
}
|
|
2355
2392
|
/** https://discord.com/developers/docs/resources/channel#pin-message */
|
|
2356
2393
|
pinMessage(channelID, messageID, reason) {
|
|
2357
2394
|
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPin(channelID, messageID), {
|
|
@@ -2380,6 +2417,10 @@ class Client extends node_events_1.default {
|
|
|
2380
2417
|
reason,
|
|
2381
2418
|
});
|
|
2382
2419
|
}
|
|
2420
|
+
/** https://discord.com/developers/docs/resources/lobby#remove-a-member-from-a-lobby */
|
|
2421
|
+
removeLobbyMember(lobbyID, userID) {
|
|
2422
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(lobbyID, userID));
|
|
2423
|
+
}
|
|
2383
2424
|
/** https://discord.com/developers/docs/resources/channel#remove-thread-member */
|
|
2384
2425
|
removeThreadMember(channelID, userID) {
|
|
2385
2426
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelID, userID));
|
|
@@ -2416,6 +2457,11 @@ class Client extends node_events_1.default {
|
|
|
2416
2457
|
triggerTypingIndicator(channelID) {
|
|
2417
2458
|
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelTyping(channelID));
|
|
2418
2459
|
}
|
|
2460
|
+
/** https://discord.com/developers/docs/resources/lobby#unlink-channel-from-lobby */
|
|
2461
|
+
async unlinkChannel(lobbyID) {
|
|
2462
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(lobbyID));
|
|
2463
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2464
|
+
}
|
|
2419
2465
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
|
|
2420
2466
|
async updateApplicationRoleConnectionMetadataRecords(applicationID) {
|
|
2421
2467
|
const response = await this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.applicationRoleConnectionMetadata(applicationID));
|
package/dist/lib/constants.d.ts
CHANGED
|
@@ -519,6 +519,10 @@ export declare enum InviteTargetTypes {
|
|
|
519
519
|
export declare enum GuildInviteFlags {
|
|
520
520
|
IsGuestInvite = 1
|
|
521
521
|
}
|
|
522
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-flags */
|
|
523
|
+
export declare enum LobbyMemberFlags {
|
|
524
|
+
CanLinkLobby = 1
|
|
525
|
+
}
|
|
522
526
|
/** https://discord.com/developers/docs/resources/message#message-object-message-types */
|
|
523
527
|
export declare enum MessageTypes {
|
|
524
528
|
Default = 0,
|
package/dist/lib/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GuildScheduledEventRecurrenceRuleMonth = exports.GuildScheduledEventRecurrenceRuleWeekday = exports.GuildScheduledEventRecurrenceRuleFrequency = exports.GuildScheduledEventStatus = exports.GuildScheduledEventEntityTypes = exports.GuildScheduledEventPrivacyLevel = exports.ImageWidgetStyleOptions = exports.PromptTypes = exports.OnboardingMode = exports.IntegrationExpireBehaviors = exports.GuildMemberFlags = exports.MutableGuildFeatures = exports.GuildFeatures = exports.SystemChannelFlags = exports.PremiumTier = exports.GuildNSFWLevel = exports.VerificationLevel = exports.MFALevel = exports.ExplicitContentFilterLevel = exports.DefaultMessageNotificationLevel = exports.ForumLayoutTypes = exports.SortOrderTypes = exports.ChannelFlags = exports.VideoQualityModes = exports.ChannelTypes = exports.ActionTypes = exports.EventTypes = exports.KeywordPresetTypes = exports.TriggerTypes = exports.AuditLogEvents = exports.ApplicationRoleConnectionMetadataType = exports.ActivityLocationKind = exports.ApplicationFlags = exports.ApplicationEventWebhookStatus = exports.ApplicationIntegrationTypes = exports.SeparatorSpacing = exports.TextInputStyles = exports.ButtonStyles = exports.ComponentTypes = exports.InteractionCallbackType = exports.InteractionContextTypes = exports.InteractionType = exports.ApplicationCommandPermissionType = exports.EntryPointCommandHandlerTypes = exports.ApplicationCommandOptionType = exports.ApplicationCommandTypes = exports.Locales = exports.ImageFormats = exports.GuildNavigationTypes = exports.TimestampStyles = void 0;
|
|
4
|
-
exports.EntitlementTypes = exports.SKUFlags = exports.SKUTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.AnimationTypes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.SubscriptionStatuses = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.EmbedTypes = exports.MessageReferenceTypes = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.GuildInviteFlags = exports.InviteTargetTypes = exports.InviteTypes = void 0;
|
|
4
|
+
exports.EntitlementTypes = exports.SKUFlags = exports.SKUTypes = exports.MembershipState = exports.TeamMemberRoleTypes = exports.RoleFlags = exports.BitwisePermissionFlags = exports.RPCCloseEventCodes = exports.RPCErrorCodes = exports.JSONErrorCodes = exports.HTTPResponseCodes = exports.VoiceCloseEventCodes = exports.VoiceOPCodes = exports.GatewayCloseEventCodes = exports.GatewayOPCodes = exports.OAuth2Scopes = exports.AnimationTypes = exports.ActivityFlags = exports.ActivityType = exports.GatewayEvents = exports.StatusTypes = exports.GatewayIntents = exports.DeviceType = exports.WebhookTypes = exports.SubscriptionStatuses = exports.VisibilityTypes = exports.Services = exports.PremiumTypes = exports.UserFlags = exports.StickerFormatTypes = exports.StickerTypes = exports.PrivacyLevel = exports.LayoutType = exports.ReactionTypes = exports.AllowedMentionTypes = exports.AttachmentFlags = exports.EmbedTypes = exports.MessageReferenceTypes = exports.MessageFlags = exports.MessageActivityTypes = exports.MessageTypes = exports.LobbyMemberFlags = exports.GuildInviteFlags = exports.InviteTargetTypes = exports.InviteTypes = void 0;
|
|
5
5
|
/** https://discord.com/developers/docs/reference#message-formatting-timestamp-styles */
|
|
6
6
|
var TimestampStyles;
|
|
7
7
|
(function (TimestampStyles) {
|
|
@@ -576,6 +576,11 @@ var GuildInviteFlags;
|
|
|
576
576
|
(function (GuildInviteFlags) {
|
|
577
577
|
GuildInviteFlags[GuildInviteFlags["IsGuestInvite"] = 1] = "IsGuestInvite";
|
|
578
578
|
})(GuildInviteFlags || (exports.GuildInviteFlags = GuildInviteFlags = {}));
|
|
579
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-flags */
|
|
580
|
+
var LobbyMemberFlags;
|
|
581
|
+
(function (LobbyMemberFlags) {
|
|
582
|
+
LobbyMemberFlags[LobbyMemberFlags["CanLinkLobby"] = 1] = "CanLinkLobby";
|
|
583
|
+
})(LobbyMemberFlags || (exports.LobbyMemberFlags = LobbyMemberFlags = {}));
|
|
579
584
|
/** https://discord.com/developers/docs/resources/message#message-object-message-types */
|
|
580
585
|
var MessageTypes;
|
|
581
586
|
(function (MessageTypes) {
|
|
@@ -108,3 +108,7 @@ export declare const stageInstance: (channelID: snowflake) => `stage-instances/$
|
|
|
108
108
|
export declare const stageInstances: () => "stage-instances";
|
|
109
109
|
export declare const sticker: (stickerID: snowflake) => `stickers/${string}`;
|
|
110
110
|
export declare const voiceRegions: () => "voice/regions";
|
|
111
|
+
export declare const lobbies: () => "lobbies";
|
|
112
|
+
export declare const lobby: (lobbyID: snowflake) => `lobbies/${string}`;
|
|
113
|
+
export declare const lobbyMember: (lobbyID: snowflake, userID?: snowflake | "@me") => `lobbies/${string}/members/${string}`;
|
|
114
|
+
export declare const lobbyChannelLinking: (lobbyID: snowflake) => `lobbies/${string}/channel-linking`;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.channelInvites = exports.channelFollowers = exports.channelBulkDelete = exports.channel = exports.template = exports.guildWidgetSettings = exports.guildWidgetJSON = exports.guildWidgetImage = exports.guildWelcomeScreen = exports.guildWebhooks = exports.guildVoiceState = exports.guildVoiceRegions = exports.guildVanityURL = exports.guildTemplates = exports.guildTemplate = exports.guildStickers = exports.guildSticker = exports.guildSoundboardSounds = exports.guildSoundboardSound = exports.guildScheduledEventUsers = exports.guildScheduledEvents = exports.guildScheduledEvent = exports.guildRoles = exports.guildRole = exports.guildPrune = exports.guildPreview = exports.guildOnboarding = exports.guildMemberVerification = exports.guildMembersSearch = exports.guildMembers = exports.guildMemberRole = exports.guildMember = exports.guildMFA = exports.guildInvites = exports.guildIntegrations = exports.guildIntegration = exports.guildIncidentsActions = exports.guildEmojis = exports.guildEmoji = exports.guildMemberNickname = exports.guildChannels = exports.guildBulkBan = exports.guildBans = exports.guildBan = exports.guildAutoModerationRules = exports.guildAutoModerationRule = exports.guildAuditLog = exports.guildActiveThreads = exports.guilds = exports.guild = void 0;
|
|
4
4
|
exports.oauth2Application = exports.oauth2Authorize = exports.gatewayBot = exports.gateway = exports.soundboardDefaultSounds = exports.sendSoundboardSound = exports.skuSubscriptions = exports.skuSubscription = exports.stickerPacks = exports.stickerPack = exports.webhookPlatform = exports.webhookMessage = exports.webhook = exports.guildApplicationCommandsPermissions = exports.applicationSKUs = exports.applicationRoleConnectionMetadata = exports.applicationGuildCommands = exports.applicationGuildCommand = exports.applicationEntitlements = exports.applicationEntitlementConsume = exports.applicationEntitlement = exports.applicationEmojis = exports.applicationEmoji = exports.applicationUser = exports.applicationCommandPermissions = exports.applicationCommands = exports.applicationCommand = exports.applicationActivityInstance = exports.userGuilds = exports.userGuild = exports.userConnections = exports.userChannels = exports.userApplicationRoleConnection = exports.user = exports.pollExpire = exports.pollAnswerVoters = exports.threadMembers = exports.threads = exports.channelWebhooks = exports.channelTyping = exports.channelThreads = exports.channelRecipient = exports.channelPins = exports.channelPin = exports.channelPermission = exports.channelMessages = exports.channelMessageReaction = exports.channelMessageCrosspost = exports.channelMessageAllReactions = exports.channelMessage = void 0;
|
|
5
|
-
exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = void 0;
|
|
5
|
+
exports.lobbyChannelLinking = exports.lobbyMember = exports.lobby = exports.lobbies = exports.voiceRegions = exports.sticker = exports.stageInstances = exports.stageInstance = exports.invite = exports.interactionCallback = exports.oauth2TokenRevocation = exports.oauth2TokenExchange = exports.oauth2Authorization = void 0;
|
|
6
6
|
// Guilds
|
|
7
7
|
const guild = (guildID) => `guilds/${guildID}`;
|
|
8
8
|
exports.guild = guild;
|
|
@@ -242,3 +242,12 @@ const sticker = (stickerID) => `stickers/${stickerID}`;
|
|
|
242
242
|
exports.sticker = sticker;
|
|
243
243
|
const voiceRegions = () => "voice/regions";
|
|
244
244
|
exports.voiceRegions = voiceRegions;
|
|
245
|
+
// Lobbies
|
|
246
|
+
const lobbies = () => "lobbies";
|
|
247
|
+
exports.lobbies = lobbies;
|
|
248
|
+
const lobby = (lobbyID) => `lobbies/${lobbyID}`;
|
|
249
|
+
exports.lobby = lobby;
|
|
250
|
+
const lobbyMember = (lobbyID, userID = "@me") => `lobbies/${lobbyID}/members/${userID}`;
|
|
251
|
+
exports.lobbyMember = lobbyMember;
|
|
252
|
+
const lobbyChannelLinking = (lobbyID) => `lobbies/${lobbyID}/channel-linking`;
|
|
253
|
+
exports.lobbyChannelLinking = lobbyChannelLinking;
|
|
@@ -20,10 +20,10 @@ export declare class Components {
|
|
|
20
20
|
static roleSelectToRaw(roleSelect: RoleSelect): RawRoleSelect;
|
|
21
21
|
static sectionFromRaw(section: RawSection): Section;
|
|
22
22
|
static sectionToRaw(section: Section): RawSection;
|
|
23
|
-
static stringSelectFromRaw(stringSelect: RawStringSelect): StringSelect;
|
|
24
|
-
static stringSelectToRaw(stringSelect: StringSelect): RawStringSelect;
|
|
25
23
|
static separatorFromRaw(separator: RawSeparator): Separator;
|
|
26
24
|
static separatorToRaw(separator: Separator): RawSeparator;
|
|
25
|
+
static stringSelectFromRaw(stringSelect: RawStringSelect): StringSelect;
|
|
26
|
+
static stringSelectToRaw(stringSelect: StringSelect): RawStringSelect;
|
|
27
27
|
static textDisplayFromRaw(textDisplay: RawTextDisplay): TextDisplay;
|
|
28
28
|
static textDisplayToRaw(textDisplay: TextDisplay): RawTextDisplay;
|
|
29
29
|
static textInputFromRaw(textInput: RawTextInput): TextInput;
|
|
@@ -12,6 +12,8 @@ class Components {
|
|
|
12
12
|
return Components.buttonFromRaw(c);
|
|
13
13
|
case constants_js_1.ComponentTypes.StringSelect:
|
|
14
14
|
return Components.stringSelectFromRaw(c);
|
|
15
|
+
case constants_js_1.ComponentTypes.TextInput:
|
|
16
|
+
return Components.textInputFromRaw(c);
|
|
15
17
|
case constants_js_1.ComponentTypes.UserSelect:
|
|
16
18
|
return Components.userSelectFromRaw(c);
|
|
17
19
|
case constants_js_1.ComponentTypes.RoleSelect:
|
|
@@ -34,6 +36,8 @@ class Components {
|
|
|
34
36
|
return Components.buttonToRaw(c);
|
|
35
37
|
case constants_js_1.ComponentTypes.StringSelect:
|
|
36
38
|
return Components.stringSelectToRaw(c);
|
|
39
|
+
case constants_js_1.ComponentTypes.TextInput:
|
|
40
|
+
return Components.textInputToRaw(c);
|
|
37
41
|
case constants_js_1.ComponentTypes.UserSelect:
|
|
38
42
|
return Components.userSelectToRaw(c);
|
|
39
43
|
case constants_js_1.ComponentTypes.RoleSelect:
|
|
@@ -286,23 +290,63 @@ class Components {
|
|
|
286
290
|
};
|
|
287
291
|
}
|
|
288
292
|
static sectionFromRaw(section) {
|
|
293
|
+
let accessory;
|
|
294
|
+
switch (section.accessory.type) {
|
|
295
|
+
case constants_js_1.ComponentTypes.Button:
|
|
296
|
+
accessory = Components.buttonFromRaw(section.accessory);
|
|
297
|
+
break;
|
|
298
|
+
case constants_js_1.ComponentTypes.Thumbnail:
|
|
299
|
+
accessory = Components.thumbnailFromRaw(section.accessory);
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
289
302
|
return {
|
|
290
303
|
type: section.type,
|
|
291
304
|
id: section.id,
|
|
292
|
-
components:
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
305
|
+
components: section.components.map((component) => {
|
|
306
|
+
switch (component.type) {
|
|
307
|
+
case constants_js_1.ComponentTypes.TextDisplay:
|
|
308
|
+
return Components.textDisplayFromRaw(component);
|
|
309
|
+
}
|
|
310
|
+
}),
|
|
311
|
+
accessory,
|
|
296
312
|
};
|
|
297
313
|
}
|
|
298
314
|
static sectionToRaw(section) {
|
|
315
|
+
let accessory;
|
|
316
|
+
switch (section.accessory.type) {
|
|
317
|
+
case constants_js_1.ComponentTypes.Button:
|
|
318
|
+
accessory = Components.buttonToRaw(section.accessory);
|
|
319
|
+
break;
|
|
320
|
+
case constants_js_1.ComponentTypes.Thumbnail:
|
|
321
|
+
accessory = Components.thumbnailToRaw(section.accessory);
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
299
324
|
return {
|
|
300
325
|
type: section.type,
|
|
301
326
|
id: section.id,
|
|
302
|
-
components:
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
327
|
+
components: section.components.map((component) => {
|
|
328
|
+
switch (component.type) {
|
|
329
|
+
case constants_js_1.ComponentTypes.TextDisplay:
|
|
330
|
+
return Components.textDisplayToRaw(component);
|
|
331
|
+
}
|
|
332
|
+
}),
|
|
333
|
+
accessory,
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
static separatorFromRaw(separator) {
|
|
337
|
+
return {
|
|
338
|
+
type: separator.type,
|
|
339
|
+
id: separator.id,
|
|
340
|
+
divider: separator.divider,
|
|
341
|
+
spacing: separator.spacing,
|
|
342
|
+
};
|
|
343
|
+
}
|
|
344
|
+
static separatorToRaw(separator) {
|
|
345
|
+
return {
|
|
346
|
+
type: separator.type,
|
|
347
|
+
id: separator.id,
|
|
348
|
+
divider: separator.divider,
|
|
349
|
+
spacing: separator.spacing,
|
|
306
350
|
};
|
|
307
351
|
}
|
|
308
352
|
static stringSelectFromRaw(stringSelect) {
|
|
@@ -352,22 +396,6 @@ class Components {
|
|
|
352
396
|
disabled: stringSelect.disabled,
|
|
353
397
|
};
|
|
354
398
|
}
|
|
355
|
-
static separatorFromRaw(separator) {
|
|
356
|
-
return {
|
|
357
|
-
type: separator.type,
|
|
358
|
-
id: separator.id,
|
|
359
|
-
divider: separator.divider,
|
|
360
|
-
spacing: separator.spacing,
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
static separatorToRaw(separator) {
|
|
364
|
-
return {
|
|
365
|
-
type: separator.type,
|
|
366
|
-
id: separator.id,
|
|
367
|
-
divider: separator.divider,
|
|
368
|
-
spacing: separator.spacing,
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
399
|
static textDisplayFromRaw(textDisplay) {
|
|
372
400
|
return {
|
|
373
401
|
type: textDisplay.type,
|
|
@@ -393,6 +421,7 @@ class Components {
|
|
|
393
421
|
value: textInput.value,
|
|
394
422
|
placeholder: textInput.placeholder,
|
|
395
423
|
id: textInput.id,
|
|
424
|
+
label: textInput.label,
|
|
396
425
|
};
|
|
397
426
|
}
|
|
398
427
|
static textInputToRaw(textInput) {
|
|
@@ -406,6 +435,7 @@ class Components {
|
|
|
406
435
|
value: textInput.value,
|
|
407
436
|
placeholder: textInput.placeholder,
|
|
408
437
|
id: textInput.id,
|
|
438
|
+
label: textInput.label,
|
|
409
439
|
};
|
|
410
440
|
}
|
|
411
441
|
static thumbnailFromRaw(thumbnail) {
|
|
@@ -73,10 +73,31 @@ class Interactions {
|
|
|
73
73
|
values: interaction.data?.values,
|
|
74
74
|
components: interaction.data?.components?.map((component) => {
|
|
75
75
|
switch (component.type) {
|
|
76
|
-
case constants_1.ComponentTypes.
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
77
|
+
return {
|
|
78
|
+
type: constants_1.ComponentTypes.ActionRow,
|
|
79
|
+
components: component.components.map((c) => {
|
|
80
|
+
switch (c.type) {
|
|
81
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
82
|
+
return {
|
|
83
|
+
type: c.type,
|
|
84
|
+
componentType: c.component_type,
|
|
85
|
+
id: c.id,
|
|
86
|
+
customID: c.custom_id,
|
|
87
|
+
values: c.values,
|
|
88
|
+
};
|
|
89
|
+
case constants_1.ComponentTypes.TextInput:
|
|
90
|
+
return {
|
|
91
|
+
type: c.type,
|
|
92
|
+
id: c.id,
|
|
93
|
+
customID: c.custom_id,
|
|
94
|
+
value: c.value,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}),
|
|
98
|
+
};
|
|
99
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
100
|
+
return Components_1.Components.textDisplayFromRaw(component);
|
|
80
101
|
case constants_1.ComponentTypes.Label:
|
|
81
102
|
return Components_1.Components.labelFromRaw(component);
|
|
82
103
|
}
|
|
@@ -170,10 +191,31 @@ class Interactions {
|
|
|
170
191
|
values: interaction.data.values,
|
|
171
192
|
components: interaction.data?.components?.map((component) => {
|
|
172
193
|
switch (component.type) {
|
|
173
|
-
case constants_1.ComponentTypes.
|
|
174
|
-
return
|
|
175
|
-
|
|
176
|
-
|
|
194
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
195
|
+
return {
|
|
196
|
+
type: constants_1.ComponentTypes.ActionRow,
|
|
197
|
+
components: component.components.map((c) => {
|
|
198
|
+
switch (c.type) {
|
|
199
|
+
case constants_1.ComponentTypes.StringSelect:
|
|
200
|
+
return {
|
|
201
|
+
type: c.type,
|
|
202
|
+
component_type: c.componentType,
|
|
203
|
+
id: c.id,
|
|
204
|
+
custom_id: c.customID,
|
|
205
|
+
values: c.values,
|
|
206
|
+
};
|
|
207
|
+
case constants_1.ComponentTypes.TextInput:
|
|
208
|
+
return {
|
|
209
|
+
type: c.type,
|
|
210
|
+
id: c.id,
|
|
211
|
+
custom_id: c.customID,
|
|
212
|
+
value: c.value,
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
}),
|
|
216
|
+
};
|
|
217
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
218
|
+
return Components_1.Components.textDisplayToRaw(component);
|
|
177
219
|
case constants_1.ComponentTypes.Label:
|
|
178
220
|
return Components_1.Components.labelToRaw(component);
|
|
179
221
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Lobby, LobbyMember, RawLobby, RawLobbyMember } from "../types/lobby";
|
|
2
|
+
export declare class Lobbies {
|
|
3
|
+
static lobbyFromRaw(lobby: RawLobby): Lobby;
|
|
4
|
+
static lobbyMemberFromRaw(lobbyMember: RawLobbyMember): LobbyMember;
|
|
5
|
+
static lobbyMemberToRaw(lobbyMember: LobbyMember): RawLobbyMember;
|
|
6
|
+
static lobbyToRaw(lobby: Lobby): RawLobby;
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Lobbies = void 0;
|
|
4
|
+
class Lobbies {
|
|
5
|
+
static lobbyFromRaw(lobby) {
|
|
6
|
+
return {
|
|
7
|
+
id: lobby.id,
|
|
8
|
+
applicationID: lobby.application_id,
|
|
9
|
+
metadata: lobby.metadata,
|
|
10
|
+
members: lobby.members,
|
|
11
|
+
linkedChannel: lobby.linked_channel,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
static lobbyMemberFromRaw(lobbyMember) {
|
|
15
|
+
return {
|
|
16
|
+
id: lobbyMember.id,
|
|
17
|
+
metadata: lobbyMember.metadata,
|
|
18
|
+
flags: lobbyMember.flags,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
static lobbyMemberToRaw(lobbyMember) {
|
|
22
|
+
return {
|
|
23
|
+
id: lobbyMember.id,
|
|
24
|
+
metadata: lobbyMember.metadata,
|
|
25
|
+
flags: lobbyMember.flags,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static lobbyToRaw(lobby) {
|
|
29
|
+
return {
|
|
30
|
+
id: lobby.id,
|
|
31
|
+
application_id: lobby.applicationID,
|
|
32
|
+
metadata: lobby.metadata,
|
|
33
|
+
members: lobby.members,
|
|
34
|
+
linked_channel: lobby.linkedChannel,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.Lobbies = Lobbies;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { RawAttachment, Attachment, RawEmbed, Embed, RawMessage, Message } from "../types/message";
|
|
2
|
-
import type { ActionRow,
|
|
2
|
+
import type { ActionRow, Container, File, MediaGallery, RawActionRow, RawContainer, RawFile, RawMediaGallery, RawSection, RawSeparator, RawTextDisplay, Section, Separator, TextDisplay } from "../types/message-components";
|
|
3
3
|
export declare class Messages {
|
|
4
4
|
static attachmentFromRaw(attachment: RawAttachment): Attachment;
|
|
5
5
|
static attachmentToRaw(attachment: Attachment): RawAttachment;
|
|
6
|
-
static componentsFromRaw(components: Array<RawActionRow |
|
|
7
|
-
static componentsToRaw(components: Array<ActionRow |
|
|
6
|
+
static componentsFromRaw(components: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer>): Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
7
|
+
static componentsToRaw(components: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>): Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer>;
|
|
8
8
|
static embedFromRaw(embed: RawEmbed): Embed;
|
|
9
9
|
static embedToRaw(embed: Embed): RawEmbed;
|
|
10
10
|
static messageFromRaw(message: RawMessage): Message;
|
|
@@ -53,24 +53,10 @@ class Messages {
|
|
|
53
53
|
switch (component.type) {
|
|
54
54
|
case constants_1.ComponentTypes.ActionRow:
|
|
55
55
|
return Components_js_1.Components.actionRowFromRaw(component);
|
|
56
|
-
case constants_1.ComponentTypes.Button:
|
|
57
|
-
return Components_js_1.Components.buttonFromRaw(component);
|
|
58
|
-
case constants_1.ComponentTypes.StringSelect:
|
|
59
|
-
return Components_js_1.Components.stringSelectFromRaw(component);
|
|
60
|
-
case constants_1.ComponentTypes.UserSelect:
|
|
61
|
-
return Components_js_1.Components.userSelectFromRaw(component);
|
|
62
|
-
case constants_1.ComponentTypes.RoleSelect:
|
|
63
|
-
return Components_js_1.Components.roleSelectFromRaw(component);
|
|
64
|
-
case constants_1.ComponentTypes.MentionableSelect:
|
|
65
|
-
return Components_js_1.Components.mentionableSelectFromRaw(component);
|
|
66
|
-
case constants_1.ComponentTypes.ChannelSelect:
|
|
67
|
-
return Components_js_1.Components.channelSelectFromRaw(component);
|
|
68
56
|
case constants_1.ComponentTypes.Section:
|
|
69
57
|
return Components_js_1.Components.sectionFromRaw(component);
|
|
70
58
|
case constants_1.ComponentTypes.TextDisplay:
|
|
71
59
|
return Components_js_1.Components.textDisplayFromRaw(component);
|
|
72
|
-
case constants_1.ComponentTypes.Thumbnail:
|
|
73
|
-
return Components_js_1.Components.thumbnailFromRaw(component);
|
|
74
60
|
case constants_1.ComponentTypes.MediaGallery:
|
|
75
61
|
return Components_js_1.Components.mediaGalleryFromRaw(component);
|
|
76
62
|
case constants_1.ComponentTypes.File:
|
|
@@ -87,24 +73,10 @@ class Messages {
|
|
|
87
73
|
switch (component.type) {
|
|
88
74
|
case constants_1.ComponentTypes.ActionRow:
|
|
89
75
|
return Components_js_1.Components.actionRowToRaw(component);
|
|
90
|
-
case constants_1.ComponentTypes.Button:
|
|
91
|
-
return Components_js_1.Components.buttonToRaw(component);
|
|
92
|
-
case constants_1.ComponentTypes.StringSelect:
|
|
93
|
-
return Components_js_1.Components.stringSelectToRaw(component);
|
|
94
|
-
case constants_1.ComponentTypes.UserSelect:
|
|
95
|
-
return Components_js_1.Components.userSelectToRaw(component);
|
|
96
|
-
case constants_1.ComponentTypes.RoleSelect:
|
|
97
|
-
return Components_js_1.Components.roleSelectToRaw(component);
|
|
98
|
-
case constants_1.ComponentTypes.MentionableSelect:
|
|
99
|
-
return Components_js_1.Components.mentionableSelectToRaw(component);
|
|
100
|
-
case constants_1.ComponentTypes.ChannelSelect:
|
|
101
|
-
return Components_js_1.Components.channelSelectToRaw(component);
|
|
102
76
|
case constants_1.ComponentTypes.Section:
|
|
103
77
|
return Components_js_1.Components.sectionToRaw(component);
|
|
104
78
|
case constants_1.ComponentTypes.TextDisplay:
|
|
105
79
|
return Components_js_1.Components.textDisplayToRaw(component);
|
|
106
|
-
case constants_1.ComponentTypes.Thumbnail:
|
|
107
|
-
return Components_js_1.Components.thumbnailToRaw(component);
|
|
108
80
|
case constants_1.ComponentTypes.MediaGallery:
|
|
109
81
|
return Components_js_1.Components.mediaGalleryToRaw(component);
|
|
110
82
|
case constants_1.ComponentTypes.File:
|
|
@@ -4,7 +4,7 @@ export * from "./Applications";
|
|
|
4
4
|
export * from "./AuditLogs";
|
|
5
5
|
export * from "./AutoModeration";
|
|
6
6
|
export * from "./Channels";
|
|
7
|
-
export * from "./Components
|
|
7
|
+
export * from "./Components";
|
|
8
8
|
export * from "./Emojis";
|
|
9
9
|
export * from "./Entitlements";
|
|
10
10
|
export * from "./Guilds";
|
|
@@ -12,6 +12,7 @@ export * from "./GuildScheduledEvents";
|
|
|
12
12
|
export * from "./GuildTemplates";
|
|
13
13
|
export * from "./Interactions";
|
|
14
14
|
export * from "./Invites";
|
|
15
|
+
export * from "./Lobbies";
|
|
15
16
|
export * from "./Messages";
|
|
16
17
|
export * from "./Polls";
|
|
17
18
|
export * from "./Presences";
|
|
@@ -20,7 +20,7 @@ __exportStar(require("./Applications"), exports);
|
|
|
20
20
|
__exportStar(require("./AuditLogs"), exports);
|
|
21
21
|
__exportStar(require("./AutoModeration"), exports);
|
|
22
22
|
__exportStar(require("./Channels"), exports);
|
|
23
|
-
__exportStar(require("./Components
|
|
23
|
+
__exportStar(require("./Components"), exports);
|
|
24
24
|
__exportStar(require("./Emojis"), exports);
|
|
25
25
|
__exportStar(require("./Entitlements"), exports);
|
|
26
26
|
__exportStar(require("./Guilds"), exports);
|
|
@@ -28,6 +28,7 @@ __exportStar(require("./GuildScheduledEvents"), exports);
|
|
|
28
28
|
__exportStar(require("./GuildTemplates"), exports);
|
|
29
29
|
__exportStar(require("./Interactions"), exports);
|
|
30
30
|
__exportStar(require("./Invites"), exports);
|
|
31
|
+
__exportStar(require("./Lobbies"), exports);
|
|
31
32
|
__exportStar(require("./Messages"), exports);
|
|
32
33
|
__exportStar(require("./Polls"), exports);
|
|
33
34
|
__exportStar(require("./Presences"), exports);
|
|
@@ -6,7 +6,7 @@ import type { snowflake } from "./common";
|
|
|
6
6
|
import type { RawEntitlement, Entitlement } from "./entitlements";
|
|
7
7
|
import type { RawGuildMember, GuildMember, Guild, RawGuild } from "./guild";
|
|
8
8
|
import type { RawMessage, RawAttachment, RawEmbed, RawAllowedMentions, Message, Attachment, Embed, AllowedMentions } from "./message";
|
|
9
|
-
import type { ActionRow,
|
|
9
|
+
import type { ActionRow, Container, File, Label, MediaGallery, RawActionRow, RawContainer, RawFile, RawLabel, RawMediaGallery, RawSection, RawSeparator, RawStringSelectInteractionResponse, RawTextDisplay, RawTextInputInteractionResponse, Section, Separator, StringSelectInteractionResponse, TextDisplay, TextInputInteractionResponse } from "./message-components";
|
|
10
10
|
import type { RawPollCreateParams, PollCreateParams } from "./poll";
|
|
11
11
|
import type { RawRole, Role } from "./role";
|
|
12
12
|
import type { RawUser, User } from "./user";
|
|
@@ -54,7 +54,10 @@ export interface RawMessageComponentData {
|
|
|
54
54
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure */
|
|
55
55
|
export interface RawModalSubmitData {
|
|
56
56
|
custom_id: string;
|
|
57
|
-
components: Array<
|
|
57
|
+
components: Array<{
|
|
58
|
+
type: ComponentTypes.ActionRow;
|
|
59
|
+
components: Array<RawStringSelectInteractionResponse | RawTextInputInteractionResponse>;
|
|
60
|
+
} | RawTextDisplay | RawLabel>;
|
|
58
61
|
}
|
|
59
62
|
/** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
|
|
60
63
|
export interface RawResolvedData {
|
|
@@ -93,7 +96,7 @@ export interface RawInteractionCallbackData {
|
|
|
93
96
|
embeds?: Array<RawEmbed>;
|
|
94
97
|
allowed_mentions?: RawAllowedMentions;
|
|
95
98
|
flags?: MessageFlags;
|
|
96
|
-
components?: Array<RawActionRow |
|
|
99
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer | RawLabel>;
|
|
97
100
|
attachments?: Array<Pick<RawAttachment, "filename" | "description">>;
|
|
98
101
|
poll?: RawPollCreateParams;
|
|
99
102
|
files?: Array<FileData>;
|
|
@@ -165,7 +168,10 @@ export interface MessageComponentData {
|
|
|
165
168
|
}
|
|
166
169
|
export interface ModalSubmitData {
|
|
167
170
|
customID: string;
|
|
168
|
-
components: Array<
|
|
171
|
+
components: Array<{
|
|
172
|
+
type: ComponentTypes.ActionRow;
|
|
173
|
+
components: Array<StringSelectInteractionResponse | TextInputInteractionResponse>;
|
|
174
|
+
} | TextDisplay | Label>;
|
|
169
175
|
}
|
|
170
176
|
export interface ResolvedData {
|
|
171
177
|
users?: Record<snowflake, User>;
|
|
@@ -199,7 +205,7 @@ export interface InteractionCallbackData {
|
|
|
199
205
|
embeds?: Array<Embed>;
|
|
200
206
|
allowedMentions?: AllowedMentions;
|
|
201
207
|
flags?: MessageFlags;
|
|
202
|
-
components?: Array<ActionRow |
|
|
208
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container | Label>;
|
|
203
209
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
204
210
|
poll?: PollCreateParams;
|
|
205
211
|
files?: Array<FileData>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { LobbyMemberFlags } from "../constants";
|
|
2
|
+
import type { RawChannel } from "./channel";
|
|
3
|
+
import type { snowflake } from "./common";
|
|
4
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-object */
|
|
5
|
+
export interface RawLobby {
|
|
6
|
+
id: snowflake;
|
|
7
|
+
application_id: snowflake;
|
|
8
|
+
metadata: Record<string, string> | null;
|
|
9
|
+
members: Array<RawLobbyMember>;
|
|
10
|
+
linked_channel: RawChannel;
|
|
11
|
+
}
|
|
12
|
+
/** https://discord.com/developers/docs/resources/lobby#lobby-member-object-lobby-member-structure */
|
|
13
|
+
export interface RawLobbyMember {
|
|
14
|
+
id: snowflake;
|
|
15
|
+
metadata?: Record<string, string> | null;
|
|
16
|
+
flags?: LobbyMemberFlags;
|
|
17
|
+
}
|
|
18
|
+
export interface Lobby {
|
|
19
|
+
id: snowflake;
|
|
20
|
+
applicationID: snowflake;
|
|
21
|
+
metadata: Record<string, string> | null;
|
|
22
|
+
members: Array<LobbyMember>;
|
|
23
|
+
linkedChannel: RawChannel;
|
|
24
|
+
}
|
|
25
|
+
export interface LobbyMember {
|
|
26
|
+
id: snowflake;
|
|
27
|
+
metadata?: Record<string, string> | null;
|
|
28
|
+
flags?: LobbyMemberFlags;
|
|
29
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ButtonStyles, ChannelTypes, ComponentTypes, SeparatorSpacing, TextInputStyles } from "../constants";
|
|
2
2
|
import type { snowflake } from "./common";
|
|
3
3
|
import type { RawEmoji, Emoji } from "./emoji";
|
|
4
|
+
import type { RawResolvedData, ResolvedData } from "./interaction";
|
|
4
5
|
/** https://discord.com/developers/docs/components/reference#action-row-action-row-structure */
|
|
5
6
|
export interface RawActionRow {
|
|
6
7
|
type: ComponentTypes.ActionRow;
|
|
7
|
-
components: Array<RawButton | RawStringSelect | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect>;
|
|
8
|
+
components: Array<RawButton | RawStringSelect | RawTextInput | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect>;
|
|
8
9
|
id?: number;
|
|
9
10
|
}
|
|
10
11
|
/** https://discord.com/developers/docs/components/reference#button-button-structure */
|
|
@@ -31,6 +32,14 @@ export interface RawStringSelect {
|
|
|
31
32
|
required?: boolean;
|
|
32
33
|
disabled?: boolean;
|
|
33
34
|
}
|
|
35
|
+
/** https://discord.com/developers/docs/components/reference#string-select-string-select-interaction-response-structure */
|
|
36
|
+
export interface RawStringSelectInteractionResponse {
|
|
37
|
+
type: ComponentTypes.StringSelect;
|
|
38
|
+
component_type: ComponentTypes.StringSelect;
|
|
39
|
+
id: number;
|
|
40
|
+
custom_id: string;
|
|
41
|
+
values: Array<string>;
|
|
42
|
+
}
|
|
34
43
|
/** https://discord.com/developers/docs/components/reference#string-select-select-option-structure */
|
|
35
44
|
export interface RawSelectOption {
|
|
36
45
|
label: string;
|
|
@@ -50,6 +59,14 @@ export interface RawTextInput {
|
|
|
50
59
|
required?: boolean;
|
|
51
60
|
value?: string;
|
|
52
61
|
placeholder?: string;
|
|
62
|
+
label: string;
|
|
63
|
+
}
|
|
64
|
+
/** https://discord.com/developers/docs/components/reference#text-input-text-input-interaction-response-structure */
|
|
65
|
+
export interface RawTextInputInteractionResponse {
|
|
66
|
+
type: ComponentTypes.TextInput;
|
|
67
|
+
id: number;
|
|
68
|
+
custom_id: string;
|
|
69
|
+
value: string;
|
|
53
70
|
}
|
|
54
71
|
/** https://discord.com/developers/docs/components/reference#user-select-user-select-structure */
|
|
55
72
|
export interface RawUserSelect {
|
|
@@ -62,6 +79,14 @@ export interface RawUserSelect {
|
|
|
62
79
|
max_values?: number;
|
|
63
80
|
disabled?: boolean;
|
|
64
81
|
}
|
|
82
|
+
/** https://discord.com/developers/docs/components/reference#user-select-user-select-interaction-response-structure */
|
|
83
|
+
export interface RawUserSelectInteractionResponse {
|
|
84
|
+
component_type: ComponentTypes.UserSelect;
|
|
85
|
+
id: number;
|
|
86
|
+
custom_id: string;
|
|
87
|
+
resolved: RawResolvedData;
|
|
88
|
+
values: Array<snowflake>;
|
|
89
|
+
}
|
|
65
90
|
/** https://discord.com/developers/docs/components/reference#user-select-select-default-value-structure */
|
|
66
91
|
export interface RawDefaultValue {
|
|
67
92
|
id: snowflake;
|
|
@@ -78,6 +103,14 @@ export interface RawRoleSelect {
|
|
|
78
103
|
max_values?: number;
|
|
79
104
|
disabled?: boolean;
|
|
80
105
|
}
|
|
106
|
+
/** https://discord.com/developers/docs/components/reference#role-select-role-select-interaction-response-structure */
|
|
107
|
+
export interface RawRoleSelectInteractionResponse {
|
|
108
|
+
component_type: ComponentTypes.RoleSelect;
|
|
109
|
+
id: number;
|
|
110
|
+
custom_id: string;
|
|
111
|
+
resolved: RawResolvedData;
|
|
112
|
+
values: Array<snowflake>;
|
|
113
|
+
}
|
|
81
114
|
/** https://discord.com/developers/docs/components/reference#mentionable-select-mentionable-select-structure */
|
|
82
115
|
export interface RawMentionableSelect {
|
|
83
116
|
type: ComponentTypes.MentionableSelect;
|
|
@@ -89,6 +122,14 @@ export interface RawMentionableSelect {
|
|
|
89
122
|
max_values?: number;
|
|
90
123
|
disabled?: boolean;
|
|
91
124
|
}
|
|
125
|
+
/** https://discord.com/developers/docs/components/reference#mentionable-select-mentionable-select-interaction-response-structure */
|
|
126
|
+
export interface RawMentionableSelectInteractionResponse {
|
|
127
|
+
component_type: ComponentTypes.MentionableSelect;
|
|
128
|
+
id: number;
|
|
129
|
+
custom_id: string;
|
|
130
|
+
resolved: RawResolvedData;
|
|
131
|
+
values: Array<snowflake>;
|
|
132
|
+
}
|
|
92
133
|
/** https://discord.com/developers/docs/components/reference#channel-select-channel-select-structure */
|
|
93
134
|
export interface RawChannelSelect {
|
|
94
135
|
type: ComponentTypes.ChannelSelect;
|
|
@@ -101,6 +142,14 @@ export interface RawChannelSelect {
|
|
|
101
142
|
max_values?: number;
|
|
102
143
|
disabled?: boolean;
|
|
103
144
|
}
|
|
145
|
+
/** https://discord.com/developers/docs/components/reference#channel-select-channel-select-interaction-response-structure */
|
|
146
|
+
export interface RawChannelSelectInteractionResponse {
|
|
147
|
+
component_type: ComponentTypes.ChannelSelect;
|
|
148
|
+
id: number;
|
|
149
|
+
custom_id: string;
|
|
150
|
+
resolved: RawResolvedData;
|
|
151
|
+
values: Array<snowflake>;
|
|
152
|
+
}
|
|
104
153
|
/** https://discord.com/developers/docs/components/reference#section-section-structure */
|
|
105
154
|
export interface RawSection {
|
|
106
155
|
type: ComponentTypes.Section;
|
|
@@ -177,7 +226,7 @@ export interface RawUnfurledMediaItem {
|
|
|
177
226
|
}
|
|
178
227
|
export interface ActionRow {
|
|
179
228
|
type: ComponentTypes.ActionRow;
|
|
180
|
-
components: Array<Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect>;
|
|
229
|
+
components: Array<Button | StringSelect | TextInput | UserSelect | RoleSelect | MentionableSelect | ChannelSelect>;
|
|
181
230
|
id?: number;
|
|
182
231
|
}
|
|
183
232
|
export interface Button {
|
|
@@ -202,6 +251,13 @@ export interface StringSelect {
|
|
|
202
251
|
required?: boolean;
|
|
203
252
|
disabled?: boolean;
|
|
204
253
|
}
|
|
254
|
+
export interface StringSelectInteractionResponse {
|
|
255
|
+
type: ComponentTypes.StringSelect;
|
|
256
|
+
componentType: ComponentTypes.StringSelect;
|
|
257
|
+
id: number;
|
|
258
|
+
customID: string;
|
|
259
|
+
values: Array<string>;
|
|
260
|
+
}
|
|
205
261
|
export interface SelectOption {
|
|
206
262
|
label: string;
|
|
207
263
|
value: string;
|
|
@@ -219,6 +275,13 @@ export interface TextInput {
|
|
|
219
275
|
required?: boolean;
|
|
220
276
|
value?: string;
|
|
221
277
|
placeholder?: string;
|
|
278
|
+
label: string;
|
|
279
|
+
}
|
|
280
|
+
export interface TextInputInteractionResponse {
|
|
281
|
+
type: ComponentTypes.TextInput;
|
|
282
|
+
id: number;
|
|
283
|
+
customID: string;
|
|
284
|
+
value: string;
|
|
222
285
|
}
|
|
223
286
|
export interface UserSelect {
|
|
224
287
|
type: ComponentTypes.UserSelect;
|
|
@@ -230,6 +293,13 @@ export interface UserSelect {
|
|
|
230
293
|
maxValues?: number;
|
|
231
294
|
disabled?: boolean;
|
|
232
295
|
}
|
|
296
|
+
export interface UserSelectInteractionResponse {
|
|
297
|
+
component_type: ComponentTypes.UserSelect;
|
|
298
|
+
id: number;
|
|
299
|
+
customID: string;
|
|
300
|
+
resolved: ResolvedData;
|
|
301
|
+
values: Array<snowflake>;
|
|
302
|
+
}
|
|
233
303
|
export interface DefaultValue {
|
|
234
304
|
id: snowflake;
|
|
235
305
|
type: "user" | "role" | "channel";
|
|
@@ -244,6 +314,13 @@ export interface RoleSelect {
|
|
|
244
314
|
maxValues?: number;
|
|
245
315
|
disabled?: boolean;
|
|
246
316
|
}
|
|
317
|
+
export interface RoleSelectInteractionResponse {
|
|
318
|
+
componentType: ComponentTypes.RoleSelect;
|
|
319
|
+
id: number;
|
|
320
|
+
customID: string;
|
|
321
|
+
resolved: ResolvedData;
|
|
322
|
+
values: Array<snowflake>;
|
|
323
|
+
}
|
|
247
324
|
export interface MentionableSelect {
|
|
248
325
|
type: ComponentTypes.MentionableSelect;
|
|
249
326
|
id?: number;
|
|
@@ -254,6 +331,13 @@ export interface MentionableSelect {
|
|
|
254
331
|
maxValues?: number;
|
|
255
332
|
disabled?: boolean;
|
|
256
333
|
}
|
|
334
|
+
export interface MentionableSelectInteractionResponse {
|
|
335
|
+
componentType: ComponentTypes.MentionableSelect;
|
|
336
|
+
id: number;
|
|
337
|
+
customID: string;
|
|
338
|
+
resolved: ResolvedData;
|
|
339
|
+
values: Array<snowflake>;
|
|
340
|
+
}
|
|
257
341
|
export interface ChannelSelect {
|
|
258
342
|
type: ComponentTypes.ChannelSelect;
|
|
259
343
|
id?: number;
|
|
@@ -265,6 +349,13 @@ export interface ChannelSelect {
|
|
|
265
349
|
maxValues?: number;
|
|
266
350
|
disabled?: boolean;
|
|
267
351
|
}
|
|
352
|
+
export interface ChannelSelectInteractionResponse {
|
|
353
|
+
componentType: ComponentTypes.ChannelSelect;
|
|
354
|
+
id: number;
|
|
355
|
+
customID: string;
|
|
356
|
+
resolved: ResolvedData;
|
|
357
|
+
values: Array<snowflake>;
|
|
358
|
+
}
|
|
268
359
|
export interface Section {
|
|
269
360
|
type: ComponentTypes.Section;
|
|
270
361
|
id?: number;
|
|
@@ -4,7 +4,7 @@ import type { Channel, RawChannel, RawRoleSubscriptionData, RoleSubscriptionData
|
|
|
4
4
|
import type { snowflake, timestamp } from "./common";
|
|
5
5
|
import type { Emoji, RawEmoji } from "./emoji";
|
|
6
6
|
import type { MessageInteraction, RawMessageInteraction, RawResolvedData, ResolvedData } from "./interaction";
|
|
7
|
-
import type { ActionRow,
|
|
7
|
+
import type { ActionRow, Container, File, MediaGallery, RawActionRow, RawContainer, RawFile, RawMediaGallery, RawSection, RawSeparator, RawTextDisplay, Section, Separator, TextDisplay } from "./message-components";
|
|
8
8
|
import type { Poll, RawPoll } from "./poll";
|
|
9
9
|
import type { RawStickerItem, RawSticker, Sticker, StickerItem } from "./sticker";
|
|
10
10
|
import type { RawUser, User } from "./user";
|
|
@@ -38,7 +38,7 @@ export interface RawMessage {
|
|
|
38
38
|
interaction_metadata?: RawMessageInteractionMetadata;
|
|
39
39
|
interaction?: RawMessageInteraction;
|
|
40
40
|
thread?: RawChannel;
|
|
41
|
-
components?: Array<RawActionRow |
|
|
41
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer>;
|
|
42
42
|
sticker_items?: Array<RawStickerItem>;
|
|
43
43
|
stickers?: Array<RawSticker>;
|
|
44
44
|
position?: number;
|
|
@@ -230,7 +230,7 @@ export interface Message {
|
|
|
230
230
|
interactionMetadata?: MessageInteractionMetadata;
|
|
231
231
|
interaction?: MessageInteraction;
|
|
232
232
|
thread?: Channel;
|
|
233
|
-
components?: Array<ActionRow |
|
|
233
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
234
234
|
stickerItems?: Array<StickerItem>;
|
|
235
235
|
stickers?: Array<Sticker>;
|
|
236
236
|
position?: number;
|
package/dist/package.json
CHANGED