From a9e9aaef36fb1f6a4e0dc515cf915bb84cbb9db2 Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 1 Jul 2013 17:38:25 +0000 Subject: [PATCH] unquiet command --- modules/kick/commands.js | 16 ++++++++++++++++ modules/kick/kick.js | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/modules/kick/commands.js b/modules/kick/commands.js index 5ee7da7..a162fee 100644 --- a/modules/kick/commands.js +++ b/modules/kick/commands.js @@ -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; }; diff --git a/modules/kick/kick.js b/modules/kick/kick.js index 6197b0d..fcb90f4 100644 --- a/modules/kick/kick.js +++ b/modules/kick/kick.js @@ -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); },