From c4e54c1a8aa29ad787b484a26faa9a2f8c70bd28 Mon Sep 17 00:00:00 2001 From: Lordex <130374125+LordexDuck3990@users.noreply.github.com> Date: Mon, 27 Nov 2023 22:48:42 +0200 Subject: [PATCH] update 3 --- src/handler/parsers.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/handler/parsers.js b/src/handler/parsers.js index 62448b771..b5815a343 100644 --- a/src/handler/parsers.js +++ b/src/handler/parsers.js @@ -248,20 +248,20 @@ module.exports = { let components = []; if (Checker("button")) { - var buttons = element.split("{button:").slice(1); + let buttons = element.split("{button:").slice(1); for (let params of buttons) { params = params?.split("}")[0]?.split(":").map((param) => param?.addBrackets()?.trim()); - var button = { + let button = { type: 2 }; - var label = params?.shift(); - var style = params?.shift(); - var IDorURL = params?.shift(); - var disabled = checkBoolean(params?.shift(), false); - var emoji = params.length !== 0 ? params.join(":") : undefined; + const label = params?.shift(); + let style = params?.shift(); + const IDorURL = params?.shift(); + const disabled = checkBoolean(params?.shift(), false); + let emoji = params.length !== 0 ? params.join(":") : undefined; style = ButtonStyleOptions[style] || style; @@ -316,7 +316,7 @@ module.exports = { }; if (options.includes("{selectMenuOptions:") || options.includes("{selectMenuOption:") || options.includes("{option:")) { - var smosORsmORo = "selectMenuOptions"; + let smosORsmORo = "selectMenuOptions"; if (options.includes("{selectMenuOption:")) smosORsmORo = "selectMenuOption"; else if (options.includes("{option:")) @@ -333,7 +333,7 @@ module.exports = { const value = option?.shift()?.trim(); const description = option?.shift()?.trim(); const def = checkBoolean(option?.shift()?.trim(), false); - const emoji = option.length !== 0 ? option?.join(":")?.trim()?.addBrackets() : undefined; + let emoji = option.length !== 0 ? option?.join(":")?.trim()?.addBrackets() : undefined; if (emoji) { let [animated, name, id] = emoji.split(":"); @@ -462,7 +462,7 @@ module.exports = { }; const label = option?.shift(); - var style = option?.shift(); + let style = option?.shift(); style = isNaN(style) ? style : Number(style); const ID = option?.shift(); const required = checkBoolean(option?.shift()) ?? undefined;