inform banee that they got banned in pm [Close #493]

This commit is contained in:
reality 2013-06-08 18:59:37 +00:00
parent 0421316002
commit cab231b647
3 changed files with 21 additions and 5 deletions

View File

@ -45,7 +45,7 @@ var commands = function(dbot) {
banner = event.user, banner = event.user,
banee = event.input[1], banee = event.input[1],
reason = event.input[2], reason = event.input[2],
adminChannel = this.config.admin_channels[event.server]; adminChannel = this.config.admin_channel[event.server];
channels = dbot.config.servers[server].channels; channels = dbot.config.servers[server].channels;
var notifyString = dbot.t('nbanned', { var notifyString = dbot.t('nbanned', {
@ -68,11 +68,21 @@ var commands = function(dbot) {
} }
// Notify moderators, banee // Notify moderators, banee
if(this.config.admin_channels[event.server]) { if(adminChannel) {
notifyChannel = this.config.admin_channels[event.server]; channels = _.without(channels, adminChannel);
channels = _.without(channels, notifyChannel);
dbot.api.report.notify(server, adminChannel, notifyString); dbot.api.report.notify(server, adminChannel, notifyString);
dbot.say(event.server, adminChannel, notifyString); dbot.say(event.server, adminChannel, notifyString);
var network = this.config.network_name[event.server];
if(!network) network = event.server;
dbot.say(event.server, banee, dbot.t('nbanned_notify', {
'network': network,
'banner': banner,
'reason': reason,
'admin_channel': adminChannel
}));
} }
// Ban the user from all channels // Ban the user from all channels

View File

@ -4,9 +4,12 @@
"help": "http://github.com/reality/depressionbot/blob/master/modules/kick/README.md", "help": "http://github.com/reality/depressionbot/blob/master/modules/kick/README.md",
"ignorable": true, "ignorable": true,
"countSilently": true, "countSilently": true,
"admin_channels": { "admin_channel": {
"aberwiki": "#fishbox" "aberwiki": "#fishbox"
}, },
"network_name": {
"aberwiki": "OAOSIDL"
},
"chanserv": "ChanServ", "chanserv": "ChanServ",
"document_bans": false "document_bans": false
} }

View File

@ -30,6 +30,9 @@
"cy": "Sylw: {banner} wedi gwahardd {banee} ledled y rhwydwaith. Y rheswm a roddwyd oedd: \"{reason}.\"", "cy": "Sylw: {banner} wedi gwahardd {banee} ledled y rhwydwaith. Y rheswm a roddwyd oedd: \"{reason}.\"",
"de": "Achtung: {banner} hat {banee} auf dem gesamten Netzwerk gebannt. Grund: \"{reason}.\"" "de": "Achtung: {banner} hat {banee} auf dem gesamten Netzwerk gebannt. Grund: \"{reason}.\""
}, },
"nbanned_notify": {
"en": "You have been banned from the {network} network by {banner}. The reason given was \"{reason}.\" You can join {admin_channel} for more information or to discuss the ban."
},
"nban_quote": { "nban_quote": {
"en": "{banee} was banned from the network by {banner} on {time}. The reason given was \"{reason}.\"", "en": "{banee} was banned from the network by {banner} on {time}. The reason given was \"{reason}.\"",
"cy": "Cafodd {banee} ei wahardd o'r rhwydwaith gan {banner} ar {time}. Y rheswm a roddwyd oedd: \"{reason}.\"", "cy": "Cafodd {banee} ei wahardd o'r rhwydwaith gan {banner} ar {time}. Y rheswm a roddwyd oedd: \"{reason}.\"",