diff --git a/modules/report/config.json b/modules/report/config.json index ab40bcd..2666a08 100644 --- a/modules/report/config.json +++ b/modules/report/config.json @@ -7,5 +7,14 @@ "webAccess": "regular", "pageAccess": { "/report/:server/:channel": "power_users" + }, + "colours": { + "wherever": { + "channels": { + "#test": "\u00032" + }, + "nicks": "", + "type": "" + } } } diff --git a/modules/report/report.js b/modules/report/report.js index c20ea1c..7fe2cf2 100644 --- a/modules/report/report.js +++ b/modules/report/report.js @@ -117,12 +117,6 @@ var report = function(dbot) { 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 - })); - var id = uuid.v4(); this.db.save('notifies', id, { 'id': id, @@ -133,6 +127,23 @@ var report = function(dbot) { 'message': message }, function() {}); + if(_.has(this.config.colours, event.server)) { + var colours = this.config[event.server]; + + notifier = colours['nicks'] + event.user + '\u000f'; + type = colours['type'] + 'notify' + '\u000f'; + if(_.has(colours['channels'], channelName)) { + channelName = colours['channels'][channelName] + + channelName + "\u000f"; + } + } + + this.api.notify(event.server, channelName, dbot.t('notify', { + 'channel': channelName, + 'notifier': notifier, + 'message': message + })); + event.reply(dbot.t('notified', { 'user': event.user, 'channel': channelName