3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 19:52:36 +01:00

unquiet command

This commit is contained in:
reality 2013-07-01 17:38:25 +00:00
parent 5cf5714640
commit a9e9aaef36
2 changed files with 20 additions and 0 deletions

View File

@ -19,6 +19,21 @@ var commands = function(dbot) {
event.reply(dbot.t('quieted', { 'quietee': quietee }));
},
'~unquiet': function(event) {
var server = event.server,
quieter = event.user,
channel = event.input[1],
quietee = event.input[2].trim();
if(_.isUndefined(channel)) {
channel = event.channel.name;
}
channel = channel.trim();
this.api.quiet(server, quietee, channel);
event.reply(dbot.t('unquieted', { 'quietee': quietee }));
},
'~ckick': function(event) {
var server = event.server,
kicker = event.user,
@ -240,6 +255,7 @@ var commands = function(dbot) {
commands['~ckick'].regex = [/^~ckick ([^ ]+) ([^ ]+) (.+)$/, 4];
commands['~nban'].regex = /^~nban ([\d\.^ ]+)?([^ ]+) (.+)$/;
commands['~quiet'].regex = /^~quiet (#[^ ]+ )?([^ ]+) ?$/;
commands['~unquiet'].regex = /^~unquiet (#[^ ]+ )?([^ ]+) ?$/;
return commands;
};

View File

@ -13,6 +13,10 @@ var kick = function(dbot) {
dbot.say(server, this.config.chanserv, 'quiet ' + channel + ' ' + user);
},
'unquiet': function(server, user, channel) {
dbot.say(server, this.config.chanserv, 'unquiet ' + channel + ' ' + user);
},
'kick': function(server, user, channel, msg) {
dbot.instance.connections[server].send('KICK ' + channel + ' ' + user + ' :' + msg);
},