disgroove 2.2.7-dev.2c78f2c → 2.2.7-dev.4784073
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 +98 -2
- package/dist/lib/constants.d.ts +5 -0
- package/dist/lib/constants.js +7 -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 +110 -12
- 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/Roles.js +2 -2
- package/dist/lib/transformers/index.d.ts +2 -1
- package/dist/lib/transformers/index.js +2 -1
- package/dist/lib/types/guild.d.ts +7 -5
- package/dist/lib/types/interaction.d.ts +17 -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/lib/types/role.d.ts +2 -2
- package/dist/lib/utils/formatters.d.ts +1 -1
- package/dist/lib/utils/formatters.js +1 -1
- 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));
|
|
@@ -333,6 +340,11 @@ class Client extends node_events_1.default {
|
|
|
333
340
|
name: options.name,
|
|
334
341
|
permissions: options.permissions,
|
|
335
342
|
color: options.color,
|
|
343
|
+
colors: {
|
|
344
|
+
primary_color: options.colors?.primaryColor,
|
|
345
|
+
secondary_color: options.colors?.secondaryColor,
|
|
346
|
+
tertiary_color: options.colors?.tertiaryColor,
|
|
347
|
+
},
|
|
336
348
|
hoist: options.hoist,
|
|
337
349
|
icon: options.icon,
|
|
338
350
|
unicode_emoji: options.unicodeEmoji,
|
|
@@ -465,7 +477,24 @@ class Client extends node_events_1.default {
|
|
|
465
477
|
: undefined,
|
|
466
478
|
flags: options.data?.flags,
|
|
467
479
|
components: options.data?.components !== undefined
|
|
468
|
-
?
|
|
480
|
+
? options.data?.components.map((component) => {
|
|
481
|
+
switch (component.type) {
|
|
482
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
483
|
+
return transformers_1.Components.actionRowToRaw(component);
|
|
484
|
+
case constants_1.ComponentTypes.Section:
|
|
485
|
+
return transformers_1.Components.sectionToRaw(component);
|
|
486
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
487
|
+
return transformers_1.Components.textDisplayToRaw(component);
|
|
488
|
+
case constants_1.ComponentTypes.MediaGallery:
|
|
489
|
+
return transformers_1.Components.mediaGalleryToRaw(component);
|
|
490
|
+
case constants_1.ComponentTypes.File:
|
|
491
|
+
return transformers_1.Components.fileToRaw(component);
|
|
492
|
+
case constants_1.ComponentTypes.Separator:
|
|
493
|
+
return transformers_1.Components.separatorToRaw(component);
|
|
494
|
+
case constants_1.ComponentTypes.Container:
|
|
495
|
+
return transformers_1.Components.containerToRaw(component);
|
|
496
|
+
}
|
|
497
|
+
})
|
|
469
498
|
: undefined,
|
|
470
499
|
attachments: options.data?.attachments,
|
|
471
500
|
poll: options.data?.poll !== undefined
|
|
@@ -517,7 +546,16 @@ class Client extends node_events_1.default {
|
|
|
517
546
|
data: {
|
|
518
547
|
custom_id: options.data?.customID,
|
|
519
548
|
components: options.data?.components !== undefined
|
|
520
|
-
?
|
|
549
|
+
? options.data?.components.map((component) => {
|
|
550
|
+
switch (component.type) {
|
|
551
|
+
case constants_1.ComponentTypes.ActionRow:
|
|
552
|
+
return transformers_1.Components.actionRowToRaw(component);
|
|
553
|
+
case constants_1.ComponentTypes.TextDisplay:
|
|
554
|
+
return transformers_1.Components.textDisplayToRaw(component);
|
|
555
|
+
case constants_1.ComponentTypes.Label:
|
|
556
|
+
return transformers_1.Components.labelToRaw(component);
|
|
557
|
+
}
|
|
558
|
+
})
|
|
521
559
|
: undefined,
|
|
522
560
|
title: options.data?.title,
|
|
523
561
|
},
|
|
@@ -554,6 +592,17 @@ class Client extends node_events_1.default {
|
|
|
554
592
|
});
|
|
555
593
|
}
|
|
556
594
|
}
|
|
595
|
+
/** https://discord.com/developers/docs/resources/lobby#create-lobby */
|
|
596
|
+
async createLobby(options) {
|
|
597
|
+
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.lobbies(), {
|
|
598
|
+
json: {
|
|
599
|
+
metadata: options.metadata,
|
|
600
|
+
members: options.members,
|
|
601
|
+
idle_timeout_seconds: options.idleTimeoutSeconds,
|
|
602
|
+
},
|
|
603
|
+
});
|
|
604
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
605
|
+
}
|
|
557
606
|
/** https://discord.com/developers/docs/resources/message#create-message */
|
|
558
607
|
async createMessage(channelID, options) {
|
|
559
608
|
const response = await this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelMessages(channelID), {
|
|
@@ -780,6 +829,10 @@ class Client extends node_events_1.default {
|
|
|
780
829
|
deleteInteractionResponse(applicationID, interactionToken) {
|
|
781
830
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.webhookMessage(applicationID, interactionToken));
|
|
782
831
|
}
|
|
832
|
+
/** https://discord.com/developers/docs/resources/lobby#delete-lobby */
|
|
833
|
+
deleteLobby(lobbyID) {
|
|
834
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobby(lobbyID));
|
|
835
|
+
}
|
|
783
836
|
/** https://discord.com/developers/docs/resources/message#delete-message */
|
|
784
837
|
deleteMessage(channelID, messageID, reason) {
|
|
785
838
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.channelMessage(channelID, messageID), {
|
|
@@ -1119,6 +1172,11 @@ class Client extends node_events_1.default {
|
|
|
1119
1172
|
name: options?.name,
|
|
1120
1173
|
permissions: options?.permissions,
|
|
1121
1174
|
color: options?.color,
|
|
1175
|
+
colors: {
|
|
1176
|
+
primary_color: options?.colors?.primaryColor,
|
|
1177
|
+
secondary_color: options?.colors?.secondaryColor,
|
|
1178
|
+
tertiary_color: options?.colors?.tertiaryColor,
|
|
1179
|
+
},
|
|
1122
1180
|
hoist: options?.hoist,
|
|
1123
1181
|
icon: options?.icon,
|
|
1124
1182
|
unicode_emoji: options?.unicodeEmoji,
|
|
@@ -1234,6 +1292,17 @@ class Client extends node_events_1.default {
|
|
|
1234
1292
|
channelID: response.channel_id,
|
|
1235
1293
|
};
|
|
1236
1294
|
}
|
|
1295
|
+
/** https://discord.com/developers/docs/resources/lobby#modify-lobby */
|
|
1296
|
+
async editLobby(lobbyID, options) {
|
|
1297
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobby(lobbyID), {
|
|
1298
|
+
json: {
|
|
1299
|
+
metadata: options.metadata,
|
|
1300
|
+
members: options.members,
|
|
1301
|
+
idle_timeout_seconds: options.idleTimeoutSeconds,
|
|
1302
|
+
},
|
|
1303
|
+
});
|
|
1304
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
1305
|
+
}
|
|
1237
1306
|
/** https://discord.com/developers/docs/resources/message#edit-message */
|
|
1238
1307
|
async editMessage(channelID, messageID, options) {
|
|
1239
1308
|
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.channelMessage(channelID, messageID), {
|
|
@@ -2102,6 +2171,11 @@ class Client extends node_events_1.default {
|
|
|
2102
2171
|
hasMore: response.has_more,
|
|
2103
2172
|
};
|
|
2104
2173
|
}
|
|
2174
|
+
/** https://discord.com/developers/docs/resources/lobby#get-lobby */
|
|
2175
|
+
async getLobby(lobbyID) {
|
|
2176
|
+
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.lobby(lobbyID));
|
|
2177
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2178
|
+
}
|
|
2105
2179
|
/** https://discord.com/developers/docs/resources/message#get-channel-message */
|
|
2106
2180
|
async getMessage(channelID, messageID) {
|
|
2107
2181
|
const response = await this.rest.request(rest_1.RESTMethods.Get, rest_1.Endpoints.channelMessage(channelID, messageID));
|
|
@@ -2299,6 +2373,10 @@ class Client extends node_events_1.default {
|
|
|
2299
2373
|
leaveGuild(guildID) {
|
|
2300
2374
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.userGuild(guildID));
|
|
2301
2375
|
}
|
|
2376
|
+
/** https://discord.com/developers/docs/resources/lobby#leave-lobby */
|
|
2377
|
+
leaveLobby(lobbyID) {
|
|
2378
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(lobbyID));
|
|
2379
|
+
}
|
|
2302
2380
|
/** https://discord.com/developers/docs/resources/channel#leave-thread */
|
|
2303
2381
|
leaveThread(channelID) {
|
|
2304
2382
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelID, "@me"));
|
|
@@ -2312,6 +2390,15 @@ class Client extends node_events_1.default {
|
|
|
2312
2390
|
selfDeaf: false,
|
|
2313
2391
|
});
|
|
2314
2392
|
}
|
|
2393
|
+
/** discord.com/developers/docs/resources/lobby#link-channel-to-lobby */
|
|
2394
|
+
async linkChannel(lobbyID, options) {
|
|
2395
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(lobbyID), {
|
|
2396
|
+
json: {
|
|
2397
|
+
channel_id: options.channelID,
|
|
2398
|
+
},
|
|
2399
|
+
});
|
|
2400
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2401
|
+
}
|
|
2315
2402
|
/** https://discord.com/developers/docs/resources/channel#pin-message */
|
|
2316
2403
|
pinMessage(channelID, messageID, reason) {
|
|
2317
2404
|
this.rest.request(rest_1.RESTMethods.Put, rest_1.Endpoints.channelPin(channelID, messageID), {
|
|
@@ -2340,6 +2427,10 @@ class Client extends node_events_1.default {
|
|
|
2340
2427
|
reason,
|
|
2341
2428
|
});
|
|
2342
2429
|
}
|
|
2430
|
+
/** https://discord.com/developers/docs/resources/lobby#remove-a-member-from-a-lobby */
|
|
2431
|
+
removeLobbyMember(lobbyID, userID) {
|
|
2432
|
+
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.lobbyMember(lobbyID, userID));
|
|
2433
|
+
}
|
|
2343
2434
|
/** https://discord.com/developers/docs/resources/channel#remove-thread-member */
|
|
2344
2435
|
removeThreadMember(channelID, userID) {
|
|
2345
2436
|
this.rest.request(rest_1.RESTMethods.Delete, rest_1.Endpoints.threadMembers(channelID, userID));
|
|
@@ -2376,6 +2467,11 @@ class Client extends node_events_1.default {
|
|
|
2376
2467
|
triggerTypingIndicator(channelID) {
|
|
2377
2468
|
this.rest.request(rest_1.RESTMethods.Post, rest_1.Endpoints.channelTyping(channelID));
|
|
2378
2469
|
}
|
|
2470
|
+
/** https://discord.com/developers/docs/resources/lobby#unlink-channel-from-lobby */
|
|
2471
|
+
async unlinkChannel(lobbyID) {
|
|
2472
|
+
const response = await this.rest.request(rest_1.RESTMethods.Patch, rest_1.Endpoints.lobbyChannelLinking(lobbyID));
|
|
2473
|
+
return transformers_1.Lobbies.lobbyFromRaw(response);
|
|
2474
|
+
}
|
|
2379
2475
|
/** https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records */
|
|
2380
2476
|
async updateApplicationRoleConnectionMetadataRecords(applicationID) {
|
|
2381
2477
|
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,
|
|
@@ -1175,6 +1179,7 @@ export declare enum JSONErrorCodes {
|
|
|
1175
1179
|
MessageBlockedByHarmfulLinksFilter = 240000,
|
|
1176
1180
|
CannotEnableOnboardingRequirementsAreNotMet = 350000,
|
|
1177
1181
|
CannotUpdateOnboardingWhileBelowRequirements = 350001,
|
|
1182
|
+
AccessToFileUploadsHasBeenLimitedForThisGuild = 400001,
|
|
1178
1183
|
FailedToBanUsers = 500000,
|
|
1179
1184
|
PollVotingBlocked = 520000,
|
|
1180
1185
|
PollExpired = 520001,
|
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) {
|
|
@@ -1264,6 +1269,7 @@ var JSONErrorCodes;
|
|
|
1264
1269
|
JSONErrorCodes[JSONErrorCodes["MessageBlockedByHarmfulLinksFilter"] = 240000] = "MessageBlockedByHarmfulLinksFilter";
|
|
1265
1270
|
JSONErrorCodes[JSONErrorCodes["CannotEnableOnboardingRequirementsAreNotMet"] = 350000] = "CannotEnableOnboardingRequirementsAreNotMet";
|
|
1266
1271
|
JSONErrorCodes[JSONErrorCodes["CannotUpdateOnboardingWhileBelowRequirements"] = 350001] = "CannotUpdateOnboardingWhileBelowRequirements";
|
|
1272
|
+
JSONErrorCodes[JSONErrorCodes["AccessToFileUploadsHasBeenLimitedForThisGuild"] = 400001] = "AccessToFileUploadsHasBeenLimitedForThisGuild";
|
|
1267
1273
|
JSONErrorCodes[JSONErrorCodes["FailedToBanUsers"] = 500000] = "FailedToBanUsers";
|
|
1268
1274
|
JSONErrorCodes[JSONErrorCodes["PollVotingBlocked"] = 520000] = "PollVotingBlocked";
|
|
1269
1275
|
JSONErrorCodes[JSONErrorCodes["PollExpired"] = 520001] = "PollExpired";
|
|
@@ -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) {
|