3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-18 00:22:35 +01:00

dont store bans in quotes, store ban records [#557]

This commit is contained in:
reality 2013-08-18 20:10:19 +00:00
parent 239e94fe05
commit 5233481992
3 changed files with 17 additions and 21 deletions

View File

@ -1,4 +1,5 @@
var _ = require('underscore')._;
var _ = require('underscore')._,
uuid = require('node-uuid');
var commands = function(dbot) {
var commands = {
@ -168,10 +169,18 @@ var commands = function(dbot) {
}
// Add qutoe category documenting ban
if(this.config.document_bans && _.has(dbot.modules, 'quotes')) {
dbot.api.quotes.addQuote('ban_' + banee.toLowerCase(),
quoteString, banee, function() {});
notifyString += ' ' + dbot.t('quote_recorded', { 'user': banee });
if(this.config.document_bans) {
var id = uuid.v4();
var banRecord = {
'id': id,
'time': new Date().getTime(),
'server': server,
'banee': banee,
'banner': banner,
'host': host,
'reason': reason
};
this.db.save('nbans', id, banRecord, function() {});
}
// Notify moderators, banee

View File

@ -7,5 +7,6 @@
"aberwiki": "OAOSIDL"
},
"chanserv": "ChanServ",
"document_bans": false
"document_bans": false,
"dbType": "redis"
}

View File

@ -79,13 +79,6 @@
"fr": "Vous avez été banni du réseau {network} par {banner}. La raison donnée était \"{reason}.\" Vous pouvez rejoindre {admin_channel} pour plus d'information or pour discuter du ban.",
"it": "Sei stato bandito dalla rete {network} da {banner}. Motivo: \"{reason}.\" Puoi ricongiungere {admin_channel} per ulteriori informazioni o discutere sulla messa al bando."
},
"nban_quote": {
"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}.\"",
"de": "{banee} wurde von {banner} auf dem gesamten Netzwerk um {time} gebannt. Grund: \"{reason}.\"",
"fr": "{banee} a été banni du réseau par {banner} à {time}. Raison donnée : \"{reason}.\"",
"it": "{banee} è stato bandito dalla rete da {banner} a {time}. Motivo : \"{reason}.\""
},
"no_user": {
"en": "{user} doesn't seem to be online on this server.",
"fr": "{user} ne semble pas être connecté à ce serveur.",
@ -105,12 +98,5 @@
"en": "It appears {unbanee} was not banned using the ~nban command.",
"fr": "Il semble que {unbanee} n'a pas été banni en utilisant la commande ~nban.",
"it": "Sembar che {unbanee} non è stato bandito usano il commando ~nban."
},
"quote_recorded": {
"en": "This has been recorded in ~ban_{user}.",
"cy": "Mae hyn wedi cael ei gofnodi yn ~ban_{user}.",
"de": "Dies wurde in ~ban_{user} aufgenommen.",
"fr": "Cela a été enregistré dans ~ban_{user}.",
"it": "Questo è stato registrato in ~ban_{user}."
}
}