3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-30 16:09:27 +01:00

Report module uses strings.json [#88]

This commit is contained in:
reality 2012-12-30 16:33:25 +00:00
parent 168d1335aa
commit 042f6b2236
2 changed files with 24 additions and 7 deletions

View File

@ -21,18 +21,21 @@ var report = function(dbot) {
}
for(var i=0;i<ops.length;i++) {
dbot.say(event.server, ops[i],
'Attention: ' + event.user + ' has reported ' +
nick + ' in ' + channelName + '. The reason ' +
'given was: "' + reason + '."');
dbot.say(event.server, ops[i], dbot.t('report', {
'reporter': event.user,
'reported': nick,
'channel': channelName,
'reason': reason
}));
}
event.reply('Thank you, ' + nick + ' has been reported the channel administrators.');
event.reply(dbot.t('reported', { 'reported': nick }));
} else {
event.reply('User is not in that channel.');
event.reply(dbot.t('user_not_found', { 'reported': nick,
'channel': channelName }));
}
} else {
event.reply('I am not in that channel.');
event.reply(dbot.t('not_in_channel', { 'channel': channelName }));
}
}

View File

@ -0,0 +1,14 @@
{
"report": {
"english": "Attention: {reporter} has reported {reported} in {channel}. The reason given was: \"{reason}.\""
},
"reported": {
"english": "Thank you, {reported} has been reported to the channel administrators."
},
"user_not_found": {
"english": "{reported} does not appear to be in {channel}."
},
"not_in_channel": {
"english": "I am not present in {channel}."
}
}