diff options
| -rw-r--r-- | bot.js | 6 | ||||
| -rw-r--r-- | events/message.js | 1 |
2 files changed, 5 insertions, 2 deletions
@@ -12,8 +12,8 @@ bot.queue = new Discord.Collection(); bot.plugins = { music : require('./Plugins/Music.js') , economy : require('./Plugins/Economy.js'), settings : require('./Plugins/settings.js')}; cmdLoader(); -const Raven = require('raven'); -Raven.config(config.sentry).install(); +bot.Raven = require('raven'); +bot.Raven.config(config.sentry).install(); async function cmdLoader() { const categories = await fs.readdirSync('./commands'); @@ -53,6 +53,7 @@ async function loadCmd(category, cmd) { catch (err) { console.log(`An error has occured trying to load the command '${cmd.split('.')[0]}'`); console.log(err.stack); + bot.Raven.captureException(err); } } @@ -71,6 +72,7 @@ fs.readdir('./events', (err, files) => { catch (err) { console.log('An error has occured trying to load a event. Here is the error.'); console.log(err.stack); + bot.Raven.captureException(err); } }); console.log('Event Loading complete!'); diff --git a/events/message.js b/events/message.js index dfe7c72..4154536 100644 --- a/events/message.js +++ b/events/message.js @@ -72,6 +72,7 @@ function parseCommand(bot, msg) { } catch (e) { console.error(e.stack); + bot.Raven.captureException(e); msg.channel.send('There was an error trying to process your command. Don\'t worry because this issue is being looked into'); } } |
