forked from GitHub/dbot
ability to supple reason with ~quiet [#551]
This commit is contained in:
parent
fa1634d040
commit
da025dafbb
@ -8,7 +8,8 @@ var commands = function(dbot) {
|
|||||||
quieter = event.user,
|
quieter = event.user,
|
||||||
minutes = event.input[1],
|
minutes = event.input[1],
|
||||||
channel = event.input[2],
|
channel = event.input[2],
|
||||||
quietee = event.input[3].trim();
|
quietee = event.input[3].trim(),
|
||||||
|
reason = event.input[4] || "N/A";
|
||||||
|
|
||||||
if(_.isUndefined(channel)) {
|
if(_.isUndefined(channel)) {
|
||||||
channel = event.channel.name;
|
channel = event.channel.name;
|
||||||
@ -34,14 +35,16 @@ var commands = function(dbot) {
|
|||||||
'quieter': quieter,
|
'quieter': quieter,
|
||||||
'channel': channel,
|
'channel': channel,
|
||||||
'quietee': quietee,
|
'quietee': quietee,
|
||||||
'minutes': minutes
|
'minutes': minutes,
|
||||||
|
'reason': reason
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
event.reply(dbot.t('quieted', { 'quietee': quietee }));
|
event.reply(dbot.t('quieted', { 'quietee': quietee }));
|
||||||
dbot.api.report.notify(server, channel, dbot.t('quiet_notify', {
|
dbot.api.report.notify(server, channel, dbot.t('quiet_notify', {
|
||||||
'quieter': quieter,
|
'quieter': quieter,
|
||||||
'channel': channel,
|
'channel': channel,
|
||||||
'quietee': quietee
|
'quietee': quietee,
|
||||||
|
'reason': reason
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,7 +293,7 @@ var commands = function(dbot) {
|
|||||||
|
|
||||||
commands['~ckick'].regex = [/^~ckick ([^ ]+) ([^ ]+) (.+)$/, 4];
|
commands['~ckick'].regex = [/^~ckick ([^ ]+) ([^ ]+) (.+)$/, 4];
|
||||||
commands['~nban'].regex = /^~nban ([\d\.^ ]+)?([^ ]+) (.+)$/;
|
commands['~nban'].regex = /^~nban ([\d\.^ ]+)?([^ ]+) (.+)$/;
|
||||||
commands['~quiet'].regex = /^~quiet ([\d\.^ ]+)?(#[^ ]+ )?([^ ]+) ?$/;
|
commands['~quiet'].regex = /^~quiet ([\d\.^ ]+)?(#[^ ]+ )?([^ ]+) ?(.*)?$/;
|
||||||
commands['~unquiet'].regex = /^~unquiet (#[^ ]+ )?([^ ]+) ?$/;
|
commands['~unquiet'].regex = /^~unquiet (#[^ ]+ )?([^ ]+) ?$/;
|
||||||
|
|
||||||
return commands;
|
return commands;
|
||||||
|
@ -20,10 +20,10 @@
|
|||||||
"it": "{quietee} è stato silenziato per {minutes} minuto/i. Ricordati: non essere testardo"
|
"it": "{quietee} è stato silenziato per {minutes} minuto/i. Ricordati: non essere testardo"
|
||||||
},
|
},
|
||||||
"quiet_notify": {
|
"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": {
|
"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": {
|
"unquieted": {
|
||||||
"en": "Unquieted {quietee}. Remember: don't be a coconut.",
|
"en": "Unquieted {quietee}. Remember: don't be a coconut.",
|
||||||
|
Loading…
Reference in New Issue
Block a user