Skip to content

Commit

Permalink
update 3
Browse files Browse the repository at this point in the history
  • Loading branch information
devlordduck authored Nov 27, 2023
1 parent ae14c78 commit c4e54c1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/handler/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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:"))
Expand All @@ -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(":");
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c4e54c1

Please sign in to comment.