diff --git a/modules/log/log.js b/modules/log/log.js index 2515e0b..762fe82 100644 --- a/modules/log/log.js +++ b/modules/log/log.js @@ -5,6 +5,8 @@ var _ = require('underscore')._; var log = function(dbot) { + this.ignoredCommands = []; + this.api = { 'log': function(server, user, message) { var logChannel = this.config.logChannel[server]; @@ -13,13 +15,17 @@ var log = function(dbot) { 'command': message, 'user': user })); + }, + + 'ignoreCommand': function(commandName) { + this.ignoredCommands.push(commandName); } }; this.onLoad = function() { dbot.api.event.addHook('command', function(event) { var logChannel = this.config.logChannel[event.server]; - if(logChannel) { + if(logChannel && !_.include(this.ignoredCommands, command.split(' ')[0])) { dbot.say(event.server, logChannel, dbot.t('log_message', { 'time': new Date().toUTCString(), 'command': event.message, diff --git a/modules/web/web.js b/modules/web/web.js index de4ead1..7b7efd1 100644 --- a/modules/web/web.js +++ b/modules/web/web.js @@ -127,6 +127,10 @@ var webInterface = function(dbot) { req.logout(); res.redirect('/'); }); + + if(_.has(dbot.modules, 'log')) { + dbot.api.log.ignoreCommand('~setwebpass'); + } }.bind(this); this.onDestroy = function() {