From 8c5818c57d1d556e11c7ed297ad499b1ee8c333f Mon Sep 17 00:00:00 2001 From: 1computer1 <22125769+1Computer1@users.noreply.github.com> Date: Wed, 17 Jun 2020 04:39:07 -0400 Subject: [PATCH] log: add more logging --- src/index.js | 9 ++++++--- src/listeners/messageInvalid.js | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 7c70a9b..49ebdec 100644 --- a/src/index.js +++ b/src/index.js @@ -1,14 +1,17 @@ const CompilerClient = require('./struct/CompilerClient'); const config = require('../config.json'); const client = new CompilerClient(config); + client.once('ready', () => { + // eslint-disable-next-line no-console + console.log('[Info] Comp_iler ready to go!'); +}); + +client.on('ready', () => { client.user.setPresence({ activity: { name: '@Comp_iler help' }, status: 'online' }); - - // eslint-disable-next-line no-console - console.log('Comp_iler ready to go!'); }); client.start(); diff --git a/src/listeners/messageInvalid.js b/src/listeners/messageInvalid.js index c424a83..a84eb3b 100644 --- a/src/listeners/messageInvalid.js +++ b/src/listeners/messageInvalid.js @@ -31,6 +31,8 @@ class MessageInvalidListener extends Listener { } } + const place = message.guild ? message.guild.id : 'DMs'; + console.log(`[Info] User ${message.author.id} in ${place} (${parse.language}):\n${parse.code}`); const [ok, response] = await this.client.myriad.postEval(parse.language, parse.code); if (!message.guild || message.channel.permissionsFor(this.client.user).has('ADD_REACTIONS')) { try {