nban records a host record [#497][#495]

This commit is contained in:
reality 2013-06-09 21:07:17 +00:00
parent 9226da5b76
commit 2b7b67b894
3 changed files with 54 additions and 46 deletions

View File

@ -48,6 +48,12 @@ var commands = function(dbot) {
adminChannel = this.config.admin_channel[event.server];
channels = dbot.config.servers[server].channels;
dbot.api.nickserv.getUserHost(event.server, banee, function(host) {
// Add host record entry
if(!_.has(this.hosts, event.server)) this.hosts[event.server] = {};
this.hosts[event.server][banee] = host;
// Create notify string
var notifyString = dbot.t('nbanned', {
'banner': banner,
'banee': banee,
@ -100,6 +106,7 @@ var commands = function(dbot) {
}, 1000);
}.bind(this);
banChannel(channels);
}.bind(this));
},
/*** Kick Stats ***/

View File

@ -1,5 +1,5 @@
{
"dbKeys": [ "kicks", "kickers" ],
"dbKeys": [ "kicks", "kickers", "hosts" ],
"dependencies": [ "command", "report", "users" ],
"help": "http://github.com/reality/depressionbot/blob/master/modules/kick/README.md",
"ignorable": true,

View File

@ -1,6 +1,7 @@
var _ = require('underscore')._;
var kick = function(dbot) {
this.hosts = dbot.db.hosts;
this.api = {
'ban': function(server, user, channel) {