diff --git a/types/discordeno.ts b/types/discordeno.ts index f61432c47..3c88f6e92 100644 --- a/types/discordeno.ts +++ b/types/discordeno.ts @@ -6,7 +6,7 @@ export type MessageComponents = ActionRow[]; /** https://discord.com/developers/docs/interactions/message-components#actionrow */ export interface ActionRow { /** Action rows are a group of buttons. */ - type: 1; + type: MessageComponentTypes.ActionRow; /** The components in this row */ components: | [SelectMenuComponent | ButtonComponent | InputTextComponent] @@ -16,21 +16,7 @@ export interface ActionRow { | [ButtonComponent, ButtonComponent, ButtonComponent, ButtonComponent, ButtonComponent]; } -export interface SelectMenuComponent { - type: MessageComponentTypes.SelectMenu; - /** A custom identifier for this component. Maximum 100 characters. */ - customId: string; - /** A custom placeholder text if nothing is selected. Maximum 150 characters. */ - placeholder?: string; - /** The minimum number of items that must be selected. Default 1. Between 1-25. */ - minValues?: number; - /** The maximum number of items that can be selected. Default 1. Between 1-25. */ - maxValues?: number; - /** The choices! Maximum of 25 items. */ - options: SelectOption[]; -} - -/** https://discord.com/developers/docs/interactions/message-components#buttons-button-object */ +/** https://discord.com/developers/docs/interactions/message-components#button-object-button-structure */ export interface ButtonComponent { /** All button components have type 2 */ type: MessageComponentTypes.Button; @@ -55,9 +41,25 @@ export interface ButtonComponent { disabled?: boolean; } +/** https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-menu-structure */ +export interface SelectMenuComponent { + /** SelectMenu Component is of type 3 */ + type: MessageComponentTypes.SelectMenu; + /** A custom identifier for this component. Maximum 100 characters. */ + customId: string; + /** A custom placeholder text if nothing is selected. Maximum 150 characters. */ + placeholder?: string; + /** The minimum number of items that must be selected. Default 1. Between 1-25. */ + minValues?: number; + /** The maximum number of items that can be selected. Default 1. Between 1-25. */ + maxValues?: number; + /** The choices! Maximum of 25 items. */ + options: SelectOption[]; +} + /** https://discord.com/developers/docs/interactions/message-components#text-inputs-text-input-structure */ export interface InputTextComponent { - /** InputText Component is of type 3 */ + /** InputText Component is of type 4 */ type: MessageComponentTypes.InputText; /** The style of the InputText */ style: TextStyles;