From c0985b22c4f08ee4a2677d1d05c5a6e4869a3ce1 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Tue, 18 Feb 2020 19:48:11 +0100 Subject: [PATCH] Send error to error channel --- event/listeners/error.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/event/listeners/error.js b/event/listeners/error.js index 4ff8f5cc..0ed1d91e 100644 --- a/event/listeners/error.js +++ b/event/listeners/error.js @@ -1,6 +1,7 @@ const { Listener } = require('discord-akairo'); const mkdirp = require('mkdirp'); const fs = require('fs'); +const { errorChannel } = require('../../config.json'); class errorListener extends Listener { constructor() { @@ -11,7 +12,16 @@ class errorListener extends Listener { } async exec(message, error, command) { + console.log(message); console.error(`Error happenend on the command: ${command.id}\n${message}\nOn the message: ${error}`); + const channel = this.client.channels.get(errorChannel); + const errorEmbed = this.client.util.embed() + .setColor('RED') + .setTitle('Shit happened!') + .addField('Command', command.id, true) + .addField('Error', message, true) + .addField('Message', error, true); + channel.send(errorEmbed); //Get current date let today = new Date(); let dd = today.getDate();