oceanic.js 1.11.3-dev.c3a8425 → 1.11.3-dev.dd63d6e

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.
@@ -40,7 +40,8 @@ import type {
40
40
  ImplementedChannelTypes,
41
41
  ThreadOnlyChannelTypes,
42
42
  ReactionType,
43
- PollLayoutType
43
+ PollLayoutType,
44
+ SeparatorSpacingSize
44
45
  } from "../Constants";
45
46
  import type Member from "../structures/Member";
46
47
  import type AnnouncementChannel from "../structures/AnnouncementChannel";
@@ -298,7 +299,7 @@ export interface CreateMessageOptions {
298
299
  /** An array of [partial attachments](https://discord.com/developers/docs/resources/channel#attachment-object) related to the sent files. */
299
300
  attachments?: Array<MessageAttachment>;
300
301
  /** An array of [components](https://discord.com/developers/docs/interactions/message-components) to send. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util.rawMessageComponents | Util#rawMessageComponents}. */
301
- components?: Array<MessageActionRow>;
302
+ components?: Array<MessageComponent>;
302
303
  /** The content of the message. */
303
304
  content?: string;
304
305
  /** An array of [embeds](https://discord.com/developers/docs/resources/channel#embed-object) to send. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util.rawEmbeds | Util#rawEmbeds}. */
@@ -495,176 +496,6 @@ export interface MessageReference {
495
496
  messageID?: string;
496
497
  }
497
498
 
498
- export type RawComponent = RawMessageComponent | RawModalComponent;
499
- export type RawMessageComponent = RawButtonComponent | RawSelectMenuComponent;
500
- export type RawModalComponent = RawTextInput;
501
- export type RawButtonComponent = RawTextButton | URLButton | RawPremiumButton;
502
- export type RawSelectMenuComponent = RawStringSelectMenu | RawUserSelectMenu | RawRoleSelectMenu | RawMentionableSelectMenu | RawChannelSelectMenu;
503
- export type ToComponentFromRaw<T extends RawComponent> =
504
- T extends RawTextButton ? TextButton :
505
- T extends URLButton ? URLButton :
506
- T extends RawStringSelectMenu ? StringSelectMenu :
507
- T extends RawUserSelectMenu ? UserSelectMenu :
508
- T extends RawRoleSelectMenu ? RoleSelectMenu :
509
- T extends RawMentionableSelectMenu ? MentionableSelectMenu :
510
- T extends RawChannelSelectMenu ? ChannelSelectMenu :
511
- T extends RawTextInput ? TextInput :
512
- never;
513
- export type ToRawFromComponent<T extends Component> =
514
- T extends TextButton ? RawTextButton :
515
- T extends URLButton ? URLButton :
516
- T extends StringSelectMenu ? RawStringSelectMenu :
517
- T extends UserSelectMenu ? RawUserSelectMenu :
518
- T extends RoleSelectMenu ? RawRoleSelectMenu :
519
- T extends MentionableSelectMenu ? RawMentionableSelectMenu :
520
- T extends ChannelSelectMenu ? RawChannelSelectMenu :
521
- T extends TextInput ? RawTextInput :
522
- never;
523
- export interface RawActionRowBase<T extends RawComponent> {
524
- components: Array<T>;
525
- type: ComponentTypes.ACTION_ROW;
526
- }
527
-
528
- export interface RawMessageActionRow extends RawActionRowBase<RawMessageComponent> {}
529
- export interface RawModalActionRow extends RawActionRowBase<RawModalComponent> {}
530
- export type ActionRowToRaw<T extends MessageActionRow | ModalActionRow> =
531
- T extends MessageActionRow ? RawMessageActionRow :
532
- T extends ModalActionRow ? RawModalActionRow : never;
533
-
534
- export type Component = MessageComponent | ModalComponent;
535
- export type MessageComponent = ButtonComponent | SelectMenuComponent;
536
- export type ModalComponent = TextInput;
537
- export type ButtonComponent = TextButton | URLButton | PremiumButton;
538
- export type SelectMenuComponent = StringSelectMenu | UserSelectMenu | RoleSelectMenu | MentionableSelectMenu | ChannelSelectMenu;
539
-
540
- export interface ActionRowBase<T extends Component> {
541
- components: Array<T>;
542
- type: ComponentTypes.ACTION_ROW;
543
- }
544
-
545
- export interface MessageActionRow extends ActionRowBase<MessageComponent> {}
546
- export interface ModalActionRow extends ActionRowBase<ModalComponent> {}
547
-
548
- export interface ButtonBase {
549
- disabled?: boolean;
550
- emoji?: NullablePartialEmoji;
551
- label?: string;
552
- style: ButtonStyles;
553
- type: ComponentTypes.BUTTON;
554
- }
555
-
556
- export interface RawTextButton extends ButtonBase {
557
- custom_id: string;
558
- style: ButtonStyles.PRIMARY | ButtonStyles.SECONDARY | ButtonStyles.SUCCESS | ButtonStyles.DANGER;
559
- }
560
-
561
- export interface TextButton extends ButtonBase {
562
- customID: string;
563
- style: ButtonStyles.PRIMARY | ButtonStyles.SECONDARY | ButtonStyles.SUCCESS | ButtonStyles.DANGER;
564
- }
565
-
566
- export interface URLButton extends ButtonBase {
567
- style: ButtonStyles.LINK;
568
- url: string;
569
- }
570
-
571
- export interface RawPremiumButton extends Omit<ButtonBase, "label" | "emoji"> {
572
- sku_id: string;
573
- style: ButtonStyles.PREMIUM;
574
- }
575
-
576
- export interface PremiumButton extends Omit<ButtonBase, "label" | "emoji"> {
577
- skuID: string;
578
- style: ButtonStyles.PREMIUM;
579
- }
580
-
581
- export interface RawSelectMenuBase<T extends SelectMenuTypes> {
582
- custom_id: string;
583
- disabled?: boolean;
584
- max_values?: number;
585
- min_values?: number;
586
- placeholder?: string;
587
- type: T;
588
- }
589
-
590
- export interface RawStringSelectMenuOptions {
591
- options: Array<SelectOption>;
592
- }
593
-
594
- export interface RawChannelSelectMenuOptions {
595
- channel_types: Array<ChannelTypes>;
596
- }
597
-
598
- export interface RawStringSelectMenu extends RawSelectMenuBase<ComponentTypes.STRING_SELECT>, RawStringSelectMenuOptions {}
599
- export interface RawUserSelectMenu extends RawSelectMenuBase<ComponentTypes.USER_SELECT>, DefaultValuesRaw {}
600
- export interface RawRoleSelectMenu extends RawSelectMenuBase<ComponentTypes.ROLE_SELECT>, DefaultValuesRaw {}
601
- export interface RawMentionableSelectMenu extends RawSelectMenuBase<ComponentTypes.MENTIONABLE_SELECT>, DefaultValuesRaw {}
602
- export interface RawChannelSelectMenu extends RawSelectMenuBase<ComponentTypes.CHANNEL_SELECT>, RawChannelSelectMenuOptions, DefaultValuesRaw {}
603
-
604
-
605
- export interface SelectMenuBase<T extends SelectMenuTypes> {
606
- customID: string;
607
- disabled?: boolean;
608
- maxValues?: number;
609
- minValues?: number;
610
- placeholder?: string;
611
- type: T;
612
- }
613
-
614
- interface DefaultValuesRaw {
615
- default_values?: Array<SelectMenuDefaultValue>;
616
- }
617
-
618
- interface DefaultValues {
619
- defaultValues?: Array<SelectMenuDefaultValue>;
620
- }
621
-
622
- export interface StringSelectMenuOptions {
623
- options: Array<SelectOption>;
624
- }
625
-
626
- export interface ChannelSelectMenuOptions {
627
- channelTypes: Array<ChannelTypes>;
628
- }
629
-
630
- export interface StringSelectMenu extends SelectMenuBase<ComponentTypes.STRING_SELECT>, StringSelectMenuOptions {}
631
- export interface UserSelectMenu extends SelectMenuBase<ComponentTypes.USER_SELECT>, DefaultValues {}
632
- export interface RoleSelectMenu extends SelectMenuBase<ComponentTypes.ROLE_SELECT>, DefaultValues {}
633
- export interface MentionableSelectMenu extends SelectMenuBase<ComponentTypes.MENTIONABLE_SELECT>, DefaultValues {}
634
- export interface ChannelSelectMenu extends SelectMenuBase<ComponentTypes.CHANNEL_SELECT>, ChannelSelectMenuOptions, DefaultValues {}
635
-
636
- export interface SelectOption {
637
- default?: boolean;
638
- description?: string;
639
- emoji?: NullablePartialEmoji;
640
- label: string;
641
- value: string;
642
- }
643
-
644
- export interface RawTextInput {
645
- custom_id: string;
646
- label: string;
647
- max_length?: number;
648
- min_length?: number;
649
- placeholder?: string;
650
- required?: boolean;
651
- style: TextInputStyles;
652
- type: ComponentTypes.TEXT_INPUT;
653
- value?: string;
654
- }
655
-
656
- export interface TextInput {
657
- customID: string;
658
- label: string;
659
- maxLength?: number;
660
- minLength?: number;
661
- placeholder?: string;
662
- required?: boolean;
663
- style: TextInputStyles;
664
- type: ComponentTypes.TEXT_INPUT;
665
- value?: string;
666
- }
667
-
668
499
  export interface RawAttachment {
669
500
  application?: RESTApplication;
670
501
  clip_created_at?: string;
@@ -705,7 +536,7 @@ export interface RawMessage {
705
536
  author: RawUser; // this can be an invalid user if `webhook_id` is set
706
537
  call?: RawCall;
707
538
  channel_id: string;
708
- components?: Array<RawMessageActionRow>;
539
+ components?: Array<RawMessageComponent>;
709
540
  content: string;
710
541
  edited_timestamp: string | null;
711
542
  embeds: Array<RawEmbed>;
@@ -1371,3 +1202,279 @@ export interface MessagePollResults {
1371
1202
  victorAnswerText?: string;
1372
1203
  victorAnswerVotes: number;
1373
1204
  }
1205
+
1206
+ export interface RawTextDisplayComponent extends Omit<TextDisplayComponent, "id"> {}
1207
+ export interface RawThumbnailComponent extends Omit<ThumbnailComponent, "id"> {}
1208
+ export interface RawMediaGalleryComponent extends Omit<MediaGalleryComponent, "id"> {}
1209
+ export interface RawSeparatorComponent extends Omit<SeparatorComponent, "id"> {}
1210
+ export interface RawFileComponent extends Omit<FileComponent, "id"> {}
1211
+
1212
+ export interface RawSectionComponent extends BaseComponent {
1213
+ accessory: RawThumbnailComponent | RawButtonComponent;
1214
+ components: Array<RawTextDisplayComponent>;
1215
+ type: ComponentTypes.SECTION;
1216
+ }
1217
+
1218
+ export type RawComponent = AnyRawMessageComponent | AnyRawModalComponent;
1219
+ export type AnyRawMessageComponent = RawMessageComponent | RawMessageActionRowComponent | RawThumbnailComponent;
1220
+ export type AnyRawModalComponent = RawModalComponent | RawModalActionRowComponent;
1221
+ export type RawMessageActionRowComponent = RawButtonComponent | RawSelectMenuComponent;
1222
+ export type RawMessageComponent = RawMessageActionRow | RawSectionComponent | RawTextDisplayComponent | RawMediaGalleryComponent | RawSeparatorComponent | RawFileComponent | RawContainerComponent;
1223
+ export type RawModalActionRowComponent = RawTextInput;
1224
+ export type RawModalComponent = RawModalActionRow;
1225
+ export type RawButtonComponent = RawTextButton | URLButton | RawPremiumButton;
1226
+ export type RawSelectMenuComponent = RawStringSelectMenu | RawUserSelectMenu | RawRoleSelectMenu | RawMentionableSelectMenu | RawChannelSelectMenu;
1227
+
1228
+ export type ToComponentFromRaw<T extends RawComponent> =
1229
+ T extends RawMessageActionRow ? MessageActionRow :
1230
+ T extends RawModalActionRow ? ModalActionRow :
1231
+ T extends RawTextButton ? TextButton :
1232
+ T extends URLButton ? URLButton :
1233
+ T extends RawStringSelectMenu ? StringSelectMenu :
1234
+ T extends RawUserSelectMenu ? UserSelectMenu :
1235
+ T extends RawRoleSelectMenu ? RoleSelectMenu :
1236
+ T extends RawMentionableSelectMenu ? MentionableSelectMenu :
1237
+ T extends RawChannelSelectMenu ? ChannelSelectMenu :
1238
+ T extends RawTextInput ? TextInput :
1239
+ T extends RawSectionComponent ? SectionComponent :
1240
+ T extends RawTextDisplayComponent ? TextDisplayComponent :
1241
+ T extends RawThumbnailComponent ? ThumbnailComponent :
1242
+ T extends RawMediaGalleryComponent ? MediaGalleryComponent :
1243
+ T extends RawSeparatorComponent ? SeparatorComponent :
1244
+ T extends RawFileComponent ? FileComponent :
1245
+ T extends RawContainerComponent ? ContainerComponent :
1246
+ never;
1247
+ export type ToRawFromComponent<T extends Component> =
1248
+ T extends MessageActionRow ? RawMessageActionRow :
1249
+ T extends ModalActionRow ? RawModalActionRow :
1250
+ T extends TextButton ? RawTextButton :
1251
+ T extends URLButton ? URLButton :
1252
+ T extends StringSelectMenu ? RawStringSelectMenu :
1253
+ T extends UserSelectMenu ? RawUserSelectMenu :
1254
+ T extends RoleSelectMenu ? RawRoleSelectMenu :
1255
+ T extends MentionableSelectMenu ? RawMentionableSelectMenu :
1256
+ T extends ChannelSelectMenu ? RawChannelSelectMenu :
1257
+ T extends TextInput ? RawTextInput :
1258
+ T extends SectionComponent ? RawSectionComponent :
1259
+ T extends TextDisplayComponent ? RawTextDisplayComponent :
1260
+ T extends ThumbnailComponent ? RawThumbnailComponent :
1261
+ T extends MediaGalleryComponent ? RawMediaGalleryComponent :
1262
+ T extends SeparatorComponent ? RawSeparatorComponent :
1263
+ T extends FileComponent ? RawFileComponent :
1264
+ T extends ContainerComponent ? RawContainerComponent :
1265
+ never;
1266
+
1267
+ export interface RawActionRowBase<T extends RawComponent> {
1268
+ components: Array<T>;
1269
+ type: ComponentTypes.ACTION_ROW;
1270
+ }
1271
+
1272
+ export interface RawMessageActionRow extends RawActionRowBase<RawMessageActionRowComponent> {}
1273
+ export interface RawModalActionRow extends RawActionRowBase<RawModalActionRowComponent> {}
1274
+ export type ActionRowToRaw<T extends MessageActionRow | ModalActionRow> =
1275
+ T extends MessageActionRow ? RawMessageActionRow :
1276
+ T extends ModalActionRow ? RawModalActionRow : never;
1277
+
1278
+ export type Component = AnyMessageComponent | AnyModalComponent;
1279
+ export type AnyMessageComponent = MessageComponent | MessageActionRowComponent | ThumbnailComponent;
1280
+ export type AnyModalComponent = ModalComponent | ModalActionRowComponent;
1281
+ export type MessageActionRowComponent = ButtonComponent | SelectMenuComponent;
1282
+ export type MessageComponent = MessageActionRow | SectionComponent | TextDisplayComponent | MediaGalleryComponent | SeparatorComponent | FileComponent | ContainerComponent;
1283
+ export type ModalActionRowComponent = TextInput;
1284
+ export type ModalComponent = ModalActionRow;
1285
+ export type ButtonComponent = TextButton | URLButton | PremiumButton;
1286
+ export type SelectMenuComponent = StringSelectMenu | UserSelectMenu | RoleSelectMenu | MentionableSelectMenu | ChannelSelectMenu;
1287
+
1288
+ export interface BaseComponent {
1289
+ /** Autoincremented number if not provided */
1290
+ id?: number;
1291
+ type: ComponentTypes;
1292
+ }
1293
+
1294
+ export interface ActionRowBase<T extends Component> extends BaseComponent {
1295
+ components: Array<T>;
1296
+ type: ComponentTypes.ACTION_ROW;
1297
+ }
1298
+
1299
+ export interface MessageActionRow extends ActionRowBase<MessageActionRowComponent> {}
1300
+ export interface ModalActionRow extends ActionRowBase<ModalActionRowComponent> {}
1301
+
1302
+ export interface ButtonBase extends BaseComponent {
1303
+ disabled?: boolean;
1304
+ emoji?: NullablePartialEmoji;
1305
+ label?: string;
1306
+ style: ButtonStyles;
1307
+ type: ComponentTypes.BUTTON;
1308
+ }
1309
+
1310
+ export interface RawTextButton extends ButtonBase {
1311
+ custom_id: string;
1312
+ style: ButtonStyles.PRIMARY | ButtonStyles.SECONDARY | ButtonStyles.SUCCESS | ButtonStyles.DANGER;
1313
+ }
1314
+
1315
+ export interface TextButton extends ButtonBase {
1316
+ customID: string;
1317
+ style: ButtonStyles.PRIMARY | ButtonStyles.SECONDARY | ButtonStyles.SUCCESS | ButtonStyles.DANGER;
1318
+ }
1319
+
1320
+ export interface URLButton extends ButtonBase {
1321
+ style: ButtonStyles.LINK;
1322
+ url: string;
1323
+ }
1324
+
1325
+ export interface RawPremiumButton extends Omit<ButtonBase, "label" | "emoji"> {
1326
+ sku_id: string;
1327
+ style: ButtonStyles.PREMIUM;
1328
+ }
1329
+
1330
+ export interface PremiumButton extends Omit<ButtonBase, "label" | "emoji"> {
1331
+ skuID: string;
1332
+ style: ButtonStyles.PREMIUM;
1333
+ }
1334
+
1335
+ export interface RawSelectMenuBase<T extends SelectMenuTypes> {
1336
+ custom_id: string;
1337
+ disabled?: boolean;
1338
+ max_values?: number;
1339
+ min_values?: number;
1340
+ placeholder?: string;
1341
+ type: T;
1342
+ }
1343
+
1344
+ export interface RawStringSelectMenuOptions {
1345
+ options: Array<SelectOption>;
1346
+ }
1347
+
1348
+ export interface RawChannelSelectMenuOptions {
1349
+ channel_types: Array<ChannelTypes>;
1350
+ }
1351
+
1352
+ export interface RawStringSelectMenu extends RawSelectMenuBase<ComponentTypes.STRING_SELECT>, RawStringSelectMenuOptions {}
1353
+ export interface RawUserSelectMenu extends RawSelectMenuBase<ComponentTypes.USER_SELECT>, DefaultValuesRaw {}
1354
+ export interface RawRoleSelectMenu extends RawSelectMenuBase<ComponentTypes.ROLE_SELECT>, DefaultValuesRaw {}
1355
+ export interface RawMentionableSelectMenu extends RawSelectMenuBase<ComponentTypes.MENTIONABLE_SELECT>, DefaultValuesRaw {}
1356
+ export interface RawChannelSelectMenu extends RawSelectMenuBase<ComponentTypes.CHANNEL_SELECT>, RawChannelSelectMenuOptions, DefaultValuesRaw {}
1357
+
1358
+
1359
+ export interface SelectMenuBase<T extends SelectMenuTypes> extends BaseComponent {
1360
+ customID: string;
1361
+ disabled?: boolean;
1362
+ maxValues?: number;
1363
+ minValues?: number;
1364
+ placeholder?: string;
1365
+ type: T;
1366
+ }
1367
+
1368
+ interface DefaultValuesRaw {
1369
+ default_values?: Array<SelectMenuDefaultValue>;
1370
+ }
1371
+
1372
+ interface DefaultValues {
1373
+ defaultValues?: Array<SelectMenuDefaultValue>;
1374
+ }
1375
+
1376
+ export interface StringSelectMenuOptions {
1377
+ options: Array<SelectOption>;
1378
+ }
1379
+
1380
+ export interface ChannelSelectMenuOptions {
1381
+ channelTypes: Array<ChannelTypes>;
1382
+ }
1383
+
1384
+ export interface StringSelectMenu extends SelectMenuBase<ComponentTypes.STRING_SELECT>, StringSelectMenuOptions {}
1385
+ export interface UserSelectMenu extends SelectMenuBase<ComponentTypes.USER_SELECT>, DefaultValues {}
1386
+ export interface RoleSelectMenu extends SelectMenuBase<ComponentTypes.ROLE_SELECT>, DefaultValues {}
1387
+ export interface MentionableSelectMenu extends SelectMenuBase<ComponentTypes.MENTIONABLE_SELECT>, DefaultValues {}
1388
+ export interface ChannelSelectMenu extends SelectMenuBase<ComponentTypes.CHANNEL_SELECT>, ChannelSelectMenuOptions, DefaultValues {}
1389
+
1390
+ export interface SelectOption {
1391
+ default?: boolean;
1392
+ description?: string;
1393
+ emoji?: NullablePartialEmoji;
1394
+ label: string;
1395
+ value: string;
1396
+ }
1397
+
1398
+ export interface RawTextInput {
1399
+ custom_id: string;
1400
+ label: string;
1401
+ max_length?: number;
1402
+ min_length?: number;
1403
+ placeholder?: string;
1404
+ required?: boolean;
1405
+ style: TextInputStyles;
1406
+ type: ComponentTypes.TEXT_INPUT;
1407
+ value?: string;
1408
+ }
1409
+
1410
+ export interface TextInput extends BaseComponent {
1411
+ customID: string;
1412
+ label: string;
1413
+ maxLength?: number;
1414
+ minLength?: number;
1415
+ placeholder?: string;
1416
+ required?: boolean;
1417
+ style: TextInputStyles;
1418
+ type: ComponentTypes.TEXT_INPUT;
1419
+ value?: string;
1420
+ }
1421
+
1422
+ export interface UnfurledMediaItem {
1423
+ url: string;
1424
+ }
1425
+
1426
+ export interface SectionComponent extends BaseComponent {
1427
+ accessory: ThumbnailComponent | ButtonComponent;
1428
+ components: Array<TextDisplayComponent>;
1429
+ type: ComponentTypes.SECTION;
1430
+ }
1431
+
1432
+ export interface TextDisplayComponent extends BaseComponent {
1433
+ content: string;
1434
+ type: ComponentTypes.TEXT_DISPLAY;
1435
+ }
1436
+
1437
+ export interface ThumbnailComponent extends BaseComponent {
1438
+ description?: string;
1439
+ media: UnfurledMediaItem;
1440
+ spoiler?: boolean;
1441
+ type: ComponentTypes.THUMBNAIL;
1442
+ }
1443
+
1444
+ export interface MediaGalleryItem {
1445
+ description?: string;
1446
+ media: UnfurledMediaItem;
1447
+ spoiler?: boolean;
1448
+ }
1449
+
1450
+ export interface MediaGalleryComponent extends BaseComponent {
1451
+ items: Array<MediaGalleryItem>;
1452
+ type: ComponentTypes.MEDIA_GALLERY;
1453
+ }
1454
+
1455
+ export interface SeparatorComponent extends BaseComponent {
1456
+ divider?: boolean;
1457
+ spacing?: SeparatorSpacingSize;
1458
+ type: ComponentTypes.SEPARATOR;
1459
+ }
1460
+
1461
+ export interface FileComponent extends BaseComponent {
1462
+ // The UnfurledMediaItem ONLY supports attachment://<filename> references
1463
+ file: UnfurledMediaItem;
1464
+ spoiler?: boolean;
1465
+ type: ComponentTypes.FILE;
1466
+ }
1467
+
1468
+ export interface ContainerComponent extends BaseComponent {
1469
+ accentColor?: number;
1470
+ components: Array<MessageActionRow | TextDisplayComponent | SectionComponent | MediaGalleryComponent | SeparatorComponent | FileComponent>;
1471
+ spoiler?: boolean;
1472
+ type: ComponentTypes.CONTAINER;
1473
+ }
1474
+
1475
+ export interface RawContainerComponent extends Omit<BaseComponent, "id"> {
1476
+ accent_color?: number;
1477
+ components: Array<RawMessageActionRow | RawTextDisplayComponent | RawSectionComponent | RawMediaGalleryComponent | RawSeparatorComponent | RawFileComponent>;
1478
+ spoiler?: boolean;
1479
+ type: ComponentTypes.CONTAINER;
1480
+ }
@@ -29,7 +29,7 @@ interface GatewayOptions {
29
29
  * @note `true` is the same as `zlib-stream`. This behavior is deprecated.
30
30
  * @defaultValue false
31
31
  */
32
- compress?: boolean | "zlib-stream" | "zstd-stream";
32
+ compress?: boolean | "zlib-stream"; // | "zstd-stream";
33
33
  /**
34
34
  * The concurrency for shard connections. If you don't know what this is, don't mess with it. Only bots in >150,000 servers can use any non-default value.
35
35
  * @defaultValue 1
@@ -166,7 +166,7 @@ export interface OverrideOptions {
166
166
  }
167
167
 
168
168
  export interface ShardManagerInstanceOptions extends Required<Omit<GatewayOptions, "concurrency" | "connectionProperties" | "intents" | "maxShards" | "presence" | "dispatcher" | "compress">> {
169
- compress: false | "zlib-stream" | "zstd-stream";
169
+ compress: false | "zlib-stream"; // | "zstd-stream";
170
170
  concurrency: number;
171
171
  connectionProperties: Required<GatewayOptions["connectionProperties"]>;
172
172
  dispatcher: DispatcherInstanceOptions;
@@ -3,11 +3,11 @@ import type { EditWebhookMessageOptions, ExecuteWebhookOptions } from "./webhook
3
3
  import type {
4
4
  AnyTextableGuildChannel,
5
5
  AnyPrivateChannel,
6
- ModalActionRow,
7
6
  RawAttachment,
8
7
  RawInteractionResolvedChannel,
9
8
  RawMessage,
10
- AnyInteractionChannel
9
+ AnyInteractionChannel,
10
+ ModalComponent
11
11
  } from "./channels";
12
12
  import type { InteractionMember, RawMember, RawRole } from "./guilds";
13
13
  import type { RawUser } from "./users";
@@ -47,7 +47,6 @@ import type ModalSubmitInteractionComponentsWrapper from "../util/interactions/M
47
47
 
48
48
  export interface InteractionContent extends Pick<ExecuteWebhookOptions, "tts" | "content" | "embeds" | "allowedMentions" | "flags" | "components" | "attachments" | "files" | "poll"> {}
49
49
  export interface EditInteractionContent extends Pick<EditWebhookMessageOptions, "content" | "embeds" | "allowedMentions" | "components" | "attachments" | "files" | "poll"> {}
50
- export interface InitialInteractionContent extends Omit<InteractionContent, "attachments" | "files"> {}
51
50
 
52
51
  export type InteractionResponse = PingInteractionResponse | MessageInteractionResponse | DeferredInteractionResponse | AutocompleteInteractionResponse | ModalSubmitInteractionResponse | PremiumRequiredResponse | LaunchActivityResponse;
53
52
  export interface PingInteractionResponse {
@@ -89,7 +88,7 @@ export interface LaunchActivityResponse {
89
88
 
90
89
  export interface ModalData {
91
90
  /** The components of the modal. Each component needs its own row. `snake_case` keys should be converted to `camelCase`, or passed through {@link Util.rawModalComponents | Util#rawModalComponents}. */
92
- components: Array<ModalActionRow>;
91
+ components: Array<ModalComponent>;
93
92
  /** The custom ID of the modal. */
94
93
  customID: string;
95
94
  /** The title of the modal. */
@@ -33,7 +33,6 @@ import type {
33
33
  PrivateThreadMetadata,
34
34
  ForumTag,
35
35
  ForumEmoji,
36
- MessageActionRow,
37
36
  Embed,
38
37
  GuildChannels,
39
38
  TextableGuildChannels,
@@ -43,7 +42,8 @@ import type {
43
42
  PollQuestion,
44
43
  PollResults,
45
44
  PollAnswer,
46
- MessagePollResults
45
+ MessagePollResults,
46
+ MessageComponent
47
47
  } from "./channels";
48
48
  import type { ScheduledEventEntityMetadata } from "./scheduled-events";
49
49
  import type { AvatarDecorationData } from "./users";
@@ -464,7 +464,7 @@ export interface JSONMessage extends JSONBase {
464
464
  attachments: Array<JSONAttachment>;
465
465
  author: JSONUser;
466
466
  channelID: string;
467
- components?: Array<MessageActionRow>;
467
+ components?: Array<MessageComponent>;
468
468
  content: string;
469
469
  editedTimestamp: number | null;
470
470
  embeds: Array<Embed>;
@@ -58,6 +58,7 @@ export interface ExecuteWebhookOptions extends Pick<CreateMessageOptions, "conte
58
58
  username?: string;
59
59
  /** If the created message should be returned. */
60
60
  wait?: boolean;
61
+ withComponents?: boolean;
61
62
  }
62
63
  export interface ExecuteWebhookWaitOptions extends Omit<ExecuteWebhookOptions, "wait"> { wait: true; }
63
64
 
@@ -32,3 +32,7 @@ export declare class RateLimitedError extends Error {
32
32
  name: string;
33
33
  constructor(message: string, delay: number);
34
34
  }
35
+ export declare class NotImplementedError extends Error {
36
+ name: string;
37
+ constructor(message?: string);
38
+ }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /** @module Errors */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.RateLimitedError = exports.GatewayError = exports.DependencyError = exports.WrapperError = exports.UncachedError = exports.UncaughtError = void 0;
4
+ exports.NotImplementedError = exports.RateLimitedError = exports.GatewayError = exports.DependencyError = exports.WrapperError = exports.UncachedError = exports.UncaughtError = void 0;
5
5
  /** An error that is thrown when we encounter an error, and no `error` listeners are present. */
6
6
  class UncaughtError extends Error {
7
7
  name = "UncaughtError";
@@ -62,4 +62,11 @@ class RateLimitedError extends Error {
62
62
  }
63
63
  }
64
64
  exports.RateLimitedError = RateLimitedError;
65
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3V0aWwvRXJyb3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxxQkFBcUI7OztBQU1yQixnR0FBZ0c7QUFDaEcsTUFBYSxhQUFjLFNBQVEsS0FBSztJQUMzQixJQUFJLEdBQUcsZUFBZSxDQUFDO0lBQ2hDLFlBQVksS0FBcUI7UUFDN0IsS0FBSyxDQUFDLHdCQUF3QixFQUFFLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRSxDQUFDLENBQUM7SUFDdEQsQ0FBQztDQUNKO0FBTEQsc0NBS0M7QUFFRCxzRUFBc0U7QUFDdEUsTUFBYSxhQUFjLFNBQVEsS0FBSztJQUMzQixJQUFJLEdBQUcsZUFBZSxDQUFDO0lBQ2hDLDRGQUE0RjtJQUM1RixZQUFZLEdBQUcsSUFBaUc7UUFDNUcsSUFBSSxPQUFlLENBQUM7UUFDcEIsSUFBSSxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRSxDQUFDO1lBQ3BCLENBQUMsT0FBTyxDQUFDLEdBQUcsSUFBSSxDQUFDO1FBQ3JCLENBQUM7YUFBTSxDQUFDO1lBQ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0o7QUFQRCxvQ0FPQztBQUVELE1BQWEsZ0JBQWlCLFNBQVEsS0FBSztJQUN2QyxLQUFLLENBQVM7SUFDTCxJQUFJLEdBQUcsa0JBQWtCLENBQUM7SUFDbkMsWUFBWSxPQUFlLEVBQUUsS0FBYTtRQUN0QyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDZixJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQztJQUN2QixDQUFDO0NBQ0o7QUFQRCw0Q0FPQyJ9
65
+ class NotImplementedError extends Error {
66
+ name = "NotImplementedError";
67
+ constructor(message = "Not implemented") {
68
+ super(message);
69
+ }
70
+ }
71
+ exports.NotImplementedError = NotImplementedError;
72
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vbGliL3V0aWwvRXJyb3JzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxxQkFBcUI7OztBQU1yQixnR0FBZ0c7QUFDaEcsTUFBYSxhQUFjLFNBQVEsS0FBSztJQUMzQixJQUFJLEdBQUcsZUFBZSxDQUFDO0lBQ2hDLFlBQVksS0FBcUI7UUFDN0IsS0FBSyxDQUFDLHdCQUF3QixFQUFFLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRSxDQUFDLENBQUM7SUFDdEQsQ0FBQztDQUNKO0FBTEQsc0NBS0M7QUFFRCxzRUFBc0U7QUFDdEUsTUFBYSxhQUFjLFNBQVEsS0FBSztJQUMzQixJQUFJLEdBQUcsZUFBZSxDQUFDO0lBQ2hDLDRGQUE0RjtJQUM1RixZQUFZLEdBQUcsSUFBaUc7UUFDNUcsSUFBSSxPQUFlLENBQUM7UUFDcEIsSUFBSSxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsRUFBRSxDQUFDO1lBQ3BCLENBQUMsT0FBTyxDQUFDLEd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JLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztJQUNyQixDQUFDO0NBQ0o7QUFQRCxvQ0FPQztBQUVELE1BQWEsZ0JBQWlCLFNBQVEsS0FBSztJQUN2QyxLQUFLLENBQVM7SUFDTCxJQUFJLEdBQUcsa0JBQWtCLENBQUM7SUFDbkMsWUFBWSxPQUFlLEVBQUUsS0FBYTtRQUN0QyxLQUFLLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDZixJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssQ0FBQztJQUN2QixDQUFDO0NBQ0o7QUFQRCw0Q0FPQztBQUVELE1BQWEsbUJBQW9CLFNBQVEsS0FBSztJQUNqQyxJQUFJLEdBQUcscUJBQXFCLENBQUM7SUFDdEMsWUFBWSxPQUFPLEdBQUcsaUJBQWlCO1FBQ25DLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztJQUNuQixDQUFDO0NBQ0o7QUFMRCxrREFLQyJ9
@@ -2,11 +2,11 @@
2
2
  /// <reference types="node" />
3
3
  import type Client from "../Client";
4
4
  import { type ImageFormat, type PrivilegedIntentNames } from "../Constants";
5
- import type { AllowedMentions, AnyChannel, AnyThreadChannel, Component, Embed, EmbedOptions, MessageActionRow, ModalActionRow, RawAllowedMentions, RawChannel, RawComponent, RawEmbed, RawEmbedOptions, RawMessageActionRow, RawModalActionRow, RawThreadChannel, ToComponentFromRaw, ToRawFromComponent } from "../types/channels";
5
+ import type { AllowedMentions, AnyChannel, AnyThreadChannel, Component, Embed, EmbedOptions, ModalActionRow, RawAllowedMentions, RawChannel, RawComponent, RawEmbed, RawEmbedOptions, RawModalActionRow, RawThreadChannel, ToComponentFromRaw, ToRawFromComponent } from "../types/channels";
6
6
  import type { RawMember, RawSticker, RESTMember, Sticker } from "../types/guilds";
7
7
  import type { ApplicationCommandOptions, RawApplicationCommandOption } from "../types/applications";
8
8
  import Member from "../structures/Member";
9
- import type { AnyTextableChannel, CollectionLimitsOptions, GuildEmoji, ModalSubmitComponentsActionRow, RawGuildEmoji, RawMessage, RawModalSubmitComponents, RawModalSubmitComponentsActionRow, ToModalSubmitComponentFromRaw, Uncached, RawBaseEntitlement, ApplicationEmoji, RawApplicationEmoji } from "../types";
9
+ import type { AnyTextableChannel, CollectionLimitsOptions, GuildEmoji, ModalSubmitComponentsActionRow, RawGuildEmoji, RawMessage, RawModalSubmitComponents, RawModalSubmitComponentsActionRow, ToModalSubmitComponentFromRaw, Uncached, RawBaseEntitlement, ApplicationEmoji, RawApplicationEmoji, MessageComponent, ModalComponent, RawMessageComponent, RawModalComponent } from "../types";
10
10
  import Message from "../structures/Message";
11
11
  import Entitlement from "../structures/Entitlement";
12
12
  import TestEntitlement from "../structures/TestEntitlement";
@@ -17,8 +17,8 @@ export default class Util {
17
17
  constructor(client: Client);
18
18
  static rawEmbeds(embeds: RawEmbed): Embed;
19
19
  static rawEmbeds(embeds: Array<RawEmbed>): Array<Embed>;
20
- static rawMessageComponents(components: RawMessageActionRow): MessageActionRow;
21
- static rawMessageComponents(components: Array<RawMessageActionRow>): Array<MessageActionRow>;
20
+ static rawMessageComponents(components: RawMessageComponent): MessageComponent;
21
+ static rawMessageComponents(components: Array<RawMessageComponent>): Array<MessageComponent>;
22
22
  static rawModalComponents(components: RawModalActionRow): ModalActionRow;
23
23
  static rawModalComponents(components: Array<RawModalActionRow>): Array<ModalActionRow>;
24
24
  /** @hidden intentionally not documented - this is an internal function */
@@ -32,8 +32,8 @@ export default class Util {
32
32
  _setLimit(values?: Record<string, number> | number, defaultValue?: number): Record<string, number> | number;
33
33
  componentToParsed<T extends RawComponent>(component: T): ToComponentFromRaw<T>;
34
34
  componentToRaw<T extends Component>(component: T): ToRawFromComponent<T>;
35
- componentsToParsed<T extends RawModalActionRow | RawMessageActionRow>(components: Array<T>): T extends RawModalActionRow ? Array<ModalActionRow> : T extends RawMessageActionRow ? Array<MessageActionRow> : never;
36
- componentsToRaw<T extends ModalActionRow | MessageActionRow>(components: Array<T>): T extends ModalActionRow ? Array<RawModalActionRow> : T extends MessageActionRow ? Array<RawMessageActionRow> : never;
35
+ componentsToParsed<T extends RawMessageComponent | RawModalComponent>(components: Array<T>): Array<T extends RawMessageComponent ? MessageComponent : T extends RawModalComponent ? ModalComponent : never>;
36
+ componentsToRaw<T extends MessageComponent | ModalComponent>(components: Array<T>): Array<T extends MessageComponent ? RawMessageComponent : T extends ModalComponent ? RawModalComponent : never>;
37
37
  convertApplicationEmoji(raw: RawApplicationEmoji): ApplicationEmoji;
38
38
  convertGuildEmoji(raw: RawGuildEmoji): GuildEmoji;
39
39
  convertImage(img: Buffer | string): string;