v3.5.1 push 2 (fix button color bug)
This commit is contained in:
@@ -2,10 +2,13 @@ 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
|
||||||
|
|
||||||
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
|
||||||
const getColor = (color) => {
|
|
||||||
const b = discord.ButtonStyle
|
const b = discord.ButtonStyle
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {String} color
|
||||||
|
* @returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
||||||
|
const getColor = (color) => {
|
||||||
|
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"){
|
||||||
@@ -14,11 +17,12 @@ const getColor = (color) => {
|
|||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
const getOption = (id) => {
|
const getOption = (id) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user