mirror of
https://github.com/reality/dbot.git
synced 2024-12-24 03:33:07 +01:00
missing log and custom log messages [close #555]
This commit is contained in:
parent
403fd035a7
commit
930ca1fbc0
@ -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];
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user