seyfert 3.0.1-dev-14631093284.0 → 3.0.1-dev-14657186698.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.
Files changed (62) hide show
  1. package/lib/api/Routes/webhooks.d.ts +2 -2
  2. package/lib/api/api.d.ts +3 -2
  3. package/lib/api/api.js +3 -3
  4. package/lib/builders/ActionRow.d.ts +3 -3
  5. package/lib/builders/ActionRow.js +2 -2
  6. package/lib/builders/Button.d.ts +2 -11
  7. package/lib/builders/Button.js +3 -15
  8. package/lib/builders/Container.d.ts +68 -0
  9. package/lib/builders/Container.js +86 -0
  10. package/lib/builders/File.d.ts +37 -0
  11. package/lib/builders/File.js +52 -0
  12. package/lib/builders/MediaGallery.d.ts +80 -0
  13. package/lib/builders/MediaGallery.js +110 -0
  14. package/lib/builders/Section.d.ts +29 -0
  15. package/lib/builders/Section.js +50 -0
  16. package/lib/builders/Separator.d.ts +39 -0
  17. package/lib/builders/Separator.js +54 -0
  18. package/lib/builders/TextDisplay.d.ts +29 -0
  19. package/lib/builders/TextDisplay.js +41 -0
  20. package/lib/builders/Thumbnail.d.ts +43 -0
  21. package/lib/builders/Thumbnail.js +61 -0
  22. package/lib/builders/index.d.ts +10 -4
  23. package/lib/builders/index.js +29 -1
  24. package/lib/builders/types.d.ts +11 -1
  25. package/lib/common/types/write.d.ts +3 -3
  26. package/lib/components/ActionRow.d.ts +1 -1
  27. package/lib/components/BaseComponent.d.ts +27 -2
  28. package/lib/components/Container.d.ts +10 -0
  29. package/lib/components/Container.js +22 -0
  30. package/lib/components/File.d.ts +7 -0
  31. package/lib/components/File.js +16 -0
  32. package/lib/components/MediaGallery.d.ts +6 -0
  33. package/lib/components/MediaGallery.js +13 -0
  34. package/lib/components/Section.d.ts +12 -0
  35. package/lib/components/Section.js +21 -0
  36. package/lib/components/Separator.d.ts +7 -0
  37. package/lib/components/Separator.js +16 -0
  38. package/lib/components/TextDisplay.d.ts +5 -0
  39. package/lib/components/TextDisplay.js +10 -0
  40. package/lib/components/Thumbnail.d.ts +8 -0
  41. package/lib/components/Thumbnail.js +19 -0
  42. package/lib/components/index.d.ts +13 -3
  43. package/lib/components/index.js +27 -0
  44. package/lib/events/hooks/interactions.d.ts +1 -1
  45. package/lib/structures/Interaction.d.ts +1 -1
  46. package/lib/structures/Interaction.js +3 -1
  47. package/lib/structures/Message.d.ts +2 -3
  48. package/lib/structures/Message.js +1 -2
  49. package/lib/structures/Webhook.d.ts +2 -2
  50. package/lib/structures/channels.js +2 -2
  51. package/lib/types/payloads/_interactions/messageComponents.d.ts +1 -2
  52. package/lib/types/payloads/_interactions/modalSubmit.d.ts +1 -2
  53. package/lib/types/payloads/_interactions/responses.d.ts +1 -2
  54. package/lib/types/payloads/channel.d.ts +11 -332
  55. package/lib/types/payloads/channel.js +9 -111
  56. package/lib/types/payloads/components.d.ts +489 -0
  57. package/lib/types/payloads/components.js +148 -0
  58. package/lib/types/payloads/index.d.ts +1 -0
  59. package/lib/types/payloads/index.js +1 -0
  60. package/lib/types/rest/channel.d.ts +3 -3
  61. package/lib/types/rest/webhook.d.ts +12 -4
  62. package/package.json +1 -1
@@ -1,22 +1,32 @@
1
- import { type APIMessageActionRowComponent } from '../types';
1
+ import { type APIComponents, type APITopLevelComponent, ComponentType } from '../types';
2
+ import { MessageActionRowComponent } from './ActionRow';
2
3
  import { BaseComponent } from './BaseComponent';
3
4
  import { ButtonComponent, LinkButtonComponent, SKUButtonComponent } from './ButtonComponent';
4
5
  import { ChannelSelectMenuComponent } from './ChannelSelectMenuComponent';
6
+ import { ContainerComponent } from './Container';
7
+ import { FileComponent } from './File';
8
+ import { MediaGalleryComponent } from './MediaGallery';
5
9
  import { MentionableSelectMenuComponent } from './MentionableSelectMenuComponent';
6
10
  import { RoleSelectMenuComponent } from './RoleSelectMenuComponent';
11
+ import { SectionComponent } from './Section';
12
+ import { SeparatorComponent } from './Separator';
7
13
  import { StringSelectMenuComponent } from './StringSelectMenuComponent';
8
- import type { TextInputComponent } from './TextInputComponent';
14
+ import { TextDisplayComponent } from './TextDisplay';
15
+ import { TextInputComponent } from './TextInputComponent';
9
16
  import { UserSelectMenuComponent } from './UserSelectMenuComponent';
10
17
  export type MessageComponents = ButtonComponent | LinkButtonComponent | SKUButtonComponent | RoleSelectMenuComponent | UserSelectMenuComponent | StringSelectMenuComponent | ChannelSelectMenuComponent | MentionableSelectMenuComponent | TextInputComponent;
11
18
  export type ActionRowMessageComponents = Exclude<MessageComponents, TextInputComponent>;
19
+ export type AllComponents = MessageComponents | TopLevelComponents | ContainerComponents | BaseComponent<ComponentType>;
12
20
  export * from './componentcommand';
13
21
  export * from './componentcontext';
14
22
  export * from './modalcommand';
15
23
  export * from './modalcontext';
24
+ export type TopLevelComponents = SectionComponent | ActionRowMessageComponents | TextDisplayComponent | ContainerComponent | FileComponent | MediaGalleryComponent | BaseComponent<APITopLevelComponent['type']>;
25
+ export type ContainerComponents = MessageActionRowComponent | TextDisplayComponent | MediaGalleryComponent | SectionComponent | SeparatorComponent | FileComponent;
16
26
  /**
17
27
  * Return a new component instance based on the component type.
18
28
  *
19
29
  * @param component The component to create.
20
30
  * @returns The component instance.
21
31
  */
22
- export declare function componentFactory(component: APIMessageActionRowComponent): ActionRowMessageComponents | BaseComponent<ActionRowMessageComponents['type']>;
32
+ export declare function componentFactory(component: APIComponents): AllComponents;
@@ -16,12 +16,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.componentFactory = componentFactory;
18
18
  const types_1 = require("../types");
19
+ const ActionRow_1 = require("./ActionRow");
19
20
  const BaseComponent_1 = require("./BaseComponent");
20
21
  const ButtonComponent_1 = require("./ButtonComponent");
21
22
  const ChannelSelectMenuComponent_1 = require("./ChannelSelectMenuComponent");
23
+ const Container_1 = require("./Container");
24
+ const File_1 = require("./File");
25
+ const MediaGallery_1 = require("./MediaGallery");
22
26
  const MentionableSelectMenuComponent_1 = require("./MentionableSelectMenuComponent");
23
27
  const RoleSelectMenuComponent_1 = require("./RoleSelectMenuComponent");
28
+ const Section_1 = require("./Section");
29
+ const Separator_1 = require("./Separator");
24
30
  const StringSelectMenuComponent_1 = require("./StringSelectMenuComponent");
31
+ const TextDisplay_1 = require("./TextDisplay");
32
+ const TextInputComponent_1 = require("./TextInputComponent");
33
+ const Thumbnail_1 = require("./Thumbnail");
25
34
  const UserSelectMenuComponent_1 = require("./UserSelectMenuComponent");
26
35
  __exportStar(require("./componentcommand"), exports);
27
36
  __exportStar(require("./componentcontext"), exports);
@@ -54,6 +63,24 @@ function componentFactory(component) {
54
63
  return new UserSelectMenuComponent_1.UserSelectMenuComponent(component);
55
64
  case types_1.ComponentType.MentionableSelect:
56
65
  return new MentionableSelectMenuComponent_1.MentionableSelectMenuComponent(component);
66
+ case types_1.ComponentType.ActionRow:
67
+ return new ActionRow_1.MessageActionRowComponent(component);
68
+ case types_1.ComponentType.Container:
69
+ return new Container_1.ContainerComponent(component);
70
+ case types_1.ComponentType.File:
71
+ return new File_1.FileComponent(component);
72
+ case types_1.ComponentType.MediaGallery:
73
+ return new MediaGallery_1.MediaGalleryComponent(component);
74
+ case types_1.ComponentType.Section:
75
+ return new Section_1.SectionComponent(component);
76
+ case types_1.ComponentType.TextDisplay:
77
+ return new TextDisplay_1.TextDisplayComponent(component);
78
+ case types_1.ComponentType.Separator:
79
+ return new Separator_1.SeparatorComponent(component);
80
+ case types_1.ComponentType.Thumbnail:
81
+ return new Thumbnail_1.ThumbnailComponent(component);
82
+ case types_1.ComponentType.TextInput:
83
+ return new TextInputComponent_1.TextInputComponent(component);
57
84
  default:
58
85
  return new BaseComponent_1.BaseComponent(component);
59
86
  }
@@ -1,4 +1,4 @@
1
1
  import type { UsingClient } from '../../commands';
2
2
  import { BaseInteraction } from '../../structures';
3
3
  import type { GatewayInteractionCreateDispatchData } from '../../types';
4
- export declare const INTERACTION_CREATE: (self: UsingClient, data: GatewayInteractionCreateDispatchData) => import("../../structures").ChatInputCommandInteraction<boolean> | import("../../structures").UserCommandInteraction<boolean> | import("../../structures").MessageCommandInteraction<boolean> | import("../../structures").ButtonInteraction | import("../../structures").StringSelectMenuInteraction<string[]> | import("../../structures").UserSelectMenuInteraction | import("../../structures").RoleSelectMenuInteraction | import("../../structures").MentionableSelectMenuInteraction | import("../../structures").ChannelSelectMenuInteraction | import("../../structures").ModalSubmitInteraction<boolean> | import("../../structures").AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../../types").APIPingInteraction>;
4
+ export declare const INTERACTION_CREATE: (self: UsingClient, data: GatewayInteractionCreateDispatchData) => import("../../structures").ChatInputCommandInteraction<boolean> | import("../../structures").UserCommandInteraction<boolean> | import("../../structures").MessageCommandInteraction<boolean> | import("../../structures").ButtonInteraction | import("../../structures").StringSelectMenuInteraction<string[]> | import("../../structures").UserSelectMenuInteraction | import("../../structures").RoleSelectMenuInteraction | import("../../structures").MentionableSelectMenuInteraction | import("../../structures").ChannelSelectMenuInteraction | import("../../structures").ModalSubmitInteraction<boolean> | import("../../structures").AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../../types").APIPingInteraction> | undefined;
@@ -50,7 +50,7 @@ export declare class BaseInteraction<FromGuild extends boolean = boolean, Type e
50
50
  isAutocomplete(): this is AutocompleteInteraction;
51
51
  isModal(): this is ModalSubmitInteraction;
52
52
  isEntryPoint(): this is EntryPointInteraction;
53
- static from(client: UsingClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction): ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ButtonInteraction | StringSelectMenuInteraction<string[]> | UserSelectMenuInteraction | RoleSelectMenuInteraction | MentionableSelectMenuInteraction | ChannelSelectMenuInteraction | ModalSubmitInteraction<boolean> | AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../types").APIPingInteraction>;
53
+ static from(client: UsingClient, gateway: GatewayInteractionCreateDispatchData, __reply?: __InternalReplyFunction): ChatInputCommandInteraction<boolean> | UserCommandInteraction<boolean> | MessageCommandInteraction<boolean> | ButtonInteraction | StringSelectMenuInteraction<string[]> | UserSelectMenuInteraction | RoleSelectMenuInteraction | MentionableSelectMenuInteraction | ChannelSelectMenuInteraction | ModalSubmitInteraction<boolean> | AutocompleteInteraction<boolean> | BaseInteraction<boolean, import("../types").APIPingInteraction> | undefined;
54
54
  fetchGuild(mode?: 'rest' | 'flow'): Promise<GuildStructure<'cached' | 'api'> | undefined>;
55
55
  fetchGuild(mode: 'cache'): ReturnCache<GuildStructure<'cached'> | undefined>;
56
56
  }
@@ -53,6 +53,7 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
53
53
  //@ts-ignore
54
54
  return {
55
55
  type: body.type,
56
+ // @ts-expect-error
56
57
  data: BaseInteraction.transformBody(body.data ?? {}, files, self),
57
58
  };
58
59
  }
@@ -194,7 +195,6 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
194
195
  case types_1.ApplicationCommandType.PrimaryEntryPoint:
195
196
  return new EntryPointInteraction(client, gateway, __reply);
196
197
  }
197
- // biome-ignore lint/suspicious/noFallthroughSwitchClause: bad interaction between biome and ts-server
198
198
  case types_1.InteractionType.MessageComponent:
199
199
  switch (gateway.data.component_type) {
200
200
  case types_1.ComponentType.Button:
@@ -209,6 +209,8 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
209
209
  return new UserSelectMenuInteraction(client, gateway, __reply);
210
210
  case types_1.ComponentType.StringSelect:
211
211
  return new StringSelectMenuInteraction(client, gateway, __reply);
212
+ default:
213
+ return;
212
214
  }
213
215
  case types_1.InteractionType.ModalSubmit:
214
216
  return new ModalSubmitInteraction(client, gateway);
@@ -5,8 +5,7 @@ import type { UsingClient } from '../commands';
5
5
  import { type ObjectToLower } from '../common';
6
6
  import type { EmojiResolvable } from '../common/types/resolvables';
7
7
  import type { MessageCreateBodyRequest, MessageUpdateBodyRequest } from '../common/types/write';
8
- import type { ActionRowMessageComponents } from '../components';
9
- import { MessageActionRowComponent } from '../components/ActionRow';
8
+ import type { TopLevelComponents } from '../components';
10
9
  import type { APIChannelMention, APIEmbed, APIMessage, GatewayMessageCreateDispatchData } from '../types';
11
10
  import type { MessageWebhookMethodEditParams, MessageWebhookMethodWriteParams } from './Webhook';
12
11
  import { DiscordBase } from './extra/DiscordBase';
@@ -16,7 +15,7 @@ export interface BaseMessage extends DiscordBase, ObjectToLower<Omit<MessageData
16
15
  guildId?: string;
17
16
  author: UserStructure;
18
17
  member?: GuildMemberStructure;
19
- components: MessageActionRowComponent<ActionRowMessageComponents>[];
18
+ components: TopLevelComponents[];
20
19
  poll?: PollStructure;
21
20
  mentions: {
22
21
  roles: string[];
@@ -5,7 +5,6 @@ const __1 = require("..");
5
5
  const transformers_1 = require("../client/transformers");
6
6
  const common_1 = require("../common");
7
7
  const common_2 = require("../common");
8
- const ActionRow_1 = require("../components/ActionRow");
9
8
  const DiscordBase_1 = require("./extra/DiscordBase");
10
9
  class BaseMessage extends DiscordBase_1.DiscordBase {
11
10
  embeds;
@@ -16,7 +15,7 @@ class BaseMessage extends DiscordBase_1.DiscordBase {
16
15
  channels: data.mention_channels ?? [],
17
16
  users: [],
18
17
  };
19
- this.components = data.components?.map(x => new ActionRow_1.MessageActionRowComponent(x)) ?? [];
18
+ this.components = data.components?.map(__1.componentFactory) ?? [];
20
19
  this.embeds = data.embeds.map(embed => new InMessageEmbed(embed));
21
20
  this.patch(data);
22
21
  }
@@ -5,7 +5,7 @@ import type { ImageOptions, MessageWebhookCreateBodyRequest, MessageWebhookPaylo
5
5
  /**
6
6
  * Represents a Discord webhook.
7
7
  */
8
- import type { APIWebhook, RESTGetAPIWebhookWithTokenMessageQuery, RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPostAPIWebhookWithTokenQuery } from '../types';
8
+ import type { APIWebhook, RESTPatchAPIWebhookJSONBody, RESTPatchAPIWebhookWithTokenJSONBody, RESTPatchAPIWebhookWithTokenMessageQuery, RESTPostAPIWebhookWithTokenQuery } from '../types';
9
9
  import type { AllChannels } from './channels';
10
10
  import { DiscordBase } from './extra/DiscordBase';
11
11
  export interface Webhook extends DiscordBase, ObjectToLower<Omit<APIWebhook, 'user' | 'source_guild'>> {
@@ -96,7 +96,7 @@ export declare class Webhook extends DiscordBase {
96
96
  /** Type definition for parameters of editing a message through a webhook. */
97
97
  export type MessageWebhookMethodEditParams = MessageWebhookPayload<MessageWebhookUpdateBodyRequest, {
98
98
  messageId: string;
99
- query?: RESTGetAPIWebhookWithTokenMessageQuery;
99
+ query?: RESTPatchAPIWebhookWithTokenMessageQuery;
100
100
  }>;
101
101
  /** Type definition for parameters of writing a message through a webhook. */
102
102
  export type MessageWebhookMethodWriteParams = MessageWebhookPayload<MessageWebhookCreateBodyRequest, {
@@ -209,8 +209,8 @@ class MessagesMethods extends DiscordBase_1.DiscordBase {
209
209
  const payload = {
210
210
  allowed_mentions: self.options?.allowedMentions,
211
211
  ...body,
212
- components: body.components?.map(x => (x instanceof builders_1.ActionRow ? x.toJSON() : x)) ?? undefined,
213
- embeds: body.embeds?.map(x => (x instanceof builders_1.Embed ? x.toJSON() : x)) ?? undefined,
212
+ embeds: body.embeds?.map(x => (x instanceof builders_1.Embed ? x.toJSON() : x)),
213
+ components: body.components?.map(x => ('toJSON' in x ? x.toJSON() : x)) ?? undefined,
214
214
  poll: poll ? (poll instanceof builders_1.PollBuilder ? poll.toJSON() : poll) : undefined,
215
215
  };
216
216
  if ('attachments' in body) {
@@ -1,5 +1,4 @@
1
- import type { Snowflake } from '../../index';
2
- import type { ComponentType } from '../channel';
1
+ import type { ComponentType, Snowflake } from '../../index';
3
2
  import type { APIBaseInteraction, InteractionType } from '../interactions';
4
3
  import type { APIDMInteractionWrapper, APIGuildInteractionWrapper, APIInteractionDataResolved, APIUserInteractionDataResolved } from './base';
5
4
  export type APIMessageComponentInteraction = APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData> & Required<Pick<APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>, 'app_permissions' | 'channel' | 'data' | 'message'>>;
@@ -1,5 +1,4 @@
1
- import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel';
2
- import type { APIBaseInteraction, APIDMInteractionWrapper, APIGuildInteractionWrapper, ComponentType, InteractionType } from '../index';
1
+ import type { APIActionRowComponent, APIBaseInteraction, APIDMInteractionWrapper, APIGuildInteractionWrapper, APIModalActionRowComponent, ComponentType, InteractionType } from '../index';
3
2
  export interface ModalSubmitComponent {
4
3
  type: ComponentType;
5
4
  custom_id: string;
@@ -1,7 +1,6 @@
1
1
  import type { MakeRequired } from '../../../common';
2
2
  import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../index';
3
- import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel';
4
- import type { MessageFlags } from '../index';
3
+ import type { APIActionRowComponent, APIModalActionRowComponent, MessageFlags } from '../index';
5
4
  import type { APIApplicationCommandOptionChoice } from './applicationCommands';
6
5
  /**
7
6
  * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
@@ -2,7 +2,7 @@
2
2
  * Types extracted from https://discord.com/developers/docs/resources/channel
3
3
  */
4
4
  import type { PickRequired } from '../../common';
5
- import type { ChannelType, OverwriteType, Permissions, Snowflake, VideoQualityMode } from '../index';
5
+ import type { APITopLevelComponent, ChannelFlags, ChannelType, OverwriteType, Permissions, Snowflake, VideoQualityMode } from '../index';
6
6
  import type { APIApplication } from './application';
7
7
  import type { APIPartialEmoji } from './emoji';
8
8
  import type { APIGuildMember } from './guild';
@@ -526,7 +526,7 @@ export interface APIMessage {
526
526
  *
527
527
  * See https://support-dev.discord.com/hc/articles/4404772028055
528
528
  */
529
- components?: APIActionRowComponent<APIMessageActionRowComponent>[];
529
+ components?: APITopLevelComponent[];
530
530
  /**
531
531
  * Sent if the message contains stickers
532
532
  *
@@ -736,7 +736,15 @@ export declare enum MessageFlags {
736
736
  /**
737
737
  * This message is a voice message
738
738
  */
739
- IsVoiceMessage = 8192
739
+ IsVoiceMessage = 8192,
740
+ /**
741
+ * This message has a snapshot (via Message Forwarding)
742
+ */
743
+ HasSnapshot = 16384,
744
+ /**
745
+ * This message allows you to create fully component driven messages
746
+ */
747
+ IsComponentsV2 = 32768
740
748
  }
741
749
  /**
742
750
  * https://discord.com/developers/docs/resources/channel#message-call-object-message-call-object-structure
@@ -1394,332 +1402,3 @@ export interface APIAllowedMentions {
1394
1402
  */
1395
1403
  replied_user?: boolean;
1396
1404
  }
1397
- /**
1398
- * https://discord.com/developers/docs/interactions/message-components#component-object
1399
- */
1400
- export interface APIBaseComponent<T extends ComponentType> {
1401
- /**
1402
- * The type of the component
1403
- */
1404
- type: T;
1405
- }
1406
- /**
1407
- * https://discord.com/developers/docs/interactions/message-components#component-object-component-types
1408
- */
1409
- export declare enum ComponentType {
1410
- /**
1411
- * Action Row component
1412
- */
1413
- ActionRow = 1,
1414
- /**
1415
- * Button component
1416
- */
1417
- Button = 2,
1418
- /**
1419
- * Select menu for picking from defined text options
1420
- */
1421
- StringSelect = 3,
1422
- /**
1423
- * Text Input component
1424
- */
1425
- TextInput = 4,
1426
- /**
1427
- * Select menu for users
1428
- */
1429
- UserSelect = 5,
1430
- /**
1431
- * Select menu for roles
1432
- */
1433
- RoleSelect = 6,
1434
- /**
1435
- * Select menu for users and roles
1436
- */
1437
- MentionableSelect = 7,
1438
- /**
1439
- * Select menu for channels
1440
- */
1441
- ChannelSelect = 8
1442
- }
1443
- /**
1444
- * https://discord.com/developers/docs/interactions/message-components#action-rows
1445
- */
1446
- export interface APIActionRowComponent<T extends APIActionRowComponentTypes> extends APIBaseComponent<ComponentType.ActionRow> {
1447
- /**
1448
- * The components in the ActionRow
1449
- */
1450
- components: T[];
1451
- }
1452
- /**
1453
- * https://discord.com/developers/docs/interactions/message-components#buttons
1454
- */
1455
- export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
1456
- /**
1457
- * The label to be displayed on the button
1458
- */
1459
- label?: string;
1460
- /**
1461
- * The style of the button
1462
- */
1463
- style: Style;
1464
- /**
1465
- * The emoji to display to the left of the text
1466
- */
1467
- emoji?: APIMessageComponentEmoji;
1468
- /**
1469
- * The status of the button
1470
- */
1471
- disabled?: boolean;
1472
- }
1473
- export interface APIMessageComponentEmoji {
1474
- /**
1475
- * Emoji id
1476
- */
1477
- id?: Snowflake;
1478
- /**
1479
- * Emoji name
1480
- */
1481
- name?: string;
1482
- /**
1483
- * Whether this emoji is animated
1484
- */
1485
- animated?: boolean;
1486
- }
1487
- export interface APIButtonComponentWithCustomId extends APIButtonComponentBase<ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success> {
1488
- /**
1489
- * The custom_id to be sent in the interaction when clicked
1490
- */
1491
- custom_id: string;
1492
- }
1493
- export interface APIButtonComponentWithURL extends APIButtonComponentBase<ButtonStyle.Link> {
1494
- /**
1495
- * The URL to direct users to when clicked for Link buttons
1496
- */
1497
- url: string;
1498
- }
1499
- export interface APIButtonComponentWithSKUId extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
1500
- /**
1501
- * The id for a purchasable SKU
1502
- */
1503
- sku_id: Snowflake;
1504
- }
1505
- export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithSKUId | APIButtonComponentWithURL;
1506
- /**
1507
- * https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
1508
- */
1509
- export declare enum ButtonStyle {
1510
- Primary = 1,
1511
- Secondary = 2,
1512
- Success = 3,
1513
- Danger = 4,
1514
- Link = 5,
1515
- Premium = 6
1516
- }
1517
- /**
1518
- * https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-styles
1519
- */
1520
- export declare enum TextInputStyle {
1521
- Short = 1,
1522
- Paragraph = 2
1523
- }
1524
- /**
1525
- * https://discord.com/developers/docs/interactions/message-components#select-menus
1526
- */
1527
- export interface APIBaseSelectMenuComponent<T extends ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.StringSelect | ComponentType.UserSelect> extends APIBaseComponent<T> {
1528
- /**
1529
- * A developer-defined identifier for the select menu, max 100 characters
1530
- */
1531
- custom_id: string;
1532
- /**
1533
- * Custom placeholder text if nothing is selected, max 150 characters
1534
- */
1535
- placeholder?: string;
1536
- /**
1537
- * The minimum number of items that must be chosen; min 0, max 25
1538
- *
1539
- * @default 1
1540
- */
1541
- min_values?: number;
1542
- /**
1543
- * The maximum number of items that can be chosen; max 25
1544
- *
1545
- * @default 1
1546
- */
1547
- max_values?: number;
1548
- /**
1549
- * Disable the select
1550
- *
1551
- * @default false
1552
- */
1553
- disabled?: boolean;
1554
- }
1555
- export interface APIBaseAutoPopulatedSelectMenuComponent<T extends ComponentType.ChannelSelect | ComponentType.MentionableSelect | ComponentType.RoleSelect | ComponentType.UserSelect, D extends SelectMenuDefaultValueType> extends APIBaseSelectMenuComponent<T> {
1556
- /**
1557
- * List of default values for auto-populated select menu components
1558
- */
1559
- default_values?: APISelectMenuDefaultValue<D>[];
1560
- }
1561
- /**
1562
- * https://discord.com/developers/docs/interactions/message-components#select-menus
1563
- */
1564
- export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<ComponentType.StringSelect> {
1565
- /**
1566
- * Specified choices in a select menu; max 25
1567
- */
1568
- options: APISelectMenuOption[];
1569
- }
1570
- /**
1571
- * https://discord.com/developers/docs/interactions/message-components#select-menus
1572
- */
1573
- export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.UserSelect, SelectMenuDefaultValueType.User>;
1574
- /**
1575
- * https://discord.com/developers/docs/interactions/message-components#select-menus
1576
- */
1577
- export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.RoleSelect, SelectMenuDefaultValueType.Role>;
1578
- /**
1579
- * https://discord.com/developers/docs/interactions/message-components#select-menus
1580
- */
1581
- export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<ComponentType.MentionableSelect, SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User>;
1582
- /**
1583
- * https://discord.com/developers/docs/interactions/message-components#select-menus
1584
- */
1585
- export interface APIChannelSelectComponent extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
1586
- /**
1587
- * List of channel types to include in the ChannelSelect component
1588
- */
1589
- channel_types?: ChannelType[];
1590
- }
1591
- /**
1592
- * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
1593
- */
1594
- export declare enum SelectMenuDefaultValueType {
1595
- Channel = "channel",
1596
- Role = "role",
1597
- User = "user"
1598
- }
1599
- /**
1600
- * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
1601
- */
1602
- export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
1603
- type: T;
1604
- id: Snowflake;
1605
- }
1606
- export type APIAutoPopulatedSelectMenuComponent = APIChannelSelectComponent | APIMentionableSelectComponent | APIRoleSelectComponent | APIUserSelectComponent;
1607
- /**
1608
- * https://discord.com/developers/docs/interactions/message-components#select-menus
1609
- */
1610
- export type APISelectMenuComponent = APIChannelSelectComponent | APIMentionableSelectComponent | APIRoleSelectComponent | APIStringSelectComponent | APIUserSelectComponent;
1611
- /**
1612
- * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
1613
- */
1614
- export interface APISelectMenuOption {
1615
- /**
1616
- * The user-facing name of the option (max 100 chars)
1617
- */
1618
- label: string;
1619
- /**
1620
- * The dev-defined value of the option (max 100 chars)
1621
- */
1622
- value: string;
1623
- /**
1624
- * An additional description of the option (max 100 chars)
1625
- */
1626
- description?: string;
1627
- /**
1628
- * The emoji to display to the left of the option
1629
- */
1630
- emoji?: APIMessageComponentEmoji;
1631
- /**
1632
- * Whether this option should be already-selected by default
1633
- */
1634
- default?: boolean;
1635
- }
1636
- /**
1637
- * https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure
1638
- */
1639
- export interface APITextInputComponent extends APIBaseComponent<ComponentType.TextInput> {
1640
- /**
1641
- * One of text input styles
1642
- */
1643
- style: TextInputStyle;
1644
- /**
1645
- * The custom id for the text input
1646
- */
1647
- custom_id: string;
1648
- /**
1649
- * Text that appears on top of the text input field, max 45 characters
1650
- */
1651
- label: string;
1652
- /**
1653
- * Placeholder for the text input
1654
- */
1655
- placeholder?: string;
1656
- /**
1657
- * The pre-filled text in the text input
1658
- */
1659
- value?: string;
1660
- /**
1661
- * Minimal length of text input
1662
- */
1663
- min_length?: number;
1664
- /**
1665
- * Maximal length of text input
1666
- */
1667
- max_length?: number;
1668
- /**
1669
- * Whether or not this text input is required or not
1670
- */
1671
- required?: boolean;
1672
- }
1673
- /**
1674
- * https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
1675
- */
1676
- export declare enum ChannelFlags {
1677
- /**
1678
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1679
- */
1680
- GuildFeedRemoved = 1,
1681
- /**
1682
- * This thread is pinned to the top of its parent forum channel
1683
- */
1684
- Pinned = 2,
1685
- /**
1686
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1687
- */
1688
- ActiveChannelsRemoved = 4,
1689
- /**
1690
- * Whether a tag is required to be specified when creating a thread in a forum channel.
1691
- * Tags are specified in the `applied_tags` field
1692
- */
1693
- RequireTag = 16,
1694
- /**
1695
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1696
- */
1697
- IsSpam = 32,
1698
- /**
1699
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1700
- */
1701
- IsGuildResourceChannel = 128,
1702
- /**
1703
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1704
- */
1705
- ClydeAI = 256,
1706
- /**
1707
- * @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
1708
- */
1709
- IsScheduledForDeletion = 512,
1710
- /**
1711
- * Whether media download options are hidden.
1712
- */
1713
- HideMediaDownloadOptions = 32768
1714
- }
1715
- /**
1716
- * https://discord.com/developers/docs/interactions/message-components#message-components
1717
- */
1718
- export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
1719
- export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
1720
- export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent;
1721
- /**
1722
- * https://discord.com/developers/docs/interactions/message-components#message-components
1723
- */
1724
- export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuComponent;
1725
- export type APIModalActionRowComponent = APITextInputComponent;