Skip to content

Commit

Permalink
fix: Fix types to take into account selects (#86)
Browse files Browse the repository at this point in the history
Co-authored-by: Justin Beckwith <[email protected]>
  • Loading branch information
DV8FromTheWorld and JustinBeckwith authored Feb 3, 2025
1 parent 14c553d commit 0e15669
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ export enum MessageComponentTypes {
CHANNEL_SELECT = 8,
}

export type MessageComponent = Button | ActionRow | StringSelect | InputText;
export type MessageComponent =
| ActionRow
| Button
| StringSelect
| UserSelect
| RoleSelect
| MentionableSelect
| ChannelSelect
| InputText;

export enum ButtonStyleTypes {
PRIMARY = 1,
Expand Down Expand Up @@ -65,7 +73,15 @@ export type Button = CustomButton | LinkButton | PremiumButton;
*/
export type ActionRow = {
type: MessageComponentTypes.ACTION_ROW;
components: Exclude<MessageComponent, ActionRow>[];
components: Array<
| Button
| StringSelect
| UserSelect
| RoleSelect
| MentionableSelect
| ChannelSelect
| InputText
>;
};

export type SelectComponentType =
Expand Down

0 comments on commit 0e15669

Please sign in to comment.