diff --git a/example/src/configs/templateConf.json b/example/src/configs/templateConf.json index 445b5e8a..f31ee39f 100755 --- a/example/src/configs/templateConf.json +++ b/example/src/configs/templateConf.json @@ -1,7 +1,7 @@ { "embed": { "colors": { - "help": "", + "help": "ffffff", "global": 4315874, "error": 15844367 } diff --git a/src/AxonClient.js b/src/AxonClient.js index cb2f9dbd..2f80acad 100755 --- a/src/AxonClient.js +++ b/src/AxonClient.js @@ -736,9 +736,9 @@ class AxonClient extends EventEmitter { text: 'Runs with AxonCore', }; - // eslint-disable-next-line no-nested-ternary - embed.color = isNaN(this.template.embed.colors.help) - ? this.template.embed.colors.help.length > 0 ? parseInt(this.template.embed.colors.help, 10) : null + + embed.color = typeof this.template.embed.colors.help === 'string' + ? parseInt(this.template.embed.colors.help, 16) || null : this.template.embed.colors.help; let commandList = ''; diff --git a/src/Structures/Command.js b/src/Structures/Command.js index c0b5797f..dd203756 100755 --- a/src/Structures/Command.js +++ b/src/Structures/Command.js @@ -344,9 +344,8 @@ class Command extends Base { icon_url: this.bot.user.avatarURL, }; - // eslint-disable-next-line no-nested-ternary - embed.color = isNaN(this.template.embed.colors.help) - ? this.template.embed.colors.help.length > 0 ? parseInt(this.template.embed.colors.help, 10) : null + embed.color = typeof this.template.embed.colors.help === 'string' + ? parseInt(this.template.embed.colors.help, 16) || null : this.template.embed.colors.help; embed.description = `**Description:** ${this.infos.description}\n`;