option to notify voiced users with ~report [Close #348]

This commit is contained in:
reality 2013-04-12 18:31:02 +00:00
parent 74328ada86
commit 3a33c2be04
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,6 @@
{ {
"ignorable": true, "ignorable": true,
"notifyVoice": false,
"dependencies": [ "command", "users" ], "dependencies": [ "command", "users" ],
"help": "http://github.com/reality/depressionbot/blob/master/modules/report/README.md" "help": "http://github.com/reality/depressionbot/blob/master/modules/report/README.md"
} }

View File

@ -12,8 +12,12 @@ var report = function(dbot) {
if(dbot.api.users.isChannelUser(event.server, nick, channelName, true)) { if(dbot.api.users.isChannelUser(event.server, nick, channelName, true)) {
var nick = dbot.api.users.resolveUser(event.server, nick, true); var nick = dbot.api.users.resolveUser(event.server, nick, true);
var ops = _.filter(channel.nicks, function(user) { var ops = _.filter(channel.nicks, function(user) {
if(this.config.notifyVoice) {
return user.op || user.voice;
} else {
return user.op; return user.op;
}); }
}, this);
_.each(ops, function(user) { _.each(ops, function(user) {
dbot.say(event.server, user.name, dbot.t('report', { dbot.say(event.server, user.name, dbot.t('report', {