From 33bb2ee196c68bfa588e31618702339cc17b8565 Mon Sep 17 00:00:00 2001 From: Crawron Date: Thu, 21 Jul 2022 16:12:18 -0500 Subject: [PATCH] use enums instead of strings for component type --- packages/reacord/library/core/reacord-discord-js.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/reacord/library/core/reacord-discord-js.ts b/packages/reacord/library/core/reacord-discord-js.ts index daab8c8..133b2a1 100644 --- a/packages/reacord/library/core/reacord-discord-js.ts +++ b/packages/reacord/library/core/reacord-discord-js.ts @@ -342,12 +342,12 @@ function getDiscordMessageOptions( content: reacordOptions.content || null, embeds: reacordOptions.embeds, components: reacordOptions.actionRows.map((row) => ({ - type: "ACTION_ROW", + type: Discord.ComponentType.ActionRow, components: row.map( (component): Discord.MessageActionRowComponentOptions => { if (component.type === "button") { return { - type: "BUTTON", + type: Discord.ComponentType.Button, customId: component.customId, label: component.label ?? "", style: convertButtonStyleToEnum(component.style), @@ -359,7 +359,7 @@ function getDiscordMessageOptions( if (component.type === "select") { return { ...component, - type: "SELECT_MENU", + type: Discord.ComponentType.SelectMenu, options: component.options.map((option) => ({ ...option, default: component.values?.includes(option.value),