From b0e158de84c16037dbc76a0aa3a8e321da6fd2f1 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Thu, 1 Dec 2022 17:15:30 +0700 Subject: [PATCH] discord embeds color config --- commands/botuser.js | 4 ++-- commands/botvisibility.js | 8 +++---- commands/bruhify.js | 4 ++-- commands/changelog.js | 4 ++-- commands/cloop.js | 14 ++++++------ commands/cowsay.js | 2 +- commands/creator.js | 4 ++-- commands/eval.js | 4 ++-- commands/help.js | 6 ++--- commands/list.js | 4 ++-- commands/music.js | 46 +++++++++++++++++++-------------------- commands/servereval.js | 4 ++-- commands/test.js | 4 ++-- commands/time.js | 6 ++--- commands/translate.js | 6 ++--- commands/uptime.js | 4 ++-- commands/uuid.js | 4 ++-- commands/wikipedia.js | 6 ++--- config.js | 4 ++++ plugins/commands.js | 2 +- 20 files changed, 72 insertions(+), 68 deletions(-) diff --git a/commands/botuser.js b/commands/botuser.js index 3ae4a55..d4e2092 100644 --- a/commands/botuser.js +++ b/commands/botuser.js @@ -9,9 +9,9 @@ module.exports = { execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { bot.tellraw(selector, [{ text: 'The bot\'s username is: ', color: 'white' }, { text: `${bot.username}`, color: 'gold', clickEvent: { action: 'copy_to_clipboard', value: `${bot.username}` }, hoverEvent: { action: 'show_text', contents: [{ text: 'Click here to copy the username to your clipboard', color: 'green' }] } }, { text: ' and the UUID is: ' }, { text: `${bot.uuid}`, color: 'aqua', clickEvent: { action: 'copy_to_clipboard', value: `${bot.uuid}` }, hoverEvent: { action: 'show_text', contents: [{ text: 'Click here to copy the UUID to your clipboard', color: 'green' }] } }]) }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Bot\'s User') .setDescription(`The bot's username is: \`${bot.username}\` and the UUID is: \`${bot.uuid}\``) channeldc.send({ embeds: [Embed] }) diff --git a/commands/botvisibility.js b/commands/botvisibility.js index 7572a27..dab76f5 100644 --- a/commands/botvisibility.js +++ b/commands/botvisibility.js @@ -30,12 +30,12 @@ module.exports = { throw new SyntaxError('Invalid argument') } }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { if (args[0] === 'true' || args[0] === 'on') { bot.visibility = true bot.chat('/essentials:vanish disable') const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Bot\'s Visibility') .setDescription('The bot\'s visibility is now visible') channeldc.send({ embeds: [Embed] }) @@ -43,7 +43,7 @@ module.exports = { bot.visibility = false bot.chat('/essentials:vanish enable') const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Bot\'s Visibility') .setDescription('The bot\'s visibility is now invisible') channeldc.send({ embeds: [Embed] }) @@ -53,7 +53,7 @@ module.exports = { const enableOrDisable = bot.visibility ? 'disable' : 'enable' bot.chat(`/essentials:vanish ${enableOrDisable}`) const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Bot\'s Visibility') .setDescription(`The bot's visibility is now ${visibleOrInvisible}`) channeldc.send({ embeds: [Embed] }) diff --git a/commands/bruhify.js b/commands/bruhify.js index 28da198..a380752 100644 --- a/commands/bruhify.js +++ b/commands/bruhify.js @@ -9,10 +9,10 @@ module.exports = { execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { bot.bruhifyText = args.join(' ') }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { bot.bruhifyText = args.join(' ') const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Bruhify') .setDescription(`Bruhify set to: ${bot.bruhifyText}`) channeldc.send({ embeds: [Embed] }) diff --git a/commands/changelog.js b/commands/changelog.js index bffd935..3e8001f 100644 --- a/commands/changelog.js +++ b/commands/changelog.js @@ -27,14 +27,14 @@ module.exports = { bot.tellraw(selector, component) }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { let changelogs = '' changelog.forEach((message, number) => { number += 1 changelogs += `\`${number}\` - \`${message}\`` + '\n' }) const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle(`Changelogs (${changelog.length})`) .setDescription(changelogs) channeldc.send({ embeds: [Embed] }) diff --git a/commands/cloop.js b/commands/cloop.js index 22255c6..f4f1f43 100644 --- a/commands/cloop.js +++ b/commands/cloop.js @@ -16,7 +16,7 @@ function clear (bot) { bot.cloops = [] } -function list (bot, discord, channeldc, selector) { +function list (bot, discord, channeldc, selector, config) { const message = [] if (discord) { @@ -32,7 +32,7 @@ function list (bot, discord, channeldc, selector) { message.pop() const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Cloops') .setDescription(message.join('')) channeldc.send({ embeds: [Embed] }) @@ -84,29 +84,29 @@ module.exports = { throw new SyntaxError('Invalid argument') } }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { if (!bot.cloops) bot.cloops = [] if (args[0] === 'add' && args[2]) { if (!Number(args[1]) && Number(args[1]) !== 0) throw new SyntaxError('Invalid interval') add(args.slice(2).join(' '), args[1], bot) const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Cloop') .setDescription(`Added cloop \`${args.slice(2).join(' ')}\` with interval ${args[1]} to the cloops`) channeldc.send({ embeds: [Embed] }) } else if (args[0] === 'list') { - list(bot, true, channeldc) + list(bot, true, channeldc, '@a', config) } else if (args[0] === 'remove') { remove(args[1], bot) const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Cloop') .setDescription(`Removed cloop \`${args[1]}\``) channeldc.send({ embeds: [Embed] }) } else if (args[0] === 'removeall') { clear(bot) const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Cloop') .setDescription('Removed all looped commands') channeldc.send({ embeds: [Embed] }) diff --git a/commands/cowsay.js b/commands/cowsay.js index 74276c6..5caa32b 100644 --- a/commands/cowsay.js +++ b/commands/cowsay.js @@ -36,7 +36,7 @@ module.exports = { }, discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Cowsay') .setDescription(cowsay.say(args.slice(1).join(' '), { cow: cows[args[0]] })) channeldc.send({ embeds: [Embed] }) diff --git a/commands/creator.js b/commands/creator.js index d71166c..9877293 100644 --- a/commands/creator.js +++ b/commands/creator.js @@ -9,9 +9,9 @@ module.exports = { execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { bot.tellraw(selector, [{ text: 'ChomeNS Bot ', color: 'yellow' }, { text: 'was created by ', color: 'white' }, { text: 'chayapak', color: 'gold' }]) }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Creator') .setDescription('ChomeNS Bot was created by chayapak') channeldc.send({ embeds: [Embed] }) diff --git a/commands/eval.js b/commands/eval.js index 1b194c7..276af1c 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -43,7 +43,7 @@ module.exports = { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { if (args[0] === 'run') { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Output') .setDescription(`\`\`\`${util.inspect(bot.vm.run(args.slice(1).join(' '))).substring(0, 1950)}\`\`\``) channeldc.send({ embeds: [Embed] }) @@ -57,7 +57,7 @@ module.exports = { code: args[1] })).then((res) => { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Output') .setDescription(`\`\`\`${res.data}\`\`\``) channeldc.send({ embeds: [Embed] }) diff --git a/commands/help.js b/commands/help.js index 20d7d42..8cb07d7 100644 --- a/commands/help.js +++ b/commands/help.js @@ -97,7 +97,7 @@ module.exports = { bot.tellraw(selector, [pre, generalCommands, trustedCommands, ownerCommands]) } }, - discordExecute: async function (bot, username, usernameraw, sender, prefix, args, channeldc) { + discordExecute: async function (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { if (args[0]) { for (const command of bot.command_handler.commands) { function run () { @@ -107,7 +107,7 @@ module.exports = { alias = command.alias.join(', ') } const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle(`${prefix + command.name} (${alias}) - ${command.description}`) .setDescription(`Trust level: ${command.trusted} Supported: ${command.discordExecute ? 'true' : 'false'} @@ -133,7 +133,7 @@ module.exports = { unsupportedCommands += command.name + ' ' } const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle(`Commands (Length: ${bot.command_handler.commands.length})`) .setDescription('**Supported Commands**\n' + supportedCommands + '\n**Unsupported Commands**\n' + unsupportedCommands) channeldc.send({ embeds: [Embed] }) diff --git a/commands/list.js b/commands/list.js index 18c2bae..f64e12d 100644 --- a/commands/list.js +++ b/commands/list.js @@ -58,7 +58,7 @@ module.exports = { } }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { try { let players = '' for (const property of bot.players.list) { @@ -66,7 +66,7 @@ module.exports = { players += `\`${property.name}\` › \`${property.UUID}\`` + '\n' } const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle(`Players (${bot.players.list.length})`) .setDescription(players.substring(0, 4096)) channeldc.send({ embeds: [Embed] }) diff --git a/commands/music.js b/commands/music.js index 87da1e4..cdb52e3 100644 --- a/commands/music.js +++ b/commands/music.js @@ -19,7 +19,7 @@ if (os.hostname() === 'chomens-kubuntu') { let song -async function play (bot, values, discord, channeldc, selector) { +async function play (bot, values, discord, channeldc, selector, config) { try { const filepath = values.join(' ') const absolutePath = await resolve(filepath) @@ -28,7 +28,7 @@ async function play (bot, values, discord, channeldc, selector) { bot.music.play(song) if (discord) { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Music') .setDescription(`Added ${song.name} to the song queue`) channeldc.send({ embeds: [Embed] }) @@ -38,7 +38,7 @@ async function play (bot, values, discord, channeldc, selector) { } catch (e) { if (discord) { const Embed = new MessageEmbed() - .setColor('#FF0000') + .setColor(config.discord.embedsColors.error) .setTitle('Error') .setDescription('```SyntaxError: Invalid file```') channeldc.send({ embeds: [Embed] }) @@ -48,7 +48,7 @@ async function play (bot, values, discord, channeldc, selector) { } } -async function playUrl (bot, values, discord, channeldc, selector) { +async function playUrl (bot, values, discord, channeldc, selector, config) { try { const url = values.join(' ') const response = await axios.get('https://http-proxy.nongsonchome.repl.co', { @@ -62,7 +62,7 @@ async function playUrl (bot, values, discord, channeldc, selector) { bot.music.play(song) if (discord) { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Music') .setDescription(`Added ${song.name} to the song queue`) channeldc.send({ embeds: [Embed] }) @@ -72,7 +72,7 @@ async function playUrl (bot, values, discord, channeldc, selector) { } catch (e) { if (discord) { const Embed = new MessageEmbed() - .setColor('#FF0000') + .setColor(config.discord.embedsColors.error) .setTitle('Error') .setDescription('```SyntaxError: Invalid URL```') channeldc.send({ embeds: [Embed] }) @@ -89,7 +89,7 @@ async function resolve (filepath) { return filepath } -async function list (bot, discord, channeldc, prefix, selector, args) { +async function list (bot, discord, channeldc, prefix, selector, args, config) { try { let absolutePath if (args[1]) absolutePath = await resolve(path.join(SONGS_PATH, args.slice(1).join(' '))) @@ -101,7 +101,7 @@ async function list (bot, discord, channeldc, prefix, selector, args) { if (discord) { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Songs') .setDescription(listed.join(', ')) channeldc.send({ embeds: [Embed] }) @@ -136,7 +136,7 @@ async function list (bot, discord, channeldc, prefix, selector, args) { } catch (e) { if (discord) { const Embed = new MessageEmbed() - .setColor('#FF0000') + .setColor(config.discord.embedsColors.error) .setTitle('Error') .setDescription(`\`\`\`${e.toString()}\`\`\``) channeldc.send({ embeds: [Embed] }) @@ -164,10 +164,10 @@ module.exports = { execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { switch (args[0]) { case 'play': - play(bot, args.slice(1), false, null, selector) + play(bot, args.slice(1), false, null, selector, config) break case 'playurl': - playUrl(bot, args.slice(1), false, null, selector) + playUrl(bot, args.slice(1), false, null, selector, config) break case 'stop': try { @@ -222,7 +222,7 @@ module.exports = { } break case 'list': - list(bot, false, null, prefix, selector, args) + list(bot, false, null, prefix, selector, args, config) break case 'nowplaying': bot.tellraw(selector, [ @@ -253,19 +253,19 @@ module.exports = { throw new SyntaxError('Invalid argument') } }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { let Embed switch (args[0]) { case 'play': - play(bot, args.slice(1), true, channeldc) + play(bot, args.slice(1), true, channeldc, config) break case 'playurl': - playUrl(bot, args.slice(1), true, channeldc) + playUrl(bot, args.slice(1), true, channeldc, config) break case 'stop': try { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Stop') .setDescription('Cleared the song queue') channeldc.send({ embeds: [Embed] }) @@ -277,7 +277,7 @@ module.exports = { case 'skip': try { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Skip') .setDescription(`Skipping ${bot.music.song.name}`) channeldc.send({ embeds: [Embed] }) @@ -291,7 +291,7 @@ module.exports = { case 'off': bot.music.loop = 0 Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Loop') .setDescription('Looping is now disabled') channeldc.send({ embeds: [Embed] }) @@ -299,7 +299,7 @@ module.exports = { case 'current': bot.music.loop = 1 Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Loop') .setDescription(`Now looping ${song.name}`) channeldc.send({ embeds: [Embed] }) @@ -307,7 +307,7 @@ module.exports = { case 'all': bot.music.loop = 2 Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Loop') .setDescription('Now looping every song in the queue') channeldc.send({ embeds: [Embed] }) @@ -315,11 +315,11 @@ module.exports = { } break case 'list': - list(bot, true, channeldc, prefix, '@a', args) + list(bot, true, channeldc, prefix, '@a', args, config) break case 'nowplaying': Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Now playing') .setDescription(`Now playing ${bot.music.song.name}`) channeldc.send({ embeds: [Embed] }) @@ -328,7 +328,7 @@ module.exports = { const queueWithName = [] bot.music.queue.forEach((song) => queueWithName.push(song.name)) Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Queue') .setDescription(queueWithName.join(', ')) channeldc.send({ embeds: [Embed] }) diff --git a/commands/servereval.js b/commands/servereval.js index ea36234..1338bd2 100644 --- a/commands/servereval.js +++ b/commands/servereval.js @@ -19,13 +19,13 @@ module.exports = { discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { try { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Output') .setDescription(util.inspect(eval(args.join(' ')), { stylize })) channeldc.send({ embeds: [Embed] }) } catch (err) { const Embed = new MessageEmbed() - .setColor('#FF0000') + .setColor(config.discord.embedsColors.error) .setTitle('Error') .setDescription(`\`\`\`${util.inspect(err).replaceAll('runner', 'chayapak1')}\`\`\``) channeldc.send({ embeds: [Embed] }) diff --git a/commands/test.js b/commands/test.js index 540e378..93aa790 100644 --- a/commands/test.js +++ b/commands/test.js @@ -30,9 +30,9 @@ module.exports = { } ]) }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Hello!') .setDescription('This is the first ever command to be discordified!' + '\n' + `More info: Username: ${username}, Prefix: ${prefix}, Args: ${args.join(' ')}`) channeldc.send({ embeds: [Embed] }) diff --git a/commands/time.js b/commands/time.js index 3968ed1..346a3a3 100644 --- a/commands/time.js +++ b/commands/time.js @@ -19,13 +19,13 @@ module.exports = { bot.tellraw(selector, component) } }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { const timezone = args.join(' ') const momented = moment().tz(timezone).format('dddd, MMMM Do, YYYY, hh:mm:ss A') const description = `The current date and time for the timezone ${timezone} is: ${momented}` if (timezone.toLowerCase() === 'asia/bangkok' || timezone.toLowerCase() === 'utc') { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Time') .setDescription(description) channeldc.send({ embeds: [Embed] }) @@ -33,7 +33,7 @@ module.exports = { throw new SyntaxError('Invalid timezone') } else { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Time') .setDescription(description) channeldc.send({ embeds: [Embed] }) diff --git a/commands/translate.js b/commands/translate.js index 72e7a41..b73fcc7 100644 --- a/commands/translate.js +++ b/commands/translate.js @@ -15,17 +15,17 @@ module.exports = { bot.tellraw(selector, { text: String(e), color: 'red' }) } }, - discordExecute: async function (bot, username, usernameraw, sender, prefix, args, channeldc, message) { + discordExecute: async function (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { try { const res = await translate(args.slice(2).join(' '), { from: args[0], to: args[1] }) const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Result') .setDescription(res.text) channeldc.send({ embeds: [Embed] }) } catch (e) { const Embed = new MessageEmbed() - .setColor('#FF0000') + .setColor(config.discord.embedsColors.error) .setTitle('Error') .setDescription(`\`\`\`${e}\`\`\``) channeldc.send({ embeds: [Embed] }) diff --git a/commands/uptime.js b/commands/uptime.js index 6c50c53..9d660b3 100644 --- a/commands/uptime.js +++ b/commands/uptime.js @@ -10,9 +10,9 @@ module.exports = { execute (bot, username, usernameraw, sender, prefix, args, config, hash, ownerhash, selector) { bot.tellraw(selector, [{ text: 'The bot\'s uptime is ', color: 'white' }, { text: `${secondsToHms(Math.floor(performance.now() / 1000))}`, color: 'green' }]) }, - discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message) { + discordExecute (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Bot\'s Uptime') .setDescription(`The bot's uptime is ${secondsToHms(Math.floor(performance.now() / 1000))}`) channeldc.send({ embeds: [Embed] }) diff --git a/commands/uuid.js b/commands/uuid.js index 0066db6..9db586e 100644 --- a/commands/uuid.js +++ b/commands/uuid.js @@ -68,13 +68,13 @@ module.exports = { const player = bot.playersAddedPlayers[playername] if (player === undefined) throw new SyntaxError('Invalid UUID') const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('UUID') .setDescription(`${playername}'s UUID: ${player}`) channeldc.send({ embeds: [Embed] }) } else { const Embed = new MessageEmbed() - .setColor('#FF0000') + .setColor(config.discord.embedsColors.error) .setTitle('Error') .setDescription('Invalid player name') channeldc.send({ embeds: [Embed] }) diff --git a/commands/wikipedia.js b/commands/wikipedia.js index f3ea2e0..012c0b1 100644 --- a/commands/wikipedia.js +++ b/commands/wikipedia.js @@ -17,18 +17,18 @@ module.exports = { bot.tellraw(selector, { text: e.toString(), color: 'red' }) } }, - discordExecute: async function (bot, username, usernameraw, sender, prefix, args, channeldc) { + discordExecute: async function (bot, username, usernameraw, sender, prefix, args, channeldc, message, config) { try { const page = await wiki.page(args.join(' ')) const summary = await page.summary() const Embed = new MessageEmbed() - .setColor('#FFFF00') + .setColor(config.discord.embedsColors.normal) .setTitle('Output') .setDescription(summary.extract) channeldc.send({ embeds: [Embed] }) } catch (e) { const Embed = new MessageEmbed() - .setColor('#FF0000') + .setColor(config.discord.embedsColors.error) .setTitle('Error') .setDescription(`\`\`\`${util.inspect(e)}\`\`\``) channeldc.send({ embeds: [Embed] }) diff --git a/config.js b/config.js index 9db97cf..a698139 100644 --- a/config.js +++ b/config.js @@ -53,6 +53,10 @@ module.exports = { 'mc.chomens41793.ga': '1010734897796763758', 'real.chipmunk.land': '1042590315464364032' }, + embedsColors: { + normal: '#FFFF00', + error: '#FF0000' + }, prefix: '!' }, servers: [ diff --git a/plugins/commands.js b/plugins/commands.js index a0751ba..2b2e891 100644 --- a/plugins/commands.js +++ b/plugins/commands.js @@ -47,7 +47,7 @@ function inject (bot, dcclient, config) { } catch (e) { if (prefix === config.discord.prefix) { const Embed = new MessageEmbed() - .setColor('#FF0000') + .setColor(config.discord.embedsColors.error) .setTitle('Error') .setDescription(`\`\`\`${e}\`\`\``) channeldc.send({ embeds: [Embed] })