disgroove 2.2.7-dev.64580a3 → 2.2.7-dev.8886fa2
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 +7 -7
- package/dist/lib/Client.js +0 -14
- package/dist/lib/transformers/Components.d.ts +2 -2
- package/dist/lib/transformers/Components.js +50 -24
- package/dist/lib/transformers/Messages.d.ts +3 -3
- package/dist/lib/transformers/Messages.js +0 -28
- package/dist/lib/types/interaction.d.ts +3 -3
- package/dist/lib/types/message-components.d.ts +2 -0
- 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
|
@@ -276,7 +276,7 @@ export declare class Client extends EventEmitter {
|
|
|
276
276
|
tts?: boolean;
|
|
277
277
|
embeds?: Array<Embed>;
|
|
278
278
|
allowedMentions?: AllowedMentions;
|
|
279
|
-
components?: Array<ActionRow |
|
|
279
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
280
280
|
files?: Array<FileData> | null;
|
|
281
281
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
282
282
|
flags?: MessageFlags;
|
|
@@ -296,7 +296,7 @@ export declare class Client extends EventEmitter {
|
|
|
296
296
|
embeds?: Array<Embed>;
|
|
297
297
|
allowedMentions?: AllowedMentions;
|
|
298
298
|
messageReference?: MessageReference;
|
|
299
|
-
components?: Array<ActionRow |
|
|
299
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
300
300
|
stickersIDs?: Array<snowflake>;
|
|
301
301
|
files?: Array<FileData>;
|
|
302
302
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
@@ -629,7 +629,7 @@ export declare class Client extends EventEmitter {
|
|
|
629
629
|
embeds?: Array<Embed> | null;
|
|
630
630
|
flags?: MessageFlags | null;
|
|
631
631
|
allowedMentions?: AllowedMentions | null;
|
|
632
|
-
components?: Array<ActionRow |
|
|
632
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
|
|
633
633
|
files?: Array<FileData> | null;
|
|
634
634
|
attachments?: Array<Attachment> | null;
|
|
635
635
|
}): Promise<Message>;
|
|
@@ -643,7 +643,7 @@ export declare class Client extends EventEmitter {
|
|
|
643
643
|
content?: string | null;
|
|
644
644
|
embeds?: Array<Embed> | null;
|
|
645
645
|
allowedMentions?: AllowedMentions | null;
|
|
646
|
-
components?: Array<ActionRow |
|
|
646
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
|
|
647
647
|
files?: Array<FileData> | null;
|
|
648
648
|
attachments?: Array<Partial<Attachment>> | null;
|
|
649
649
|
poll?: PollCreateParams | null;
|
|
@@ -654,7 +654,7 @@ export declare class Client extends EventEmitter {
|
|
|
654
654
|
content?: string | null;
|
|
655
655
|
embeds?: Array<Embed> | null;
|
|
656
656
|
allowedMentions?: AllowedMentions | null;
|
|
657
|
-
components?: Array<ActionRow |
|
|
657
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
|
|
658
658
|
files?: Array<FileData> | null;
|
|
659
659
|
attachments?: Array<Partial<Attachment>> | null;
|
|
660
660
|
poll?: PollCreateParams | null;
|
|
@@ -676,7 +676,7 @@ export declare class Client extends EventEmitter {
|
|
|
676
676
|
content?: string | null;
|
|
677
677
|
embeds?: Array<Embed> | null;
|
|
678
678
|
allowedMentions?: AllowedMentions | null;
|
|
679
|
-
components?: Array<ActionRow |
|
|
679
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container> | null;
|
|
680
680
|
files?: Array<FileData> | null;
|
|
681
681
|
attachments?: Array<Partial<Attachment>> | null;
|
|
682
682
|
poll?: PollCreateParams | null;
|
|
@@ -698,7 +698,7 @@ export declare class Client extends EventEmitter {
|
|
|
698
698
|
tts?: boolean;
|
|
699
699
|
embeds?: Array<Embed>;
|
|
700
700
|
allowedMentions?: AllowedMentions;
|
|
701
|
-
components?: Array<ActionRow |
|
|
701
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container>;
|
|
702
702
|
files?: Array<FileData>;
|
|
703
703
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
704
704
|
flags?: MessageFlags;
|
package/dist/lib/Client.js
CHANGED
|
@@ -469,24 +469,10 @@ class Client extends node_events_1.default {
|
|
|
469
469
|
switch (component.type) {
|
|
470
470
|
case constants_1.ComponentTypes.ActionRow:
|
|
471
471
|
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
472
|
case constants_1.ComponentTypes.Section:
|
|
485
473
|
return transformers_1.Components.sectionToRaw(component);
|
|
486
474
|
case constants_1.ComponentTypes.TextDisplay:
|
|
487
475
|
return transformers_1.Components.textDisplayToRaw(component);
|
|
488
|
-
case constants_1.ComponentTypes.Thumbnail:
|
|
489
|
-
return transformers_1.Components.thumbnailToRaw(component);
|
|
490
476
|
case constants_1.ComponentTypes.MediaGallery:
|
|
491
477
|
return transformers_1.Components.mediaGalleryToRaw(component);
|
|
492
478
|
case constants_1.ComponentTypes.File:
|
|
@@ -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;
|
|
@@ -290,23 +290,63 @@ class Components {
|
|
|
290
290
|
};
|
|
291
291
|
}
|
|
292
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
|
+
}
|
|
293
302
|
return {
|
|
294
303
|
type: section.type,
|
|
295
304
|
id: section.id,
|
|
296
|
-
components:
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
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,
|
|
300
312
|
};
|
|
301
313
|
}
|
|
302
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
|
+
}
|
|
303
324
|
return {
|
|
304
325
|
type: section.type,
|
|
305
326
|
id: section.id,
|
|
306
|
-
components:
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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,
|
|
310
350
|
};
|
|
311
351
|
}
|
|
312
352
|
static stringSelectFromRaw(stringSelect) {
|
|
@@ -356,22 +396,6 @@ class Components {
|
|
|
356
396
|
disabled: stringSelect.disabled,
|
|
357
397
|
};
|
|
358
398
|
}
|
|
359
|
-
static separatorFromRaw(separator) {
|
|
360
|
-
return {
|
|
361
|
-
type: separator.type,
|
|
362
|
-
id: separator.id,
|
|
363
|
-
divider: separator.divider,
|
|
364
|
-
spacing: separator.spacing,
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
static separatorToRaw(separator) {
|
|
368
|
-
return {
|
|
369
|
-
type: separator.type,
|
|
370
|
-
id: separator.id,
|
|
371
|
-
divider: separator.divider,
|
|
372
|
-
spacing: separator.spacing,
|
|
373
|
-
};
|
|
374
|
-
}
|
|
375
399
|
static textDisplayFromRaw(textDisplay) {
|
|
376
400
|
return {
|
|
377
401
|
type: textDisplay.type,
|
|
@@ -397,6 +421,7 @@ class Components {
|
|
|
397
421
|
value: textInput.value,
|
|
398
422
|
placeholder: textInput.placeholder,
|
|
399
423
|
id: textInput.id,
|
|
424
|
+
label: textInput.label,
|
|
400
425
|
};
|
|
401
426
|
}
|
|
402
427
|
static textInputToRaw(textInput) {
|
|
@@ -410,6 +435,7 @@ class Components {
|
|
|
410
435
|
value: textInput.value,
|
|
411
436
|
placeholder: textInput.placeholder,
|
|
412
437
|
id: textInput.id,
|
|
438
|
+
label: textInput.label,
|
|
413
439
|
};
|
|
414
440
|
}
|
|
415
441
|
static thumbnailFromRaw(thumbnail) {
|
|
@@ -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:
|
|
@@ -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, RawTextDisplay, Section, Separator, TextDisplay } 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";
|
|
@@ -93,7 +93,7 @@ export interface RawInteractionCallbackData {
|
|
|
93
93
|
embeds?: Array<RawEmbed>;
|
|
94
94
|
allowed_mentions?: RawAllowedMentions;
|
|
95
95
|
flags?: MessageFlags;
|
|
96
|
-
components?: Array<RawActionRow |
|
|
96
|
+
components?: Array<RawActionRow | RawSection | RawTextDisplay | RawMediaGallery | RawFile | RawSeparator | RawContainer | RawLabel>;
|
|
97
97
|
attachments?: Array<Pick<RawAttachment, "filename" | "description">>;
|
|
98
98
|
poll?: RawPollCreateParams;
|
|
99
99
|
files?: Array<FileData>;
|
|
@@ -199,7 +199,7 @@ export interface InteractionCallbackData {
|
|
|
199
199
|
embeds?: Array<Embed>;
|
|
200
200
|
allowedMentions?: AllowedMentions;
|
|
201
201
|
flags?: MessageFlags;
|
|
202
|
-
components?: Array<ActionRow |
|
|
202
|
+
components?: Array<ActionRow | Section | TextDisplay | MediaGallery | File | Separator | Container | Label>;
|
|
203
203
|
attachments?: Array<Pick<Attachment, "filename" | "description">>;
|
|
204
204
|
poll?: PollCreateParams;
|
|
205
205
|
files?: Array<FileData>;
|
|
@@ -50,6 +50,7 @@ export interface RawTextInput {
|
|
|
50
50
|
required?: boolean;
|
|
51
51
|
value?: string;
|
|
52
52
|
placeholder?: string;
|
|
53
|
+
label: string;
|
|
53
54
|
}
|
|
54
55
|
/** https://discord.com/developers/docs/components/reference#user-select-user-select-structure */
|
|
55
56
|
export interface RawUserSelect {
|
|
@@ -219,6 +220,7 @@ export interface TextInput {
|
|
|
219
220
|
required?: boolean;
|
|
220
221
|
value?: string;
|
|
221
222
|
placeholder?: string;
|
|
223
|
+
label: string;
|
|
222
224
|
}
|
|
223
225
|
export interface UserSelect {
|
|
224
226
|
type: ComponentTypes.UserSelect;
|
|
@@ -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