diff --git a/modules/log/log.js b/modules/log/log.js index a799672..45127fe 100644 --- a/modules/log/log.js +++ b/modules/log/log.js @@ -5,6 +5,17 @@ var _ = require('underscore')._; var log = function(dbot) { + this.api = { + 'log': function(server, user, message) { + var logChannel = this.config.logChannel[event.server]; + dbot.say(server, logChannel, dbot.t('log_message', { + 'time': new Date().toUTCString(), + 'command': message, + 'user': user + })); + } + }; + this.onLoad = function() { dbot.api.event.addHook('command', function(event) { var logChannel = this.config.logChannel[event.server]; diff --git a/modules/report/pages.js b/modules/report/pages.js index 701ec5d..bcc7f68 100644 --- a/modules/report/pages.js +++ b/modules/report/pages.js @@ -28,6 +28,11 @@ var pages = function(dbot) { 'user': user.primaryNick, 'notifies': notifies }); + + if(_.has(dbot.modules, 'log')) { + dbot.api.log.log(server, user.primaryNick, + 'Checked their missing notifications.'); + } }, '/report/:server/:channel': function(req, res) { diff --git a/modules/users/users.js b/modules/users/users.js index c70a511..bedb6a9 100644 --- a/modules/users/users.js +++ b/modules/users/users.js @@ -219,7 +219,7 @@ var users = function(dbot) { } }.bind(this)); }.bind(this), function(err) { - console.log('finished checking ' + channel); + console.log('Finished checking ' + channel.name); }); }.bind(this);