mirror of
https://github.com/reality/dbot.git
synced 2024-11-30 16:09:27 +01:00
unban
This commit is contained in:
parent
b278c1dd14
commit
821d8407c1
@ -46,12 +46,21 @@ var adminCommands = function(dbot) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
'ban': function(data, params) {
|
'ban': function(data, params) {
|
||||||
if(dbot.db.bans[params[2]] === undefined) {
|
if(dbot.db.bans.hasOwnProperty(params[2])) {
|
||||||
dbot.db.bans[params[2]] = [ params[1] ];
|
dbot.db.bans[params[2]] = [ params[1] ];
|
||||||
} else {
|
} else {
|
||||||
dbot.db.bans[params[2]].push(params[1]);
|
dbot.db.bans[params[2]].push(params[1]);
|
||||||
}
|
}
|
||||||
dbot.say(data.channel, params[1] + ' banned from ' + params[2]);
|
dbot.say(data.channel, params[1] + ' banned from ' + params[2]);
|
||||||
|
},
|
||||||
|
|
||||||
|
'unban': function(data, params) {
|
||||||
|
if(dbot.db.bans.hasOwnProperty(params[2]) && dbot.db.bans[params[2]].include(params[1])) {
|
||||||
|
dbot.db.bans[params[2]].splice(dbot.db.bans[params[2]].indexOf(params[1]), 1);
|
||||||
|
dbot.say(data.channel, params[1] + ' unbanned from ' + params[2]);
|
||||||
|
} else {
|
||||||
|
dbot.say(data.channel, 'It appears ' + params[1] + 'wasn\'t banned from that command, you fool.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user