forked from GitHub/dbot
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 _ = require('underscore')._;
|
||||||
|
|
||||||
var log = function(dbot) {
|
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() {
|
this.onLoad = function() {
|
||||||
dbot.api.event.addHook('command', function(event) {
|
dbot.api.event.addHook('command', function(event) {
|
||||||
var logChannel = this.config.logChannel[event.server];
|
var logChannel = this.config.logChannel[event.server];
|
||||||
|
@ -28,6 +28,11 @@ var pages = function(dbot) {
|
|||||||
'user': user.primaryNick,
|
'user': user.primaryNick,
|
||||||
'notifies': notifies
|
'notifies': notifies
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(_.has(dbot.modules, 'log')) {
|
||||||
|
dbot.api.log.log(server, user.primaryNick,
|
||||||
|
'Checked their missing notifications.');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
'/report/:server/:channel': function(req, res) {
|
'/report/:server/:channel': function(req, res) {
|
||||||
|
@ -219,7 +219,7 @@ var users = function(dbot) {
|
|||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}.bind(this), function(err) {
|
}.bind(this), function(err) {
|
||||||
console.log('finished checking ' + channel);
|
console.log('Finished checking ' + channel.name);
|
||||||
});
|
});
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user