oceanic.js 1.11.3-dev.eb72695 → 1.12.0
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/README.md +0 -1
- package/dist/lib/Client.js +3 -1
- package/dist/lib/Constants.d.ts +68 -11
- package/dist/lib/Constants.js +78 -8
- package/dist/lib/gateway/Shard.d.ts +4 -1
- package/dist/lib/gateway/Shard.js +27 -7
- package/dist/lib/gateway/ShardManager.js +2 -2
- package/dist/lib/gateway/compression/base.d.ts +1 -0
- package/dist/lib/gateway/compression/pako.d.ts +1 -0
- package/dist/lib/gateway/compression/zlib-sync.d.ts +1 -0
- package/dist/lib/gateway/compression/zlib-sync.js +2 -2
- package/dist/lib/gateway/compression/zstd.d.ts +2 -5
- package/dist/lib/gateway/compression/zstd.js +5 -18
- package/dist/lib/gateway/events.d.ts +5 -0
- package/dist/lib/gateway/events.js +47 -4
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +4 -2
- package/dist/lib/rest/RequestHandler.js +2 -2
- package/dist/lib/routes/Applications.d.ts +20 -1
- package/dist/lib/routes/Applications.js +66 -4
- package/dist/lib/routes/Channels.d.ts +9 -1
- package/dist/lib/routes/Channels.js +21 -4
- package/dist/lib/routes/Guilds.d.ts +43 -1
- package/dist/lib/routes/Guilds.js +91 -2
- package/dist/lib/routes/Interactions.d.ts +5 -3
- package/dist/lib/routes/Interactions.js +35 -11
- package/dist/lib/routes/Miscellaneous.d.ts +6 -0
- package/dist/lib/routes/Miscellaneous.js +12 -1
- package/dist/lib/routes/Webhooks.js +14 -2
- package/dist/lib/structures/Application.d.ts +7 -1
- package/dist/lib/structures/Application.js +10 -1
- package/dist/lib/structures/ApplicationCommand.d.ts +3 -1
- package/dist/lib/structures/ApplicationCommand.js +5 -1
- package/dist/lib/structures/Attachment.d.ts +8 -0
- package/dist/lib/structures/Attachment.js +11 -1
- package/dist/lib/structures/AutocompleteInteraction.d.ts +4 -2
- package/dist/lib/structures/AutocompleteInteraction.js +6 -2
- package/dist/lib/structures/ClientApplication.d.ts +6 -1
- package/dist/lib/structures/ClientApplication.js +8 -1
- package/dist/lib/structures/CommandInteraction.d.ts +17 -12
- package/dist/lib/structures/CommandInteraction.js +30 -23
- package/dist/lib/structures/ComponentInteraction.d.ts +17 -14
- package/dist/lib/structures/ComponentInteraction.js +28 -25
- package/dist/lib/structures/Entitlement.d.ts +2 -2
- package/dist/lib/structures/Entitlement.js +5 -5
- package/dist/lib/structures/Guild.d.ts +32 -2
- package/dist/lib/structures/Guild.js +41 -1
- package/dist/lib/structures/Invite.d.ts +3 -1
- package/dist/lib/structures/Invite.js +4 -1
- package/dist/lib/structures/Message.d.ts +3 -3
- package/dist/lib/structures/Message.js +25 -16
- package/dist/lib/structures/ModalSubmitInteraction.d.ts +16 -13
- package/dist/lib/structures/ModalSubmitInteraction.js +26 -18
- package/dist/lib/structures/PingInteraction.d.ts +2 -2
- package/dist/lib/structures/PingInteraction.js +2 -2
- package/dist/lib/structures/Soundboard.d.ts +42 -0
- package/dist/lib/structures/Soundboard.js +73 -0
- package/dist/lib/structures/Subscription.d.ts +25 -0
- package/dist/lib/structures/Subscription.js +38 -0
- package/dist/lib/structures/User.d.ts +0 -5
- package/dist/lib/structures/User.js +1 -7
- package/dist/lib/types/applications.d.ts +89 -8
- package/dist/lib/types/channels.d.ts +354 -189
- package/dist/lib/types/client.d.ts +9 -4
- package/dist/lib/types/events.d.ts +15 -3
- package/dist/lib/types/gateway-raw.d.ts +39 -3
- package/dist/lib/types/gateway.d.ts +10 -2
- package/dist/lib/types/guilds.d.ts +28 -0
- package/dist/lib/types/interactions.d.ts +65 -7
- package/dist/lib/types/json.d.ts +27 -6
- package/dist/lib/types/webhooks.d.ts +6 -2
- package/dist/lib/util/Errors.d.ts +4 -0
- package/dist/lib/util/Errors.js +9 -2
- package/dist/lib/util/Routes.d.ts +7 -2
- package/dist/lib/util/Routes.js +18 -8
- package/dist/lib/util/Util.d.ts +10 -6
- package/dist/lib/util/Util.js +99 -12
- package/dist/lib/util/interactions/MessageInteractionResponse.d.ts +5 -2
- package/dist/lib/util/interactions/MessageInteractionResponse.js +9 -7
- package/dist/package.json +19 -19
- package/esm.mjs +2 -0
- package/package.json +18 -19
- package/patches/typedoc-plugin-merge-modules@5.1.0.patch +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
/** @module Types/Channels */
|
2
2
|
import type { NullablePartialEmoji, PartialEmoji, RawInviteGuild, RawMember } from "./guilds";
|
3
|
-
import type { RawApplication, RawPartialApplication } from "./applications";
|
3
|
+
import type { RESTApplication, RawApplication, RawPartialApplication } from "./applications";
|
4
4
|
import type { RawUser, RawUserWithMember } from "./users";
|
5
5
|
import type { File } from "./request-handler";
|
6
6
|
import type { RawScheduledEvent } from "./scheduled-events";
|
@@ -40,7 +40,9 @@ import type {
|
|
40
40
|
ImplementedChannelTypes,
|
41
41
|
ThreadOnlyChannelTypes,
|
42
42
|
ReactionType,
|
43
|
-
PollLayoutType
|
43
|
+
PollLayoutType,
|
44
|
+
SeparatorSpacingSize,
|
45
|
+
InviteTypes
|
44
46
|
} from "../Constants";
|
45
47
|
import type Member from "../structures/Member";
|
46
48
|
import type AnnouncementChannel from "../structures/AnnouncementChannel";
|
@@ -297,8 +299,8 @@ export interface CreateMessageOptions {
|
|
297
299
|
allowedMentions?: AllowedMentions;
|
298
300
|
/** An array of [partial attachments](https://discord.com/developers/docs/resources/channel#attachment-object) related to the sent files. */
|
299
301
|
attachments?: Array<MessageAttachment>;
|
300
|
-
/** 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<
|
302
|
+
/** 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}. Note that the {@link Contents~MessageFlags.IS_COMPONENTS_V2 | IS_COMPONENTS_V2} flag must be provided to use any of the v2 components, and with this enabled `content`, `embeds`, and `stickerIDs` cannot be used. */
|
303
|
+
components?: Array<MessageComponent>;
|
302
304
|
/** The content of the message. */
|
303
305
|
content?: string;
|
304
306
|
/** 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}. */
|
@@ -307,7 +309,7 @@ export interface CreateMessageOptions {
|
|
307
309
|
enforceNonce?: boolean;
|
308
310
|
/** The files to send. */
|
309
311
|
files?: Array<File>;
|
310
|
-
/** The
|
312
|
+
/** The {@link Constants.MessageFlags | Message Flags} to send with the message. */
|
311
313
|
flags?: number;
|
312
314
|
/** Reply to a message. */
|
313
315
|
messageReference?: MessageReference;
|
@@ -355,6 +357,8 @@ export interface EmbedBase extends EmbedOptionsBase {
|
|
355
357
|
export interface RawEmbed extends EmbedBase {
|
356
358
|
author?: RawEmbedAuthor;
|
357
359
|
fields?: Array<EmbedField>;
|
360
|
+
/** The {@link Constants.EmbedFlags | Embed Flags} for the embed. */
|
361
|
+
flags?: number;
|
358
362
|
footer?: RawEmbedFooter;
|
359
363
|
image?: RawEmbedImage;
|
360
364
|
provider?: EmbedProvider;
|
@@ -365,6 +369,8 @@ export interface RawEmbed extends EmbedBase {
|
|
365
369
|
export interface Embed extends EmbedBase {
|
366
370
|
author?: EmbedAuthor;
|
367
371
|
fields?: Array<EmbedField>;
|
372
|
+
/** The {@link Constants.EmbedFlags | Embed Flags} for the embed. */
|
373
|
+
flags?: number;
|
368
374
|
footer?: EmbedFooter;
|
369
375
|
image?: EmbedImage;
|
370
376
|
provider?: EmbedProvider;
|
@@ -384,36 +390,41 @@ export interface RawEmbedAuthor extends EmbedAuthorBase {
|
|
384
390
|
proxy_icon_url?: string;
|
385
391
|
}
|
386
392
|
|
387
|
-
export interface
|
393
|
+
export interface EmbedAuthor extends EmbedAuthorOptions {
|
388
394
|
iconURL?: string;
|
395
|
+
proxyIconURL?: string;
|
389
396
|
}
|
390
397
|
|
391
398
|
export interface RawEmbedAuthorOptions extends EmbedAuthorBase {
|
392
399
|
icon_url?: string;
|
393
400
|
}
|
394
401
|
|
395
|
-
export interface
|
402
|
+
export interface EmbedAuthorOptions extends EmbedAuthorBase {
|
396
403
|
iconURL?: string;
|
397
|
-
proxyIconURL?: string;
|
398
404
|
}
|
405
|
+
|
399
406
|
export interface EmbedFooterBase {
|
400
407
|
text: string;
|
401
408
|
}
|
402
409
|
|
403
|
-
export interface EmbedFooterOptions extends EmbedFooterBase {
|
404
|
-
iconURL?: string;
|
405
|
-
}
|
406
|
-
|
407
410
|
export interface RawEmbedFooterOptions extends EmbedFooterBase {
|
408
411
|
icon_url?: string;
|
409
412
|
}
|
410
413
|
|
414
|
+
export interface EmbedFooterOptions extends EmbedFooterBase {
|
415
|
+
iconURL?: string;
|
416
|
+
}
|
417
|
+
|
411
418
|
export interface RawEmbedFooter extends EmbedFooterBase {
|
419
|
+
/** The {@link Constants~EmbedMediaFlags | Embed Media Flags} for the media. */
|
420
|
+
flags?: number;
|
412
421
|
icon_url?: string;
|
413
422
|
proxy_icon_url?: string;
|
414
423
|
}
|
415
424
|
|
416
425
|
export interface EmbedFooter extends EmbedFooterOptions {
|
426
|
+
/** The {@link Constants~EmbedMediaFlags | Embed Media Flags} for the media. */
|
427
|
+
flags?: number;
|
417
428
|
iconURL?: string;
|
418
429
|
proxyIconURL?: string;
|
419
430
|
}
|
@@ -424,17 +435,21 @@ export interface EmbedImageBase {
|
|
424
435
|
}
|
425
436
|
|
426
437
|
export interface RawEmbedImage extends EmbedImageBase, EmbedImageOptions {
|
438
|
+
/** The {@link Constants~EmbedMediaFlags | Embed Media Flags} for the media. */
|
439
|
+
flags?: number;
|
427
440
|
proxy_url?: string;
|
428
441
|
}
|
429
442
|
|
430
|
-
export interface EmbedImageOptions {
|
431
|
-
url: string;
|
432
|
-
}
|
433
|
-
|
434
443
|
export interface EmbedImage extends EmbedImageBase, EmbedImageOptions {
|
444
|
+
/** The {@link Constants~EmbedMediaFlags | Embed Media Flags} for the media. */
|
445
|
+
flags?: number;
|
435
446
|
proxyURL?: string;
|
436
447
|
}
|
437
448
|
|
449
|
+
export interface EmbedImageOptions {
|
450
|
+
url: string;
|
451
|
+
}
|
452
|
+
|
438
453
|
export interface EmbedField {
|
439
454
|
inline?: boolean;
|
440
455
|
name: string;
|
@@ -482,177 +497,10 @@ export interface MessageReference {
|
|
482
497
|
messageID?: string;
|
483
498
|
}
|
484
499
|
|
485
|
-
export type RawComponent = RawMessageComponent | RawModalComponent;
|
486
|
-
export type RawMessageComponent = RawButtonComponent | RawSelectMenuComponent;
|
487
|
-
export type RawModalComponent = RawTextInput;
|
488
|
-
export type RawButtonComponent = RawTextButton | URLButton | RawPremiumButton;
|
489
|
-
export type RawSelectMenuComponent = RawStringSelectMenu | RawUserSelectMenu | RawRoleSelectMenu | RawMentionableSelectMenu | RawChannelSelectMenu;
|
490
|
-
export type ToComponentFromRaw<T extends RawComponent> =
|
491
|
-
T extends RawTextButton ? TextButton :
|
492
|
-
T extends URLButton ? URLButton :
|
493
|
-
T extends RawStringSelectMenu ? StringSelectMenu :
|
494
|
-
T extends RawUserSelectMenu ? UserSelectMenu :
|
495
|
-
T extends RawRoleSelectMenu ? RoleSelectMenu :
|
496
|
-
T extends RawMentionableSelectMenu ? MentionableSelectMenu :
|
497
|
-
T extends RawChannelSelectMenu ? ChannelSelectMenu :
|
498
|
-
T extends RawTextInput ? TextInput :
|
499
|
-
never;
|
500
|
-
export type ToRawFromComponent<T extends Component> =
|
501
|
-
T extends TextButton ? RawTextButton :
|
502
|
-
T extends URLButton ? URLButton :
|
503
|
-
T extends StringSelectMenu ? RawStringSelectMenu :
|
504
|
-
T extends UserSelectMenu ? RawUserSelectMenu :
|
505
|
-
T extends RoleSelectMenu ? RawRoleSelectMenu :
|
506
|
-
T extends MentionableSelectMenu ? RawMentionableSelectMenu :
|
507
|
-
T extends ChannelSelectMenu ? RawChannelSelectMenu :
|
508
|
-
T extends TextInput ? RawTextInput :
|
509
|
-
never;
|
510
|
-
export interface RawActionRowBase<T extends RawComponent> {
|
511
|
-
components: Array<T>;
|
512
|
-
type: ComponentTypes.ACTION_ROW;
|
513
|
-
}
|
514
|
-
|
515
|
-
export interface RawMessageActionRow extends RawActionRowBase<RawMessageComponent> {}
|
516
|
-
export interface RawModalActionRow extends RawActionRowBase<RawModalComponent> {}
|
517
|
-
export type ActionRowToRaw<T extends MessageActionRow | ModalActionRow> =
|
518
|
-
T extends MessageActionRow ? RawMessageActionRow :
|
519
|
-
T extends ModalActionRow ? RawModalActionRow : never;
|
520
|
-
|
521
|
-
export type Component = MessageComponent | ModalComponent;
|
522
|
-
export type MessageComponent = ButtonComponent | SelectMenuComponent;
|
523
|
-
export type ModalComponent = TextInput;
|
524
|
-
export type ButtonComponent = TextButton | URLButton | PremiumButton;
|
525
|
-
export type SelectMenuComponent = StringSelectMenu | UserSelectMenu | RoleSelectMenu | MentionableSelectMenu | ChannelSelectMenu;
|
526
|
-
|
527
|
-
export interface ActionRowBase<T extends Component> {
|
528
|
-
components: Array<T>;
|
529
|
-
type: ComponentTypes.ACTION_ROW;
|
530
|
-
}
|
531
|
-
|
532
|
-
export interface MessageActionRow extends ActionRowBase<MessageComponent> {}
|
533
|
-
export interface ModalActionRow extends ActionRowBase<ModalComponent> {}
|
534
|
-
|
535
|
-
export interface ButtonBase {
|
536
|
-
disabled?: boolean;
|
537
|
-
emoji?: NullablePartialEmoji;
|
538
|
-
label?: string;
|
539
|
-
style: ButtonStyles;
|
540
|
-
type: ComponentTypes.BUTTON;
|
541
|
-
}
|
542
|
-
|
543
|
-
export interface RawTextButton extends ButtonBase {
|
544
|
-
custom_id: string;
|
545
|
-
style: ButtonStyles.PRIMARY | ButtonStyles.SECONDARY | ButtonStyles.SUCCESS | ButtonStyles.DANGER;
|
546
|
-
}
|
547
|
-
|
548
|
-
export interface TextButton extends ButtonBase {
|
549
|
-
customID: string;
|
550
|
-
style: ButtonStyles.PRIMARY | ButtonStyles.SECONDARY | ButtonStyles.SUCCESS | ButtonStyles.DANGER;
|
551
|
-
}
|
552
|
-
|
553
|
-
export interface URLButton extends ButtonBase {
|
554
|
-
style: ButtonStyles.LINK;
|
555
|
-
url: string;
|
556
|
-
}
|
557
|
-
|
558
|
-
export interface RawPremiumButton extends Omit<ButtonBase, "label" | "emoji"> {
|
559
|
-
sku_id: string;
|
560
|
-
style: ButtonStyles.PREMIUM;
|
561
|
-
}
|
562
|
-
|
563
|
-
export interface PremiumButton extends Omit<ButtonBase, "label" | "emoji"> {
|
564
|
-
skuID: string;
|
565
|
-
style: ButtonStyles.PREMIUM;
|
566
|
-
}
|
567
|
-
|
568
|
-
export interface RawSelectMenuBase<T extends SelectMenuTypes> {
|
569
|
-
custom_id: string;
|
570
|
-
disabled?: boolean;
|
571
|
-
max_values?: number;
|
572
|
-
min_values?: number;
|
573
|
-
placeholder?: string;
|
574
|
-
type: T;
|
575
|
-
}
|
576
|
-
|
577
|
-
export interface RawStringSelectMenuOptions {
|
578
|
-
options: Array<SelectOption>;
|
579
|
-
}
|
580
|
-
|
581
|
-
export interface RawChannelSelectMenuOptions {
|
582
|
-
channel_types: Array<ChannelTypes>;
|
583
|
-
}
|
584
|
-
|
585
|
-
export interface RawStringSelectMenu extends RawSelectMenuBase<ComponentTypes.STRING_SELECT>, RawStringSelectMenuOptions {}
|
586
|
-
export interface RawUserSelectMenu extends RawSelectMenuBase<ComponentTypes.USER_SELECT>, DefaultValuesRaw {}
|
587
|
-
export interface RawRoleSelectMenu extends RawSelectMenuBase<ComponentTypes.ROLE_SELECT>, DefaultValuesRaw {}
|
588
|
-
export interface RawMentionableSelectMenu extends RawSelectMenuBase<ComponentTypes.MENTIONABLE_SELECT>, DefaultValuesRaw {}
|
589
|
-
export interface RawChannelSelectMenu extends RawSelectMenuBase<ComponentTypes.CHANNEL_SELECT>, RawChannelSelectMenuOptions, DefaultValuesRaw {}
|
590
|
-
|
591
|
-
|
592
|
-
export interface SelectMenuBase<T extends SelectMenuTypes> {
|
593
|
-
customID: string;
|
594
|
-
disabled?: boolean;
|
595
|
-
maxValues?: number;
|
596
|
-
minValues?: number;
|
597
|
-
placeholder?: string;
|
598
|
-
type: T;
|
599
|
-
}
|
600
|
-
|
601
|
-
interface DefaultValuesRaw {
|
602
|
-
default_values?: Array<SelectMenuDefaultValue>;
|
603
|
-
}
|
604
|
-
|
605
|
-
interface DefaultValues {
|
606
|
-
defaultValues?: Array<SelectMenuDefaultValue>;
|
607
|
-
}
|
608
|
-
|
609
|
-
export interface StringSelectMenuOptions {
|
610
|
-
options: Array<SelectOption>;
|
611
|
-
}
|
612
|
-
|
613
|
-
export interface ChannelSelectMenuOptions {
|
614
|
-
channelTypes: Array<ChannelTypes>;
|
615
|
-
}
|
616
|
-
|
617
|
-
export interface StringSelectMenu extends SelectMenuBase<ComponentTypes.STRING_SELECT>, StringSelectMenuOptions {}
|
618
|
-
export interface UserSelectMenu extends SelectMenuBase<ComponentTypes.USER_SELECT>, DefaultValues {}
|
619
|
-
export interface RoleSelectMenu extends SelectMenuBase<ComponentTypes.ROLE_SELECT>, DefaultValues {}
|
620
|
-
export interface MentionableSelectMenu extends SelectMenuBase<ComponentTypes.MENTIONABLE_SELECT>, DefaultValues {}
|
621
|
-
export interface ChannelSelectMenu extends SelectMenuBase<ComponentTypes.CHANNEL_SELECT>, ChannelSelectMenuOptions, DefaultValues {}
|
622
|
-
|
623
|
-
export interface SelectOption {
|
624
|
-
default?: boolean;
|
625
|
-
description?: string;
|
626
|
-
emoji?: NullablePartialEmoji;
|
627
|
-
label: string;
|
628
|
-
value: string;
|
629
|
-
}
|
630
|
-
|
631
|
-
export interface RawTextInput {
|
632
|
-
custom_id: string;
|
633
|
-
label: string;
|
634
|
-
max_length?: number;
|
635
|
-
min_length?: number;
|
636
|
-
placeholder?: string;
|
637
|
-
required?: boolean;
|
638
|
-
style: TextInputStyles;
|
639
|
-
type: ComponentTypes.TEXT_INPUT;
|
640
|
-
value?: string;
|
641
|
-
}
|
642
|
-
|
643
|
-
export interface TextInput {
|
644
|
-
customID: string;
|
645
|
-
label: string;
|
646
|
-
maxLength?: number;
|
647
|
-
minLength?: number;
|
648
|
-
placeholder?: string;
|
649
|
-
required?: boolean;
|
650
|
-
style: TextInputStyles;
|
651
|
-
type: ComponentTypes.TEXT_INPUT;
|
652
|
-
value?: string;
|
653
|
-
}
|
654
|
-
|
655
500
|
export interface RawAttachment {
|
501
|
+
application?: RESTApplication;
|
502
|
+
clip_created_at?: string;
|
503
|
+
clip_participants?: Array<RawUser>;
|
656
504
|
content_type?: string;
|
657
505
|
description?: string;
|
658
506
|
duration_secs?: number;
|
@@ -689,7 +537,7 @@ export interface RawMessage {
|
|
689
537
|
author: RawUser; // this can be an invalid user if `webhook_id` is set
|
690
538
|
call?: RawCall;
|
691
539
|
channel_id: string;
|
692
|
-
components?: Array<
|
540
|
+
components?: Array<RawMessageComponent>;
|
693
541
|
content: string;
|
694
542
|
edited_timestamp: string | null;
|
695
543
|
embeds: Array<RawEmbed>;
|
@@ -722,6 +570,17 @@ export interface RawMessage {
|
|
722
570
|
webhook_id?: string;
|
723
571
|
}
|
724
572
|
|
573
|
+
export interface RawSoundboard {
|
574
|
+
available: boolean;
|
575
|
+
emoji_id: string | null;
|
576
|
+
emoji_name: string | null;
|
577
|
+
guild_id?: string;
|
578
|
+
name: string;
|
579
|
+
sound_id: string;
|
580
|
+
user?: RawUser;
|
581
|
+
volume: number;
|
582
|
+
}
|
583
|
+
|
725
584
|
export interface RawCall {
|
726
585
|
ended_timestamp?: string | null;
|
727
586
|
participants: Array<string>;
|
@@ -798,6 +657,8 @@ export interface RawMessageInteractionMetadata {
|
|
798
657
|
interacted_message_id?: string;
|
799
658
|
name?: string;
|
800
659
|
original_response_message_id?: string;
|
660
|
+
target_message_id?: string;
|
661
|
+
target_user?: RawUser;
|
801
662
|
triggering_interaction_metadata?: Omit<RawMessageInteractionMetadata, "triggering_interaction_metadata">;
|
802
663
|
type: InteractionTypes;
|
803
664
|
user: RawUser;
|
@@ -807,18 +668,38 @@ export interface MessageInteractionMetadata {
|
|
807
668
|
/** Details about the authorizing user or server for the installation(s) relevant to the interaction. See [Discord's docs](https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-authorizing-integration-owners-object) for more information. */
|
808
669
|
authorizingIntegrationOwners: AuthorizingIntegrationOwners;
|
809
670
|
id: string;
|
810
|
-
/** The ID of the message that contained interactive component, present only on messages created from component interactions */
|
671
|
+
/** The ID of the message that contained interactive component, present only on messages created from component interactions. */
|
811
672
|
interactedMessageID?: string;
|
812
|
-
/** Name of the command, including subcommands and subcommand groups, present only on application command interactions. */
|
673
|
+
/** Name of the command, including subcommands and subcommand groups, present only on messages created from application command interactions. */
|
813
674
|
name?: string;
|
814
675
|
/** The ID of the original response message, present only on follow-up messages. */
|
815
676
|
originalResponseMessageID?: string;
|
677
|
+
/** The message the command was run on, present only on messages created from application command interactions. */
|
678
|
+
targetMessageID?: string;
|
679
|
+
/** The user the command was run on, present only on messages created from application command interactions. */
|
680
|
+
targetUser?: User;
|
816
681
|
/** Metadata for the interaction that was used to open the modal, present only on modal submit interactions. */
|
817
682
|
triggeringInteractionMetadata?: Omit<MessageInteractionMetadata, "triggeringInteractionMetadata" | "name">;
|
818
683
|
type: InteractionTypes;
|
684
|
+
/** The user that triggered the reaction. */
|
819
685
|
user: User;
|
820
686
|
}
|
821
687
|
|
688
|
+
export interface ApplicationCommandMessageInteractionMetadata extends Omit<MessageInteractionMetadata, "triggeringInteractionMetadata" | "name" | "interactedMessageID" | "type">, Required<Pick<MessageInteractionMetadata, "name">> {
|
689
|
+
type: InteractionTypes.APPLICATION_COMMAND;
|
690
|
+
}
|
691
|
+
|
692
|
+
export interface ComponentMessageInteractionMetadata extends Omit<MessageInteractionMetadata, "triggeringInteractionMetadata" | "name" | "interactedMessageID" | "targetMessageID" | "targetUser" | "type">, Required<Pick<MessageInteractionMetadata, "interactedMessageID">> {
|
693
|
+
type: InteractionTypes.MESSAGE_COMPONENT;
|
694
|
+
}
|
695
|
+
|
696
|
+
export interface ModalSubmitMessageInteractionMetadata extends Omit<MessageInteractionMetadata, "triggeringInteractionMetadata" | "name" | "interactedMessageID" | "targetMessageID" | "targetUser" | "type"> {
|
697
|
+
triggeringInteractionMetadata: ApplicationCommandMessageInteractionMetadata | ComponentMessageInteractionMetadata;
|
698
|
+
type: InteractionTypes.MODAL_SUBMIT;
|
699
|
+
}
|
700
|
+
|
701
|
+
export type AnyMessageInteractionMetadata = ApplicationCommandMessageInteractionMetadata | ComponentMessageInteractionMetadata | ModalSubmitMessageInteractionMetadata;
|
702
|
+
|
822
703
|
|
823
704
|
export interface StickerItem {
|
824
705
|
format_type: StickerFormatTypes;
|
@@ -920,6 +801,13 @@ export interface GetReactionsOptions {
|
|
920
801
|
type?: ReactionType;
|
921
802
|
}
|
922
803
|
|
804
|
+
export interface SendSoundboardSoundOptions {
|
805
|
+
/** The ID of the soundboard sound to send. */
|
806
|
+
soundID: string;
|
807
|
+
/** The ID of the guild the soundboard sound is from. */
|
808
|
+
sourceGuildID?: string;
|
809
|
+
}
|
810
|
+
|
923
811
|
export interface EditMessageOptions extends Nullable<Pick<CreateMessageOptions, "content" | "embeds" | "allowedMentions" | "components" | "attachments" | "files" | "flags">> {}
|
924
812
|
|
925
813
|
export interface EditPermissionOptions {
|
@@ -951,6 +839,7 @@ export interface RawInvite {
|
|
951
839
|
target_application?: RawPartialApplication;
|
952
840
|
target_type?: InviteTargetTypes;
|
953
841
|
target_user?: RawUser;
|
842
|
+
type: InviteTypes;
|
954
843
|
}
|
955
844
|
|
956
845
|
export interface RawInviteWithMetadata extends RawInvite {
|
@@ -1315,3 +1204,279 @@ export interface MessagePollResults {
|
|
1315
1204
|
victorAnswerText?: string;
|
1316
1205
|
victorAnswerVotes: number;
|
1317
1206
|
}
|
1207
|
+
|
1208
|
+
export interface RawTextDisplayComponent extends Omit<TextDisplayComponent, "id"> {}
|
1209
|
+
export interface RawThumbnailComponent extends Omit<ThumbnailComponent, "id"> {}
|
1210
|
+
export interface RawMediaGalleryComponent extends Omit<MediaGalleryComponent, "id"> {}
|
1211
|
+
export interface RawSeparatorComponent extends Omit<SeparatorComponent, "id"> {}
|
1212
|
+
export interface RawFileComponent extends Omit<FileComponent, "id"> {}
|
1213
|
+
|
1214
|
+
export interface RawSectionComponent extends BaseComponent {
|
1215
|
+
accessory: RawThumbnailComponent | RawButtonComponent;
|
1216
|
+
components: Array<RawTextDisplayComponent>;
|
1217
|
+
type: ComponentTypes.SECTION;
|
1218
|
+
}
|
1219
|
+
|
1220
|
+
export type RawComponent = AnyRawMessageComponent | AnyRawModalComponent;
|
1221
|
+
export type AnyRawMessageComponent = RawMessageComponent | RawMessageActionRowComponent | RawThumbnailComponent;
|
1222
|
+
export type AnyRawModalComponent = RawModalComponent | RawModalActionRowComponent;
|
1223
|
+
export type RawMessageActionRowComponent = RawButtonComponent | RawSelectMenuComponent;
|
1224
|
+
export type RawMessageComponent = RawMessageActionRow | RawSectionComponent | RawTextDisplayComponent | RawMediaGalleryComponent | RawSeparatorComponent | RawFileComponent | RawContainerComponent;
|
1225
|
+
export type RawModalActionRowComponent = RawTextInput;
|
1226
|
+
export type RawModalComponent = RawModalActionRow;
|
1227
|
+
export type RawButtonComponent = RawTextButton | URLButton | RawPremiumButton;
|
1228
|
+
export type RawSelectMenuComponent = RawStringSelectMenu | RawUserSelectMenu | RawRoleSelectMenu | RawMentionableSelectMenu | RawChannelSelectMenu;
|
1229
|
+
|
1230
|
+
export type ToComponentFromRaw<T extends RawComponent> =
|
1231
|
+
T extends RawMessageActionRow ? MessageActionRow :
|
1232
|
+
T extends RawModalActionRow ? ModalActionRow :
|
1233
|
+
T extends RawTextButton ? TextButton :
|
1234
|
+
T extends URLButton ? URLButton :
|
1235
|
+
T extends RawStringSelectMenu ? StringSelectMenu :
|
1236
|
+
T extends RawUserSelectMenu ? UserSelectMenu :
|
1237
|
+
T extends RawRoleSelectMenu ? RoleSelectMenu :
|
1238
|
+
T extends RawMentionableSelectMenu ? MentionableSelectMenu :
|
1239
|
+
T extends RawChannelSelectMenu ? ChannelSelectMenu :
|
1240
|
+
T extends RawTextInput ? TextInput :
|
1241
|
+
T extends RawSectionComponent ? SectionComponent :
|
1242
|
+
T extends RawTextDisplayComponent ? TextDisplayComponent :
|
1243
|
+
T extends RawThumbnailComponent ? ThumbnailComponent :
|
1244
|
+
T extends RawMediaGalleryComponent ? MediaGalleryComponent :
|
1245
|
+
T extends RawSeparatorComponent ? SeparatorComponent :
|
1246
|
+
T extends RawFileComponent ? FileComponent :
|
1247
|
+
T extends RawContainerComponent ? ContainerComponent :
|
1248
|
+
never;
|
1249
|
+
export type ToRawFromComponent<T extends Component> =
|
1250
|
+
T extends MessageActionRow ? RawMessageActionRow :
|
1251
|
+
T extends ModalActionRow ? RawModalActionRow :
|
1252
|
+
T extends TextButton ? RawTextButton :
|
1253
|
+
T extends URLButton ? URLButton :
|
1254
|
+
T extends StringSelectMenu ? RawStringSelectMenu :
|
1255
|
+
T extends UserSelectMenu ? RawUserSelectMenu :
|
1256
|
+
T extends RoleSelectMenu ? RawRoleSelectMenu :
|
1257
|
+
T extends MentionableSelectMenu ? RawMentionableSelectMenu :
|
1258
|
+
T extends ChannelSelectMenu ? RawChannelSelectMenu :
|
1259
|
+
T extends TextInput ? RawTextInput :
|
1260
|
+
T extends SectionComponent ? RawSectionComponent :
|
1261
|
+
T extends TextDisplayComponent ? RawTextDisplayComponent :
|
1262
|
+
T extends ThumbnailComponent ? RawThumbnailComponent :
|
1263
|
+
T extends MediaGalleryComponent ? RawMediaGalleryComponent :
|
1264
|
+
T extends SeparatorComponent ? RawSeparatorComponent :
|
1265
|
+
T extends FileComponent ? RawFileComponent :
|
1266
|
+
T extends ContainerComponent ? RawContainerComponent :
|
1267
|
+
never;
|
1268
|
+
|
1269
|
+
export interface RawActionRowBase<T extends RawComponent> {
|
1270
|
+
components: Array<T>;
|
1271
|
+
type: ComponentTypes.ACTION_ROW;
|
1272
|
+
}
|
1273
|
+
|
1274
|
+
export interface RawMessageActionRow extends RawActionRowBase<RawMessageActionRowComponent> {}
|
1275
|
+
export interface RawModalActionRow extends RawActionRowBase<RawModalActionRowComponent> {}
|
1276
|
+
export type ActionRowToRaw<T extends MessageActionRow | ModalActionRow> =
|
1277
|
+
T extends MessageActionRow ? RawMessageActionRow :
|
1278
|
+
T extends ModalActionRow ? RawModalActionRow : never;
|
1279
|
+
|
1280
|
+
export type Component = AnyMessageComponent | AnyModalComponent;
|
1281
|
+
export type AnyMessageComponent = MessageComponent | MessageActionRowComponent | ThumbnailComponent;
|
1282
|
+
export type AnyModalComponent = ModalComponent | ModalActionRowComponent;
|
1283
|
+
export type MessageActionRowComponent = ButtonComponent | SelectMenuComponent;
|
1284
|
+
export type MessageComponent = MessageActionRow | SectionComponent | TextDisplayComponent | MediaGalleryComponent | SeparatorComponent | FileComponent | ContainerComponent;
|
1285
|
+
export type ModalActionRowComponent = TextInput;
|
1286
|
+
export type ModalComponent = ModalActionRow;
|
1287
|
+
export type ButtonComponent = TextButton | URLButton | PremiumButton;
|
1288
|
+
export type SelectMenuComponent = StringSelectMenu | UserSelectMenu | RoleSelectMenu | MentionableSelectMenu | ChannelSelectMenu;
|
1289
|
+
|
1290
|
+
export interface BaseComponent {
|
1291
|
+
/** Autoincremented number if not provided */
|
1292
|
+
id?: number;
|
1293
|
+
type: ComponentTypes;
|
1294
|
+
}
|
1295
|
+
|
1296
|
+
export interface ActionRowBase<T extends Component> extends BaseComponent {
|
1297
|
+
components: Array<T>;
|
1298
|
+
type: ComponentTypes.ACTION_ROW;
|
1299
|
+
}
|
1300
|
+
|
1301
|
+
export interface MessageActionRow extends ActionRowBase<MessageActionRowComponent> {}
|
1302
|
+
export interface ModalActionRow extends ActionRowBase<ModalActionRowComponent> {}
|
1303
|
+
|
1304
|
+
export interface ButtonBase extends BaseComponent {
|
1305
|
+
disabled?: boolean;
|
1306
|
+
emoji?: NullablePartialEmoji;
|
1307
|
+
label?: string;
|
1308
|
+
style: ButtonStyles;
|
1309
|
+
type: ComponentTypes.BUTTON;
|
1310
|
+
}
|
1311
|
+
|
1312
|
+
export interface RawTextButton extends ButtonBase {
|
1313
|
+
custom_id: string;
|
1314
|
+
style: ButtonStyles.PRIMARY | ButtonStyles.SECONDARY | ButtonStyles.SUCCESS | ButtonStyles.DANGER;
|
1315
|
+
}
|
1316
|
+
|
1317
|
+
export interface TextButton extends ButtonBase {
|
1318
|
+
customID: string;
|
1319
|
+
style: ButtonStyles.PRIMARY | ButtonStyles.SECONDARY | ButtonStyles.SUCCESS | ButtonStyles.DANGER;
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
export interface URLButton extends ButtonBase {
|
1323
|
+
style: ButtonStyles.LINK;
|
1324
|
+
url: string;
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
export interface RawPremiumButton extends Omit<ButtonBase, "label" | "emoji"> {
|
1328
|
+
sku_id: string;
|
1329
|
+
style: ButtonStyles.PREMIUM;
|
1330
|
+
}
|
1331
|
+
|
1332
|
+
export interface PremiumButton extends Omit<ButtonBase, "label" | "emoji"> {
|
1333
|
+
skuID: string;
|
1334
|
+
style: ButtonStyles.PREMIUM;
|
1335
|
+
}
|
1336
|
+
|
1337
|
+
export interface RawSelectMenuBase<T extends SelectMenuTypes> {
|
1338
|
+
custom_id: string;
|
1339
|
+
disabled?: boolean;
|
1340
|
+
max_values?: number;
|
1341
|
+
min_values?: number;
|
1342
|
+
placeholder?: string;
|
1343
|
+
type: T;
|
1344
|
+
}
|
1345
|
+
|
1346
|
+
export interface RawStringSelectMenuOptions {
|
1347
|
+
options: Array<SelectOption>;
|
1348
|
+
}
|
1349
|
+
|
1350
|
+
export interface RawChannelSelectMenuOptions {
|
1351
|
+
channel_types: Array<ChannelTypes>;
|
1352
|
+
}
|
1353
|
+
|
1354
|
+
export interface RawStringSelectMenu extends RawSelectMenuBase<ComponentTypes.STRING_SELECT>, RawStringSelectMenuOptions {}
|
1355
|
+
export interface RawUserSelectMenu extends RawSelectMenuBase<ComponentTypes.USER_SELECT>, DefaultValuesRaw {}
|
1356
|
+
export interface RawRoleSelectMenu extends RawSelectMenuBase<ComponentTypes.ROLE_SELECT>, DefaultValuesRaw {}
|
1357
|
+
export interface RawMentionableSelectMenu extends RawSelectMenuBase<ComponentTypes.MENTIONABLE_SELECT>, DefaultValuesRaw {}
|
1358
|
+
export interface RawChannelSelectMenu extends RawSelectMenuBase<ComponentTypes.CHANNEL_SELECT>, RawChannelSelectMenuOptions, DefaultValuesRaw {}
|
1359
|
+
|
1360
|
+
|
1361
|
+
export interface SelectMenuBase<T extends SelectMenuTypes> extends BaseComponent {
|
1362
|
+
customID: string;
|
1363
|
+
disabled?: boolean;
|
1364
|
+
maxValues?: number;
|
1365
|
+
minValues?: number;
|
1366
|
+
placeholder?: string;
|
1367
|
+
type: T;
|
1368
|
+
}
|
1369
|
+
|
1370
|
+
interface DefaultValuesRaw {
|
1371
|
+
default_values?: Array<SelectMenuDefaultValue>;
|
1372
|
+
}
|
1373
|
+
|
1374
|
+
interface DefaultValues {
|
1375
|
+
defaultValues?: Array<SelectMenuDefaultValue>;
|
1376
|
+
}
|
1377
|
+
|
1378
|
+
export interface StringSelectMenuOptions {
|
1379
|
+
options: Array<SelectOption>;
|
1380
|
+
}
|
1381
|
+
|
1382
|
+
export interface ChannelSelectMenuOptions {
|
1383
|
+
channelTypes: Array<ChannelTypes>;
|
1384
|
+
}
|
1385
|
+
|
1386
|
+
export interface StringSelectMenu extends SelectMenuBase<ComponentTypes.STRING_SELECT>, StringSelectMenuOptions {}
|
1387
|
+
export interface UserSelectMenu extends SelectMenuBase<ComponentTypes.USER_SELECT>, DefaultValues {}
|
1388
|
+
export interface RoleSelectMenu extends SelectMenuBase<ComponentTypes.ROLE_SELECT>, DefaultValues {}
|
1389
|
+
export interface MentionableSelectMenu extends SelectMenuBase<ComponentTypes.MENTIONABLE_SELECT>, DefaultValues {}
|
1390
|
+
export interface ChannelSelectMenu extends SelectMenuBase<ComponentTypes.CHANNEL_SELECT>, ChannelSelectMenuOptions, DefaultValues {}
|
1391
|
+
|
1392
|
+
export interface SelectOption {
|
1393
|
+
default?: boolean;
|
1394
|
+
description?: string;
|
1395
|
+
emoji?: NullablePartialEmoji;
|
1396
|
+
label: string;
|
1397
|
+
value: string;
|
1398
|
+
}
|
1399
|
+
|
1400
|
+
export interface RawTextInput {
|
1401
|
+
custom_id: string;
|
1402
|
+
label: string;
|
1403
|
+
max_length?: number;
|
1404
|
+
min_length?: number;
|
1405
|
+
placeholder?: string;
|
1406
|
+
required?: boolean;
|
1407
|
+
style: TextInputStyles;
|
1408
|
+
type: ComponentTypes.TEXT_INPUT;
|
1409
|
+
value?: string;
|
1410
|
+
}
|
1411
|
+
|
1412
|
+
export interface TextInput extends BaseComponent {
|
1413
|
+
customID: string;
|
1414
|
+
label: string;
|
1415
|
+
maxLength?: number;
|
1416
|
+
minLength?: number;
|
1417
|
+
placeholder?: string;
|
1418
|
+
required?: boolean;
|
1419
|
+
style: TextInputStyles;
|
1420
|
+
type: ComponentTypes.TEXT_INPUT;
|
1421
|
+
value?: string;
|
1422
|
+
}
|
1423
|
+
|
1424
|
+
export interface UnfurledMediaItem {
|
1425
|
+
url: string;
|
1426
|
+
}
|
1427
|
+
|
1428
|
+
export interface SectionComponent extends BaseComponent {
|
1429
|
+
accessory: ThumbnailComponent | ButtonComponent;
|
1430
|
+
components: Array<TextDisplayComponent>;
|
1431
|
+
type: ComponentTypes.SECTION;
|
1432
|
+
}
|
1433
|
+
|
1434
|
+
export interface TextDisplayComponent extends BaseComponent {
|
1435
|
+
content: string;
|
1436
|
+
type: ComponentTypes.TEXT_DISPLAY;
|
1437
|
+
}
|
1438
|
+
|
1439
|
+
export interface ThumbnailComponent extends BaseComponent {
|
1440
|
+
description?: string;
|
1441
|
+
media: UnfurledMediaItem;
|
1442
|
+
spoiler?: boolean;
|
1443
|
+
type: ComponentTypes.THUMBNAIL;
|
1444
|
+
}
|
1445
|
+
|
1446
|
+
export interface MediaGalleryItem {
|
1447
|
+
description?: string;
|
1448
|
+
media: UnfurledMediaItem;
|
1449
|
+
spoiler?: boolean;
|
1450
|
+
}
|
1451
|
+
|
1452
|
+
export interface MediaGalleryComponent extends BaseComponent {
|
1453
|
+
items: Array<MediaGalleryItem>;
|
1454
|
+
type: ComponentTypes.MEDIA_GALLERY;
|
1455
|
+
}
|
1456
|
+
|
1457
|
+
export interface SeparatorComponent extends BaseComponent {
|
1458
|
+
divider?: boolean;
|
1459
|
+
spacing?: SeparatorSpacingSize;
|
1460
|
+
type: ComponentTypes.SEPARATOR;
|
1461
|
+
}
|
1462
|
+
|
1463
|
+
export interface FileComponent extends BaseComponent {
|
1464
|
+
// The UnfurledMediaItem ONLY supports attachment://<filename> references
|
1465
|
+
file: UnfurledMediaItem;
|
1466
|
+
spoiler?: boolean;
|
1467
|
+
type: ComponentTypes.FILE;
|
1468
|
+
}
|
1469
|
+
|
1470
|
+
export interface ContainerComponent extends BaseComponent {
|
1471
|
+
accentColor?: number;
|
1472
|
+
components: Array<MessageActionRow | TextDisplayComponent | SectionComponent | MediaGalleryComponent | SeparatorComponent | FileComponent>;
|
1473
|
+
spoiler?: boolean;
|
1474
|
+
type: ComponentTypes.CONTAINER;
|
1475
|
+
}
|
1476
|
+
|
1477
|
+
export interface RawContainerComponent extends Omit<BaseComponent, "id"> {
|
1478
|
+
accent_color?: number;
|
1479
|
+
components: Array<RawMessageActionRow | RawTextDisplayComponent | RawSectionComponent | RawMediaGalleryComponent | RawSeparatorComponent | RawFileComponent>;
|
1480
|
+
spoiler?: boolean;
|
1481
|
+
type: ComponentTypes.CONTAINER;
|
1482
|
+
}
|