disgroove 2.2.7-dev.2c78f2c → 2.2.7-dev.64580a3

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.
@@ -465,7 +465,38 @@ class Client extends node_events_1.default {
465
465
  : undefined,
466
466
  flags: options.data?.flags,
467
467
  components: options.data?.components !== undefined
468
- ? transformers_1.Messages.componentsToRaw(options.data.components)
468
+ ? options.data?.components.map((component) => {
469
+ switch (component.type) {
470
+ case constants_1.ComponentTypes.ActionRow:
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
+ 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.Thumbnail:
489
+ return transformers_1.Components.thumbnailToRaw(component);
490
+ case constants_1.ComponentTypes.MediaGallery:
491
+ return transformers_1.Components.mediaGalleryToRaw(component);
492
+ case constants_1.ComponentTypes.File:
493
+ return transformers_1.Components.fileToRaw(component);
494
+ case constants_1.ComponentTypes.Separator:
495
+ return transformers_1.Components.separatorToRaw(component);
496
+ case constants_1.ComponentTypes.Container:
497
+ return transformers_1.Components.containerToRaw(component);
498
+ }
499
+ })
469
500
  : undefined,
470
501
  attachments: options.data?.attachments,
471
502
  poll: options.data?.poll !== undefined
@@ -517,7 +548,16 @@ class Client extends node_events_1.default {
517
548
  data: {
518
549
  custom_id: options.data?.customID,
519
550
  components: options.data?.components !== undefined
520
- ? transformers_1.Messages.componentsToRaw(options.data.components)
551
+ ? options.data?.components.map((component) => {
552
+ switch (component.type) {
553
+ case constants_1.ComponentTypes.ActionRow:
554
+ return transformers_1.Components.actionRowToRaw(component);
555
+ case constants_1.ComponentTypes.TextDisplay:
556
+ return transformers_1.Components.textDisplayToRaw(component);
557
+ case constants_1.ComponentTypes.Label:
558
+ return transformers_1.Components.labelToRaw(component);
559
+ }
560
+ })
521
561
  : undefined,
522
562
  title: options.data?.title,
523
563
  },
@@ -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:
@@ -73,10 +73,10 @@ 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.StringSelect:
77
- return Components_1.Components.stringSelectFromRaw(component);
78
- case constants_1.ComponentTypes.TextInput:
79
- return Components_1.Components.textInputFromRaw(component);
76
+ case constants_1.ComponentTypes.ActionRow:
77
+ return Components_1.Components.actionRowFromRaw(component);
78
+ case constants_1.ComponentTypes.TextDisplay:
79
+ return Components_1.Components.textDisplayFromRaw(component);
80
80
  case constants_1.ComponentTypes.Label:
81
81
  return Components_1.Components.labelFromRaw(component);
82
82
  }
@@ -170,10 +170,10 @@ class Interactions {
170
170
  values: interaction.data.values,
171
171
  components: interaction.data?.components?.map((component) => {
172
172
  switch (component.type) {
173
- case constants_1.ComponentTypes.StringSelect:
174
- return Components_1.Components.stringSelectToRaw(component);
175
- case constants_1.ComponentTypes.TextInput:
176
- return Components_1.Components.textInputToRaw(component);
173
+ case constants_1.ComponentTypes.ActionRow:
174
+ return Components_1.Components.actionRowToRaw(component);
175
+ case constants_1.ComponentTypes.TextDisplay:
176
+ return Components_1.Components.textDisplayToRaw(component);
177
177
  case constants_1.ComponentTypes.Label:
178
178
  return Components_1.Components.labelToRaw(component);
179
179
  }
@@ -54,7 +54,7 @@ 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<RawStringSelect | RawTextInput | RawLabel>;
57
+ components: Array<RawActionRow | RawTextDisplay | RawLabel>;
58
58
  }
59
59
  /** https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure */
60
60
  export interface RawResolvedData {
@@ -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 | RawButton | RawStringSelect | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect | RawSection | RawTextDisplay | RawThumbnail | RawMediaGallery | RawFile | RawSeparator | RawContainer>;
96
+ components?: Array<RawActionRow | RawButton | RawStringSelect | RawTextInput | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect | RawSection | RawTextDisplay | RawThumbnail | RawMediaGallery | RawFile | RawSeparator | RawContainer | RawLabel>;
97
97
  attachments?: Array<Pick<RawAttachment, "filename" | "description">>;
98
98
  poll?: RawPollCreateParams;
99
99
  files?: Array<FileData>;
@@ -165,7 +165,7 @@ export interface MessageComponentData {
165
165
  }
166
166
  export interface ModalSubmitData {
167
167
  customID: string;
168
- components: Array<StringSelect | TextInput | Label>;
168
+ components: Array<ActionRow | TextDisplay | Label>;
169
169
  }
170
170
  export interface ResolvedData {
171
171
  users?: Record<snowflake, User>;
@@ -199,7 +199,7 @@ export interface InteractionCallbackData {
199
199
  embeds?: Array<Embed>;
200
200
  allowedMentions?: AllowedMentions;
201
201
  flags?: MessageFlags;
202
- components?: Array<ActionRow | Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container>;
202
+ components?: Array<ActionRow | Button | StringSelect | TextInput | UserSelect | RoleSelect | MentionableSelect | ChannelSelect | Section | TextDisplay | Thumbnail | MediaGallery | File | Separator | Container | Label>;
203
203
  attachments?: Array<Pick<Attachment, "filename" | "description">>;
204
204
  poll?: PollCreateParams;
205
205
  files?: Array<FileData>;
@@ -4,7 +4,7 @@ import type { RawEmoji, Emoji } from "./emoji";
4
4
  /** https://discord.com/developers/docs/components/reference#action-row-action-row-structure */
5
5
  export interface RawActionRow {
6
6
  type: ComponentTypes.ActionRow;
7
- components: Array<RawButton | RawStringSelect | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect>;
7
+ components: Array<RawButton | RawStringSelect | RawTextInput | RawUserSelect | RawRoleSelect | RawMentionableSelect | RawChannelSelect>;
8
8
  id?: number;
9
9
  }
10
10
  /** https://discord.com/developers/docs/components/reference#button-button-structure */
@@ -177,7 +177,7 @@ export interface RawUnfurledMediaItem {
177
177
  }
178
178
  export interface ActionRow {
179
179
  type: ComponentTypes.ActionRow;
180
- components: Array<Button | StringSelect | UserSelect | RoleSelect | MentionableSelect | ChannelSelect>;
180
+ components: Array<Button | StringSelect | TextInput | UserSelect | RoleSelect | MentionableSelect | ChannelSelect>;
181
181
  id?: number;
182
182
  }
183
183
  export interface Button {
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.2.7-dev.2c78f2c",
3
+ "version": "2.2.7-dev.64580a3",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "disgroove",
3
- "version": "2.2.7-dev.2c78f2c",
3
+ "version": "2.2.7-dev.64580a3",
4
4
  "description": "A module to interface with Discord",
5
5
  "main": "./dist/lib/index.js",
6
6
  "types": "./dist/lib/index.d.ts",