From 3a33c2be04ac89524b270b20c28f675901ec035d Mon Sep 17 00:00:00 2001 From: reality Date: Fri, 12 Apr 2013 18:31:02 +0000 Subject: [PATCH] option to notify voiced users with ~report [Close #348] --- modules/report/config.json | 1 + modules/report/report.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/report/config.json b/modules/report/config.json index 424160e..c495082 100644 --- a/modules/report/config.json +++ b/modules/report/config.json @@ -1,5 +1,6 @@ { "ignorable": true, + "notifyVoice": false, "dependencies": [ "command", "users" ], "help": "http://github.com/reality/depressionbot/blob/master/modules/report/README.md" } diff --git a/modules/report/report.js b/modules/report/report.js index 2e9bbe9..89910ba 100644 --- a/modules/report/report.js +++ b/modules/report/report.js @@ -12,8 +12,12 @@ var report = function(dbot) { if(dbot.api.users.isChannelUser(event.server, nick, channelName, true)) { var nick = dbot.api.users.resolveUser(event.server, nick, true); var ops = _.filter(channel.nicks, function(user) { - return user.op; - }); + if(this.config.notifyVoice) { + return user.op || user.voice; + } else { + return user.op; + } + }, this); _.each(ops, function(user) { dbot.say(event.server, user.name, dbot.t('report', {