From 1966e6574280adc43f18979a72fb575b8f8c1270 Mon Sep 17 00:00:00 2001 From: chris062689 Date: Thu, 30 Mar 2017 21:29:32 -0400 Subject: [PATCH 1/2] Removed logging from Github module as we're now logging in server.js for triggers. --- triggers/github.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/triggers/github.js b/triggers/github.js index 2ea8b1a..0d172af 100644 --- a/triggers/github.js +++ b/triggers/github.js @@ -27,8 +27,6 @@ exports.execute = function(message) { request(url, function (error, response, body) { if (!error && response.statusCode == 200) { message.channel.sendMessage(`Github Pull Request: ${url}`); - } else { - logger.info(`PR #{issue} does not exist.`) } }); From a5b2f8d59f9fbe71650bb33d3d5a2fe017add124 Mon Sep 17 00:00:00 2001 From: chris062689 Date: Thu, 30 Mar 2017 21:29:52 -0400 Subject: [PATCH 2/2] Logging triggers in server.js, now caching triggers like we cache modules. --- server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 6a7661b..f05b3f4 100644 --- a/server.js +++ b/server.js @@ -55,7 +55,7 @@ client.on('message', message => { return false; } - logger.info(`${message.author.username} ${message.author} [Channel: ${message.channel}] triggered command: ${message.content}`); + logger.info(`${message.author.username} ${message.author} [Channel: ${message.channel}] executed command: ${message.content}`); message.delete(); try { @@ -80,6 +80,7 @@ client.on('message', message => { cachedTriggers.forEach(function(trigger) { if (trigger.roles == undefined || findArray(message.member.roles.map(function(x) { return x.name; }), trigger.roles)) { if (trigger.trigger(message) == true) { + logger.info(`${message.author.username} ${message.author} [Channel: ${message.channel}] triggered: ${message.content}`); try { trigger.execute(message); } catch (err) { logger.error(err); } @@ -105,7 +106,7 @@ require("fs").readdirSync('./triggers/').forEach(function(file) { // Load the trigger if it's a script. if (path.extname(file) == '.js') { logger.info(`Loaded trigger: ${file}`); - cachedTriggers.push(require(`./triggers/${file}`)); + cachedTriggers[file] = require(`./triggers/${file}`); } });