forked from GitHub/dbot
~notify command
This commit is contained in:
parent
71b9e482c1
commit
17070adcb6
@ -17,3 +17,7 @@ will be that all of the users which are currently marked as operators in the
|
|||||||
reporting channel will receive a PM telling them a user has been reported, by
|
reporting channel will receive a PM telling them a user has been reported, by
|
||||||
whom, in which channel and why. If there is an administrative channel for the
|
whom, in which channel and why. If there is an administrative channel for the
|
||||||
reporting channel (e.g. ##channel), the report will be posted there as well.
|
reporting channel (e.g. ##channel), the report will be posted there as well.
|
||||||
|
|
||||||
|
#### ~notify [#channel] [message]
|
||||||
|
Notify staff of a channel of a message. This can be run in either PM or in the
|
||||||
|
channel. If notifyVoice is set, voiced users will also receive notifications.
|
||||||
|
@ -43,9 +43,29 @@ var report = function(dbot) {
|
|||||||
} else {
|
} else {
|
||||||
event.reply(dbot.t('not_in_channel', { 'channel': channelName }));
|
event.reply(dbot.t('not_in_channel', { 'channel': channelName }));
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
'~notify': function(event) {
|
||||||
|
var channelName = event.input[1];
|
||||||
|
var message = event.input[2];
|
||||||
|
|
||||||
|
if(_.has(event.allChannels, channelName)) {
|
||||||
|
this.api.notify(event.server, channelName, dbot.t('notify', {
|
||||||
|
'channel': channelName,
|
||||||
|
'notifier': event.user,
|
||||||
|
'message': message
|
||||||
|
}));
|
||||||
|
event.reply(dbot.t('notified', {
|
||||||
|
'user': event.user,
|
||||||
|
'channel': channelName
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
event.reply(dbot.t('not_in_channel', { 'channel': channelName }));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
commands['~report'].regex = [/^~report ([^ ]+) ([^ ]+) (.+)$/, 4];
|
commands['~report'].regex = [/^~report ([^ ]+) ([^ ]+) (.+)$/, 4];
|
||||||
|
commands['~notify'].regex = [/^~notify ([^ ]+) (.+)$/, 3];
|
||||||
this.commands = commands;
|
this.commands = commands;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -26,5 +26,11 @@
|
|||||||
"cy": "Dydw i ddim yn bresennol yn {channel}.",
|
"cy": "Dydw i ddim yn bresennol yn {channel}.",
|
||||||
"nl": "Ik ben niet aanwezig in {channel}.",
|
"nl": "Ik ben niet aanwezig in {channel}.",
|
||||||
"de": "Ich bin nicht in {channel} aktiv."
|
"de": "Ich bin nicht in {channel} aktiv."
|
||||||
|
},
|
||||||
|
"notify": {
|
||||||
|
"en": "Attention {channel}: {notifier}: {message}"
|
||||||
|
},
|
||||||
|
"notified": {
|
||||||
|
"en": "{user}: {channel} staff notified."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user