From 62c861e9d5ae34b2f549645f96321d9f58466a86 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Tue, 17 Nov 2020 17:08:06 -0700 Subject: [PATCH] Fix n?eval error outputting --- commands/eval.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/commands/eval.js b/commands/eval.js index 75ae8bd..cfdfa58 100644 --- a/commands/eval.js +++ b/commands/eval.js @@ -1,4 +1,5 @@ const Discord = require('discord.js'); +const chalk = require('chalk'); module.exports = { name: 'eval', @@ -24,11 +25,11 @@ module.exports = { .setColor('c375f0') .setFooter(`Natsuki`, client.user.avatarURL()) .setTimestamp()) - }); + }).catch(error => {return message.channel.send(`Error: \`${error}\`.`);}); } catch (error) { - //let date = new Date; date = date.toString().slice(date.toString().search(":") - 2, date.toString().search(":") + 6); - //console.error(`\n${chalk.red('[ERROR]')} >> ${chalk.yellow(`At [${date}] | Occurred while trying to run n?eval`)}`, error); + let date = new Date; date = date.toString().slice(date.toString().search(":") - 2, date.toString().search(":") + 6); + console.error(`\n${chalk.red('[ERROR]')} >> ${chalk.yellow(`At [${date}] | Occurred while trying to run n?eval`)}`, error); return message.channel.send(`Error: \`${error}\`.`); - }; + } }, }; \ No newline at end of file