From b46f72a409eaf405f3a6069fb20b8500360544fd Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 7 May 2013 14:23:37 +0000 Subject: [PATCH] nban should work goodly now --- modules/kick/commands.js | 23 +++++++++++++++++++---- modules/kick/config.json | 3 ++- modules/kick/strings.json | 10 ++++++++-- 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/modules/kick/commands.js b/modules/kick/commands.js index 4310d79..d5cd3b3 100644 --- a/modules/kick/commands.js +++ b/modules/kick/commands.js @@ -39,7 +39,7 @@ var commands = function(dbot) { })); }, - '~cquiet': function(event) { + /*'~cquiet': function(event) { var server = event.server, quieter = event.user, quietee = event.input[2], @@ -72,7 +72,7 @@ var commands = function(dbot) { 'quietee': quietee, 'reason': reason })); - }, + },*/ // Kick and ban from all channels on the network. '~nban': function(event) { @@ -88,11 +88,26 @@ var commands = function(dbot) { ' (network-wide ban requested by ' + banner + ')'); }, this); - dbot.api.report.notify(server, this.config.admin_channels[event.server], dbot.t('nbanned', { + var notifyString = dbot.t('nbanned', { 'banner': banner, 'banee': banee, 'reason': reason - })); + }); + + // TODO: When this is merged into database branch, have it use the + // api.quotes.addQuote function + if(this.config.document_bans && _.has(dbot.modules, 'quotes')) { + dbot.db.quoteArrs['ban_' + banee] = [ dbot.t('nban_quote', { + 'banee': banee, + 'banner': banner, + 'time': new Date().toUTCString(), + 'reason': reason + }) ]; + + notifyString += ' ' + dbot.t('quote_recorded', { 'user': banee }); + } + + dbot.api.report.notify(server, this.config.admin_channels[event.server], notifyString); }, /*** Kick Stats ***/ diff --git a/modules/kick/config.json b/modules/kick/config.json index bd6e05f..bf4cd1d 100644 --- a/modules/kick/config.json +++ b/modules/kick/config.json @@ -7,5 +7,6 @@ "admin_channels": { "aberwiki": "#fishbox" }, - "chanserv": "ChanServ" + "chanserv": "ChanServ", + "document_bans": false } diff --git a/modules/kick/strings.json b/modules/kick/strings.json index e9e13f5..f71fd0e 100644 --- a/modules/kick/strings.json +++ b/modules/kick/strings.json @@ -13,11 +13,17 @@ "cy": "Ni ddylech cicio {botname}" }, "ckicked": { - "en": "Attention: {kicker} has kicked {kickee} from {channel}. The reason given was: \"{reason}.\"" + "en": "Attention: {kicker} has kicked {kickee} from {channel}. The reason given was: \"{reason}.\"", "cy": "Ni ddylech cicio {botname}", "nl": "Gij zult {botname} niet kicken" - } + }, "nbanned": { "en": "Attention: {banner} has banned {banee} network-wide. The reason given was \"{reason}.\"" + }, + "nban_quote": { + "en": "{banee} was banned from the network by {banner} on {time}. The reason given was \"{reason}.\"" + }, + "quote_recorded": { + "en": "This has been recorded in ~ban_{user}." } }