From da025dafbb8b91c77efa1b09bb36c7124f4b4fcb Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 17 Aug 2013 19:52:07 +0000 Subject: [PATCH] ability to supple reason with ~quiet [#551] --- modules/kick/commands.js | 11 +++++++---- modules/kick/strings.json | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/kick/commands.js b/modules/kick/commands.js index 43c2f80..5604cec 100644 --- a/modules/kick/commands.js +++ b/modules/kick/commands.js @@ -8,7 +8,8 @@ var commands = function(dbot) { quieter = event.user, minutes = event.input[1], channel = event.input[2], - quietee = event.input[3].trim(); + quietee = event.input[3].trim(), + reason = event.input[4] || "N/A"; if(_.isUndefined(channel)) { channel = event.channel.name; @@ -34,14 +35,16 @@ var commands = function(dbot) { 'quieter': quieter, 'channel': channel, 'quietee': quietee, - 'minutes': minutes + 'minutes': minutes, + 'reason': reason })); } else { event.reply(dbot.t('quieted', { 'quietee': quietee })); dbot.api.report.notify(server, channel, dbot.t('quiet_notify', { 'quieter': quieter, 'channel': channel, - 'quietee': quietee + 'quietee': quietee, + 'reason': reason })); } @@ -290,7 +293,7 @@ var commands = function(dbot) { commands['~ckick'].regex = [/^~ckick ([^ ]+) ([^ ]+) (.+)$/, 4]; commands['~nban'].regex = /^~nban ([\d\.^ ]+)?([^ ]+) (.+)$/; - commands['~quiet'].regex = /^~quiet ([\d\.^ ]+)?(#[^ ]+ )?([^ ]+) ?$/; + commands['~quiet'].regex = /^~quiet ([\d\.^ ]+)?(#[^ ]+ )?([^ ]+) ?(.*)?$/; commands['~unquiet'].regex = /^~unquiet (#[^ ]+ )?([^ ]+) ?$/; return commands; diff --git a/modules/kick/strings.json b/modules/kick/strings.json index fcb7ae8..be20f02 100644 --- a/modules/kick/strings.json +++ b/modules/kick/strings.json @@ -20,10 +20,10 @@ "it": "{quietee} รจ stato silenziato per {minutes} minuto/i. Ricordati: non essere testardo" }, "quiet_notify": { - "en": "Attention: {quieter} has quieted {quietee} in {channel}." + "en": "Attention: {quieter} has quieted {quietee} in {channel}. The reason given was \"{reason}\"." }, "tquiet_notify": { - "en": "Attention: {quieter} has quieted {quietee} in {channel} for {minutes} minutes." + "en": "Attention: {quieter} has quieted {quietee} in {channel} for {minutes} minutes. The reason given was \"{reason}\"." }, "unquieted": { "en": "Unquieted {quietee}. Remember: don't be a coconut.",