v3.5.1 push 2 (fix button color bug)

This commit is contained in:
DJj123dj
2023-12-25 18:56:28 +01:00
parent 795ca4f981
commit 07e2a68d06
+18 -14
View File
@@ -2,22 +2,26 @@ const discord = require("discord.js")
const bot = require("../../index") const bot = require("../../index")
const config = bot.config const config = bot.config
const l = bot.language const l = bot.language
const b = discord.ButtonStyle
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */ /**
* @param {String} color
* @returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
const getColor = (color) => { const getColor = (color) => {
const b = discord.ButtonStyle if (color){
if (color.toLowerCase() == "red"){ if (color.toLowerCase() == "red"){
return b.Danger return b.Danger
}else if (color.toLowerCase() == "green"){ }else if (color.toLowerCase() == "green"){
return b.Success return b.Success
}else if (color.toLowerCase() == "blue" || color.toLowerCase() == "blurple"){ }else if (color.toLowerCase() == "blue" || color.toLowerCase() == "blurple"){
return b.Primary return b.Primary
}else if (color.toLowerCase() == "black" || color.toLowerCase() == "gray" || color.toLowerCase() == "grey"){ }else if (color.toLowerCase() == "black" || color.toLowerCase() == "gray" || color.toLowerCase() == "grey"){
return b.Secondary return b.Secondary
}else if (color == "DANGER" || color == "SECONDARY" || color == "SUCCESS" || color == "PRIMARY"){ }else if (color.toUpperCase() == "DANGER" || color.toUpperCase() == "SECONDARY" || color.toUpperCase() == "SUCCESS" || color.toUpperCase() == "PRIMARY"){
return color return color
}else if (color.toLowerCase() == "none" || color.toLowerCase() == "false" || color.toLowerCase() == ""){ }else if (color.toLowerCase() == "none" || color.toLowerCase() == "false" || color.toLowerCase() == ""){
return b.Secondary return b.Secondary
}else return b.Secondary
}else return b.Secondary }else return b.Secondary
} }