From 493f29ff570077f55783d1becc2a99dead719d37 Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 21 Aug 2013 18:12:43 +0000 Subject: [PATCH] colours for ~notify [#560] --- modules/report/config.json | 9 +++++++++ modules/report/report.js | 23 +++++++++++++++++------ 2 files changed, 26 insertions(+), 6 deletions(-) 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