disgroove 2.2.7-dev.fca4921 → 3.0.0-dev.51640ff

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.
Files changed (81) hide show
  1. package/dist/lib/Client.d.ts +291 -254
  2. package/dist/lib/Client.js +554 -460
  3. package/dist/lib/constants.d.ts +29 -21
  4. package/dist/lib/constants.js +33 -24
  5. package/dist/lib/gateway/Shard.d.ts +5 -3
  6. package/dist/lib/gateway/Shard.js +183 -120
  7. package/dist/lib/index.d.ts +5 -1
  8. package/dist/lib/index.js +5 -1
  9. package/dist/lib/rest/Endpoints.d.ts +95 -91
  10. package/dist/lib/rest/Endpoints.js +111 -102
  11. package/dist/lib/rest/RequestManager.d.ts +1 -3
  12. package/dist/lib/transformers/ApplicationCommands.js +4 -4
  13. package/dist/lib/transformers/Applications.d.ts +2 -0
  14. package/dist/lib/transformers/Applications.js +110 -4
  15. package/dist/lib/transformers/AuditLogs.js +10 -10
  16. package/dist/lib/transformers/AutoModeration.js +6 -6
  17. package/dist/lib/transformers/Channels.js +16 -16
  18. package/dist/lib/transformers/Components.d.ts +13 -3
  19. package/dist/lib/transformers/Components.js +283 -156
  20. package/dist/lib/transformers/Entitlements.d.ts +2 -2
  21. package/dist/lib/transformers/Entitlements.js +16 -16
  22. package/dist/lib/transformers/GuildScheduledEvents.js +8 -8
  23. package/dist/lib/transformers/GuildTemplates.js +4 -4
  24. package/dist/lib/transformers/Guilds.js +28 -28
  25. package/dist/lib/transformers/Interactions.js +300 -55
  26. package/dist/lib/transformers/Lobbies.d.ts +7 -0
  27. package/dist/lib/transformers/Lobbies.js +38 -0
  28. package/dist/lib/transformers/Messages.d.ts +4 -3
  29. package/dist/lib/transformers/Messages.js +38 -52
  30. package/dist/lib/transformers/Polls.js +2 -2
  31. package/dist/lib/transformers/Presences.js +6 -6
  32. package/dist/lib/transformers/Roles.js +8 -8
  33. package/dist/lib/transformers/SKUs.js +2 -2
  34. package/dist/lib/transformers/Soundboards.js +6 -6
  35. package/dist/lib/transformers/StageInstances.js +6 -6
  36. package/dist/lib/transformers/Stickers.js +3 -3
  37. package/dist/lib/transformers/Subscriptions.js +8 -8
  38. package/dist/lib/transformers/Teams.js +4 -4
  39. package/dist/lib/transformers/Users.js +6 -6
  40. package/dist/lib/transformers/Voice.js +8 -8
  41. package/dist/lib/transformers/Webhooks.js +6 -6
  42. package/dist/lib/transformers/index.d.ts +2 -1
  43. package/dist/lib/transformers/index.js +2 -1
  44. package/dist/lib/types/application-command.d.ts +9 -4
  45. package/dist/lib/types/application-role-connection-metadata.d.ts +1 -0
  46. package/dist/lib/types/application.d.ts +12 -7
  47. package/dist/lib/types/audit-log.d.ts +9 -5
  48. package/dist/lib/types/auto-moderation.d.ts +7 -3
  49. package/dist/lib/types/channel.d.ts +17 -23
  50. package/dist/lib/types/common.d.ts +2 -0
  51. package/dist/lib/types/components.d.ts +478 -0
  52. package/dist/lib/types/components.js +2 -0
  53. package/dist/lib/types/emoji.d.ts +1 -0
  54. package/dist/lib/types/entitlements.d.ts +5 -4
  55. package/dist/lib/types/gateway-events.d.ts +203 -130
  56. package/dist/lib/types/guild-scheduled-event.d.ts +10 -5
  57. package/dist/lib/types/guild-template.d.ts +3 -2
  58. package/dist/lib/types/guild.d.ts +40 -22
  59. package/dist/lib/types/interaction.d.ts +35 -18
  60. package/dist/lib/types/invite.d.ts +5 -2
  61. package/dist/lib/types/lobby.d.ts +31 -0
  62. package/dist/lib/types/lobby.js +2 -0
  63. package/dist/lib/types/message-components.d.ts +334 -118
  64. package/dist/lib/types/message.d.ts +32 -20
  65. package/dist/lib/types/poll.d.ts +7 -1
  66. package/dist/lib/types/role.d.ts +8 -5
  67. package/dist/lib/types/sku.d.ts +2 -1
  68. package/dist/lib/types/soundboard.d.ts +4 -3
  69. package/dist/lib/types/stage-instance.d.ts +4 -3
  70. package/dist/lib/types/sticker.d.ts +8 -5
  71. package/dist/lib/types/subscription.d.ts +6 -5
  72. package/dist/lib/types/team.d.ts +4 -2
  73. package/dist/lib/types/user.d.ts +10 -3
  74. package/dist/lib/types/voice.d.ts +6 -4
  75. package/dist/lib/types/webhook.d.ts +4 -3
  76. package/dist/lib/utils/CDN.d.ts +22 -22
  77. package/dist/lib/utils/CDN.js +22 -22
  78. package/dist/lib/utils/formatters.d.ts +7 -7
  79. package/dist/lib/utils/formatters.js +19 -19
  80. package/dist/package.json +4 -4
  81. package/package.json +4 -4
@@ -1,26 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Components = void 0;
4
- const constants_js_1 = require("../constants.js");
4
+ const constants_1 = require("../constants");
5
5
  class Components {
6
6
  static actionRowFromRaw(actionRow) {
7
7
  return {
8
8
  type: actionRow.type,
9
9
  components: actionRow.components.map((c) => {
10
10
  switch (c.type) {
11
- case constants_js_1.ComponentTypes.Button: {
11
+ case constants_1.ComponentTypes.Button:
12
12
  return Components.buttonFromRaw(c);
13
- }
14
- case constants_js_1.ComponentTypes.TextInput: {
13
+ case constants_1.ComponentTypes.StringSelect:
14
+ return Components.stringSelectFromRaw(c);
15
+ case constants_1.ComponentTypes.TextInput:
15
16
  return Components.textInputFromRaw(c);
16
- }
17
- case constants_js_1.ComponentTypes.ChannelSelect:
18
- case constants_js_1.ComponentTypes.MentionableSelect:
19
- case constants_js_1.ComponentTypes.RoleSelect:
20
- case constants_js_1.ComponentTypes.UserSelect:
21
- case constants_js_1.ComponentTypes.StringSelect: {
22
- return Components.selectMenuFromRaw(c);
23
- }
17
+ case constants_1.ComponentTypes.UserSelect:
18
+ return Components.userSelectFromRaw(c);
19
+ case constants_1.ComponentTypes.RoleSelect:
20
+ return Components.roleSelectFromRaw(c);
21
+ case constants_1.ComponentTypes.MentionableSelect:
22
+ return Components.mentionableSelectFromRaw(c);
23
+ case constants_1.ComponentTypes.ChannelSelect:
24
+ return Components.channelSelectFromRaw(c);
24
25
  }
25
26
  }),
26
27
  id: actionRow.id,
@@ -31,19 +32,20 @@ class Components {
31
32
  type: actionRow.type,
32
33
  components: actionRow.components.map((c) => {
33
34
  switch (c.type) {
34
- case constants_js_1.ComponentTypes.Button: {
35
+ case constants_1.ComponentTypes.Button:
35
36
  return Components.buttonToRaw(c);
36
- }
37
- case constants_js_1.ComponentTypes.TextInput: {
37
+ case constants_1.ComponentTypes.StringSelect:
38
+ return Components.stringSelectToRaw(c);
39
+ case constants_1.ComponentTypes.TextInput:
38
40
  return Components.textInputToRaw(c);
39
- }
40
- case constants_js_1.ComponentTypes.ChannelSelect:
41
- case constants_js_1.ComponentTypes.MentionableSelect:
42
- case constants_js_1.ComponentTypes.RoleSelect:
43
- case constants_js_1.ComponentTypes.UserSelect:
44
- case constants_js_1.ComponentTypes.StringSelect: {
45
- return Components.selectMenuToRaw(c);
46
- }
41
+ case constants_1.ComponentTypes.UserSelect:
42
+ return Components.userSelectToRaw(c);
43
+ case constants_1.ComponentTypes.RoleSelect:
44
+ return Components.roleSelectToRaw(c);
45
+ case constants_1.ComponentTypes.MentionableSelect:
46
+ return Components.mentionableSelectToRaw(c);
47
+ case constants_1.ComponentTypes.ChannelSelect:
48
+ return Components.channelSelectToRaw(c);
47
49
  }
48
50
  }),
49
51
  id: actionRow.id,
@@ -55,8 +57,8 @@ class Components {
55
57
  style: button.style,
56
58
  label: button.label,
57
59
  emoji: button.emoji,
58
- customID: button.custom_id,
59
- skuID: button.sku_id,
60
+ customId: button.custom_id,
61
+ skuId: button.sku_id,
60
62
  url: button.url,
61
63
  disabled: button.disabled,
62
64
  id: button.id,
@@ -68,35 +70,61 @@ class Components {
68
70
  style: button.style,
69
71
  label: button.label,
70
72
  emoji: button.emoji,
71
- custom_id: button.customID,
72
- sku_id: button.skuID,
73
+ custom_id: button.customId,
74
+ sku_id: button.skuId,
73
75
  url: button.url,
74
76
  disabled: button.disabled,
75
77
  id: button.id,
76
78
  };
77
79
  }
80
+ static channelSelectFromRaw(channelSelect) {
81
+ return {
82
+ type: channelSelect.type,
83
+ id: channelSelect.id,
84
+ customId: channelSelect.custom_id,
85
+ channelTypes: channelSelect.channel_types,
86
+ placeholder: channelSelect.placeholder,
87
+ defaultValues: channelSelect.default_values,
88
+ minValues: channelSelect.min_values,
89
+ maxValues: channelSelect.max_values,
90
+ disabled: channelSelect.disabled,
91
+ };
92
+ }
93
+ static channelSelectToRaw(channelSelect) {
94
+ return {
95
+ type: channelSelect.type,
96
+ id: channelSelect.id,
97
+ custom_id: channelSelect.customId,
98
+ channel_types: channelSelect.channelTypes,
99
+ placeholder: channelSelect.placeholder,
100
+ default_values: channelSelect.defaultValues,
101
+ min_values: channelSelect.minValues,
102
+ max_values: channelSelect.maxValues,
103
+ disabled: channelSelect.disabled,
104
+ };
105
+ }
78
106
  static containerFromRaw(container) {
79
107
  return {
80
108
  type: container.type,
81
109
  id: container.id,
82
110
  components: container.components.map((c) => {
83
111
  switch (c.type) {
84
- case constants_js_1.ComponentTypes.ActionRow: {
112
+ case constants_1.ComponentTypes.ActionRow: {
85
113
  return Components.actionRowFromRaw(c);
86
114
  }
87
- case constants_js_1.ComponentTypes.TextDisplay: {
115
+ case constants_1.ComponentTypes.TextDisplay: {
88
116
  return Components.textDisplayFromRaw(c);
89
117
  }
90
- case constants_js_1.ComponentTypes.Section: {
118
+ case constants_1.ComponentTypes.Section: {
91
119
  return Components.sectionFromRaw(c);
92
120
  }
93
- case constants_js_1.ComponentTypes.MediaGallery: {
121
+ case constants_1.ComponentTypes.MediaGallery: {
94
122
  return Components.mediaGalleryFromRaw(c);
95
123
  }
96
- case constants_js_1.ComponentTypes.File: {
124
+ case constants_1.ComponentTypes.File: {
97
125
  return Components.fileFromRaw(c);
98
126
  }
99
- case constants_js_1.ComponentTypes.Separator: {
127
+ case constants_1.ComponentTypes.Separator: {
100
128
  return Components.separatorFromRaw(c);
101
129
  }
102
130
  }
@@ -111,22 +139,22 @@ class Components {
111
139
  id: container.id,
112
140
  components: container.components.map((c) => {
113
141
  switch (c.type) {
114
- case constants_js_1.ComponentTypes.ActionRow: {
142
+ case constants_1.ComponentTypes.ActionRow: {
115
143
  return Components.actionRowToRaw(c);
116
144
  }
117
- case constants_js_1.ComponentTypes.TextDisplay: {
145
+ case constants_1.ComponentTypes.TextDisplay: {
118
146
  return Components.textDisplayToRaw(c);
119
147
  }
120
- case constants_js_1.ComponentTypes.Section: {
148
+ case constants_1.ComponentTypes.Section: {
121
149
  return Components.sectionToRaw(c);
122
150
  }
123
- case constants_js_1.ComponentTypes.MediaGallery: {
151
+ case constants_1.ComponentTypes.MediaGallery: {
124
152
  return Components.mediaGalleryToRaw(c);
125
153
  }
126
- case constants_js_1.ComponentTypes.File: {
154
+ case constants_1.ComponentTypes.File: {
127
155
  return Components.fileToRaw(c);
128
156
  }
129
- case constants_js_1.ComponentTypes.Separator: {
157
+ case constants_1.ComponentTypes.Separator: {
130
158
  return Components.separatorToRaw(c);
131
159
  }
132
160
  }
@@ -155,6 +183,66 @@ class Components {
155
183
  size: file.size,
156
184
  };
157
185
  }
186
+ static labelFromRaw(label) {
187
+ let component;
188
+ switch (label.component.type) {
189
+ case constants_1.ComponentTypes.TextInput:
190
+ component = Components.textInputFromRaw(label.component);
191
+ break;
192
+ case constants_1.ComponentTypes.StringSelect:
193
+ component = Components.stringSelectFromRaw(label.component);
194
+ break;
195
+ case constants_1.ComponentTypes.UserSelect:
196
+ component = Components.userSelectFromRaw(label.component);
197
+ break;
198
+ case constants_1.ComponentTypes.RoleSelect:
199
+ component = Components.roleSelectFromRaw(label.component);
200
+ break;
201
+ case constants_1.ComponentTypes.MentionableSelect:
202
+ component = Components.mentionableSelectFromRaw(label.component);
203
+ break;
204
+ case constants_1.ComponentTypes.ChannelSelect:
205
+ component = Components.channelSelectFromRaw(label.component);
206
+ break;
207
+ }
208
+ return {
209
+ type: label.type,
210
+ id: label.id,
211
+ label: label.label,
212
+ description: label.description,
213
+ component,
214
+ };
215
+ }
216
+ static labelToRaw(label) {
217
+ let component;
218
+ switch (label.component.type) {
219
+ case constants_1.ComponentTypes.TextInput:
220
+ component = Components.textInputToRaw(label.component);
221
+ break;
222
+ case constants_1.ComponentTypes.StringSelect:
223
+ component = Components.stringSelectToRaw(label.component);
224
+ break;
225
+ case constants_1.ComponentTypes.UserSelect:
226
+ component = Components.userSelectToRaw(label.component);
227
+ break;
228
+ case constants_1.ComponentTypes.RoleSelect:
229
+ component = Components.roleSelectToRaw(label.component);
230
+ break;
231
+ case constants_1.ComponentTypes.MentionableSelect:
232
+ component = Components.mentionableSelectToRaw(label.component);
233
+ break;
234
+ case constants_1.ComponentTypes.ChannelSelect:
235
+ component = Components.channelSelectToRaw(label.component);
236
+ break;
237
+ }
238
+ return {
239
+ type: label.type,
240
+ id: label.id,
241
+ label: label.label,
242
+ description: label.description,
243
+ component,
244
+ };
245
+ }
158
246
  static mediaGalleryFromRaw(mediaGallery) {
159
247
  return {
160
248
  type: mediaGallery.type,
@@ -177,129 +265,97 @@ class Components {
177
265
  })),
178
266
  };
179
267
  }
268
+ static mentionableSelectFromRaw(mentionableSelect) {
269
+ return {
270
+ type: mentionableSelect.type,
271
+ id: mentionableSelect.id,
272
+ customId: mentionableSelect.custom_id,
273
+ placeholder: mentionableSelect.placeholder,
274
+ defaultValues: mentionableSelect.default_values,
275
+ minValues: mentionableSelect.min_values,
276
+ maxValues: mentionableSelect.max_values,
277
+ disabled: mentionableSelect.disabled,
278
+ };
279
+ }
280
+ static mentionableSelectToRaw(mentionableSelect) {
281
+ return {
282
+ type: mentionableSelect.type,
283
+ id: mentionableSelect.id,
284
+ custom_id: mentionableSelect.customId,
285
+ placeholder: mentionableSelect.placeholder,
286
+ default_values: mentionableSelect.defaultValues,
287
+ min_values: mentionableSelect.minValues,
288
+ max_values: mentionableSelect.maxValues,
289
+ disabled: mentionableSelect.disabled,
290
+ };
291
+ }
292
+ static roleSelectFromRaw(roleSelect) {
293
+ return {
294
+ type: roleSelect.type,
295
+ id: roleSelect.id,
296
+ customId: roleSelect.custom_id,
297
+ placeholder: roleSelect.placeholder,
298
+ defaultValues: roleSelect.default_values,
299
+ minValues: roleSelect.min_values,
300
+ maxValues: roleSelect.max_values,
301
+ disabled: roleSelect.disabled,
302
+ };
303
+ }
304
+ static roleSelectToRaw(roleSelect) {
305
+ return {
306
+ type: roleSelect.type,
307
+ id: roleSelect.id,
308
+ custom_id: roleSelect.customId,
309
+ placeholder: roleSelect.placeholder,
310
+ default_values: roleSelect.defaultValues,
311
+ min_values: roleSelect.minValues,
312
+ max_values: roleSelect.maxValues,
313
+ disabled: roleSelect.disabled,
314
+ };
315
+ }
180
316
  static sectionFromRaw(section) {
317
+ let accessory;
318
+ switch (section.accessory.type) {
319
+ case constants_1.ComponentTypes.Button:
320
+ accessory = Components.buttonFromRaw(section.accessory);
321
+ break;
322
+ case constants_1.ComponentTypes.Thumbnail:
323
+ accessory = Components.thumbnailFromRaw(section.accessory);
324
+ break;
325
+ }
181
326
  return {
182
327
  type: section.type,
183
328
  id: section.id,
184
- components: [],
185
- accessory: section.accessory.type === constants_js_1.ComponentTypes.Button
186
- ? Components.buttonFromRaw(section.accessory)
187
- : Components.thumbnailFromRaw(section.accessory),
329
+ components: section.components.map((component) => {
330
+ switch (component.type) {
331
+ case constants_1.ComponentTypes.TextDisplay:
332
+ return Components.textDisplayFromRaw(component);
333
+ }
334
+ }),
335
+ accessory,
188
336
  };
189
337
  }
190
338
  static sectionToRaw(section) {
339
+ let accessory;
340
+ switch (section.accessory.type) {
341
+ case constants_1.ComponentTypes.Button:
342
+ accessory = Components.buttonToRaw(section.accessory);
343
+ break;
344
+ case constants_1.ComponentTypes.Thumbnail:
345
+ accessory = Components.thumbnailToRaw(section.accessory);
346
+ break;
347
+ }
191
348
  return {
192
349
  type: section.type,
193
350
  id: section.id,
194
- components: [],
195
- accessory: section.accessory.type === constants_js_1.ComponentTypes.Button
196
- ? Components.buttonToRaw(section.accessory)
197
- : Components.thumbnailToRaw(section.accessory),
198
- };
199
- }
200
- static selectMenuFromRaw(selectMenu) {
201
- switch (selectMenu.type) {
202
- case constants_js_1.ComponentTypes.ChannelSelect: {
203
- return {
204
- type: selectMenu.type,
205
- customID: selectMenu.custom_id,
206
- channelTypes: selectMenu.channel_types,
207
- placeholder: selectMenu.placeholder,
208
- defaultValues: selectMenu.default_values,
209
- minValues: selectMenu.min_values,
210
- maxValues: selectMenu.max_values,
211
- disabled: selectMenu.disabled,
212
- };
213
- }
214
- case constants_js_1.ComponentTypes.StringSelect: {
215
- return {
216
- type: selectMenu.type,
217
- customID: selectMenu.custom_id,
218
- placeholder: selectMenu.placeholder,
219
- options: selectMenu.options?.map((option) => ({
220
- label: option.label,
221
- value: option.value,
222
- description: option.description,
223
- emoji: option.emoji !== undefined
224
- ? {
225
- name: option.emoji.name,
226
- id: option.emoji.id,
227
- animated: option.emoji.animated,
228
- }
229
- : undefined,
230
- default: option.default,
231
- })),
232
- minValues: selectMenu.min_values,
233
- maxValues: selectMenu.max_values,
234
- disabled: selectMenu.disabled,
235
- };
236
- }
237
- case constants_js_1.ComponentTypes.MentionableSelect:
238
- case constants_js_1.ComponentTypes.RoleSelect:
239
- case constants_js_1.ComponentTypes.UserSelect: {
240
- return {
241
- type: selectMenu.type,
242
- customID: selectMenu.custom_id,
243
- placeholder: selectMenu.placeholder,
244
- defaultValues: selectMenu.default_values,
245
- minValues: selectMenu.min_values,
246
- maxValues: selectMenu.max_values,
247
- disabled: selectMenu.disabled,
248
- };
249
- }
250
- }
251
- }
252
- static selectMenuToRaw(selectMenu) {
253
- switch (selectMenu.type) {
254
- case constants_js_1.ComponentTypes.ChannelSelect: {
255
- return {
256
- type: selectMenu.type,
257
- custom_id: selectMenu.customID,
258
- channel_types: selectMenu.channelTypes,
259
- placeholder: selectMenu.placeholder,
260
- default_values: selectMenu.defaultValues,
261
- min_values: selectMenu.minValues,
262
- max_values: selectMenu.maxValues,
263
- disabled: selectMenu.disabled,
264
- };
265
- }
266
- case constants_js_1.ComponentTypes.StringSelect: {
267
- return {
268
- type: selectMenu.type,
269
- custom_id: selectMenu.customID,
270
- placeholder: selectMenu.placeholder,
271
- options: selectMenu.options?.map((option) => ({
272
- label: option.label,
273
- value: option.value,
274
- description: option.description,
275
- emoji: option.emoji !== undefined
276
- ? {
277
- name: option.emoji.name,
278
- id: option.emoji.id,
279
- animated: option.emoji.animated,
280
- }
281
- : undefined,
282
- default: option.default,
283
- })),
284
- min_values: selectMenu.minValues,
285
- max_values: selectMenu.maxValues,
286
- disabled: selectMenu.disabled,
287
- };
288
- }
289
- case constants_js_1.ComponentTypes.MentionableSelect:
290
- case constants_js_1.ComponentTypes.RoleSelect:
291
- case constants_js_1.ComponentTypes.UserSelect: {
292
- return {
293
- type: selectMenu.type,
294
- custom_id: selectMenu.customID,
295
- placeholder: selectMenu.placeholder,
296
- default_values: selectMenu.defaultValues,
297
- min_values: selectMenu.minValues,
298
- max_values: selectMenu.maxValues,
299
- disabled: selectMenu.disabled,
300
- };
301
- }
302
- }
351
+ components: section.components.map((component) => {
352
+ switch (component.type) {
353
+ case constants_1.ComponentTypes.TextDisplay:
354
+ return Components.textDisplayToRaw(component);
355
+ }
356
+ }),
357
+ accessory,
358
+ };
303
359
  }
304
360
  static separatorFromRaw(separator) {
305
361
  return {
@@ -317,6 +373,53 @@ class Components {
317
373
  spacing: separator.spacing,
318
374
  };
319
375
  }
376
+ static stringSelectFromRaw(stringSelect) {
377
+ return {
378
+ type: stringSelect.type,
379
+ id: stringSelect.id,
380
+ customId: stringSelect.custom_id,
381
+ placeholder: stringSelect.placeholder,
382
+ options: stringSelect.options?.map((option) => ({
383
+ label: option.label,
384
+ value: option.value,
385
+ description: option.description,
386
+ emoji: option.emoji !== undefined
387
+ ? {
388
+ name: option.emoji.name,
389
+ id: option.emoji.id,
390
+ animated: option.emoji.animated,
391
+ }
392
+ : undefined,
393
+ default: option.default,
394
+ })),
395
+ minValues: stringSelect.min_values,
396
+ maxValues: stringSelect.max_values,
397
+ disabled: stringSelect.disabled,
398
+ };
399
+ }
400
+ static stringSelectToRaw(stringSelect) {
401
+ return {
402
+ type: stringSelect.type,
403
+ custom_id: stringSelect.customId,
404
+ placeholder: stringSelect.placeholder,
405
+ options: stringSelect.options?.map((option) => ({
406
+ label: option.label,
407
+ value: option.value,
408
+ description: option.description,
409
+ emoji: option.emoji !== undefined
410
+ ? {
411
+ name: option.emoji.name,
412
+ id: option.emoji.id,
413
+ animated: option.emoji.animated,
414
+ }
415
+ : undefined,
416
+ default: option.default,
417
+ })),
418
+ min_values: stringSelect.minValues,
419
+ max_values: stringSelect.maxValues,
420
+ disabled: stringSelect.disabled,
421
+ };
422
+ }
320
423
  static textDisplayFromRaw(textDisplay) {
321
424
  return {
322
425
  type: textDisplay.type,
@@ -334,29 +437,29 @@ class Components {
334
437
  static textInputFromRaw(textInput) {
335
438
  return {
336
439
  type: textInput.type,
337
- customID: textInput.custom_id,
440
+ customId: textInput.custom_id,
338
441
  style: textInput.style,
339
- label: textInput.label,
340
442
  minLength: textInput.min_length,
341
443
  maxLength: textInput.max_length,
342
444
  required: textInput.required,
343
445
  value: textInput.value,
344
446
  placeholder: textInput.placeholder,
345
447
  id: textInput.id,
448
+ label: textInput.label,
346
449
  };
347
450
  }
348
451
  static textInputToRaw(textInput) {
349
452
  return {
350
453
  type: textInput.type,
351
- custom_id: textInput.customID,
454
+ custom_id: textInput.customId,
352
455
  style: textInput.style,
353
- label: textInput.label,
354
456
  min_length: textInput.minLength,
355
457
  max_length: textInput.maxLength,
356
458
  required: textInput.required,
357
459
  value: textInput.value,
358
460
  placeholder: textInput.placeholder,
359
461
  id: textInput.id,
462
+ label: textInput.label,
360
463
  };
361
464
  }
362
465
  static thumbnailFromRaw(thumbnail) {
@@ -395,5 +498,29 @@ class Components {
395
498
  content_type: unfurledMediaItem.contentType,
396
499
  };
397
500
  }
501
+ static userSelectFromRaw(userSelect) {
502
+ return {
503
+ type: userSelect.type,
504
+ id: userSelect.id,
505
+ customId: userSelect.custom_id,
506
+ placeholder: userSelect.placeholder,
507
+ defaultValues: userSelect.default_values,
508
+ minValues: userSelect.min_values,
509
+ maxValues: userSelect.max_values,
510
+ disabled: userSelect.disabled,
511
+ };
512
+ }
513
+ static userSelectToRaw(userSelect) {
514
+ return {
515
+ type: userSelect.type,
516
+ id: userSelect.id,
517
+ custom_id: userSelect.customId,
518
+ placeholder: userSelect.placeholder,
519
+ default_values: userSelect.defaultValues,
520
+ min_values: userSelect.minValues,
521
+ max_values: userSelect.maxValues,
522
+ disabled: userSelect.disabled,
523
+ };
524
+ }
398
525
  }
399
526
  exports.Components = Components;
@@ -2,6 +2,6 @@ import type { RawEntitlement, Entitlement } from "../types/entitlements";
2
2
  export declare class Entitlements {
3
3
  static entitlementFromRaw(entitlement: RawEntitlement): Entitlement;
4
4
  static entitlementToRaw(entitlement: Entitlement): RawEntitlement;
5
- static testEntitlementFromRaw(entitlement: Omit<RawEntitlement, "starts_at" | "ends_at" | "subscription_id">): Omit<Entitlement, "startsAt" | "endsAt" | "subscriptionID">;
6
- static testEntitlementToRaw(entitlement: Omit<Entitlement, "startsAt" | "endsAt" | "subscriptionID">): Omit<RawEntitlement, "starts_at" | "ends_at" | "subscription_id">;
5
+ static testEntitlementFromRaw(entitlement: Omit<RawEntitlement, "starts_at" | "ends_at" | "subscription_id">): Omit<Entitlement, "startsAt" | "endsAt" | "subscriptionId">;
6
+ static testEntitlementToRaw(entitlement: Omit<Entitlement, "startsAt" | "endsAt" | "subscriptionId">): Omit<RawEntitlement, "starts_at" | "ends_at" | "subscription_id">;
7
7
  }
@@ -5,53 +5,53 @@ class Entitlements {
5
5
  static entitlementFromRaw(entitlement) {
6
6
  return {
7
7
  id: entitlement.id,
8
- skuID: entitlement.sku_id,
9
- applicationID: entitlement.application_id,
10
- userID: entitlement.user_id,
8
+ skuId: entitlement.sku_id,
9
+ applicationId: entitlement.application_id,
10
+ userId: entitlement.user_id,
11
11
  type: entitlement.type,
12
12
  deleted: entitlement.deleted,
13
13
  consumed: entitlement.consumed,
14
14
  startsAt: entitlement.starts_at,
15
15
  endsAt: entitlement.ends_at,
16
- guildID: entitlement.guild_id,
16
+ guildId: entitlement.guild_id,
17
17
  };
18
18
  }
19
19
  static entitlementToRaw(entitlement) {
20
20
  return {
21
21
  id: entitlement.id,
22
- sku_id: entitlement.skuID,
23
- application_id: entitlement.applicationID,
24
- user_id: entitlement.userID,
22
+ sku_id: entitlement.skuId,
23
+ application_id: entitlement.applicationId,
24
+ user_id: entitlement.userId,
25
25
  type: entitlement.type,
26
26
  deleted: entitlement.deleted,
27
27
  consumed: entitlement.consumed,
28
28
  starts_at: entitlement.startsAt,
29
29
  ends_at: entitlement.endsAt,
30
- guild_id: entitlement.guildID,
30
+ guild_id: entitlement.guildId,
31
31
  };
32
32
  }
33
33
  static testEntitlementFromRaw(entitlement) {
34
34
  return {
35
35
  id: entitlement.id,
36
- skuID: entitlement.sku_id,
37
- applicationID: entitlement.application_id,
38
- userID: entitlement.user_id,
36
+ skuId: entitlement.sku_id,
37
+ applicationId: entitlement.application_id,
38
+ userId: entitlement.user_id,
39
39
  type: entitlement.type,
40
40
  deleted: entitlement.deleted,
41
41
  consumed: entitlement.consumed,
42
- guildID: entitlement.guild_id,
42
+ guildId: entitlement.guild_id,
43
43
  };
44
44
  }
45
45
  static testEntitlementToRaw(entitlement) {
46
46
  return {
47
47
  id: entitlement.id,
48
- sku_id: entitlement.skuID,
49
- application_id: entitlement.applicationID,
50
- user_id: entitlement.userID,
48
+ sku_id: entitlement.skuId,
49
+ application_id: entitlement.applicationId,
50
+ user_id: entitlement.userId,
51
51
  type: entitlement.type,
52
52
  deleted: entitlement.deleted,
53
53
  consumed: entitlement.consumed,
54
- guild_id: entitlement.guildID,
54
+ guild_id: entitlement.guildId,
55
55
  };
56
56
  }
57
57
  }