3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-24 04:49:25 +01:00

colours for ~notify [#560]

This commit is contained in:
reality 2013-08-21 18:12:43 +00:00
parent 509911aae0
commit 493f29ff57
2 changed files with 26 additions and 6 deletions

View File

@ -7,5 +7,14 @@
"webAccess": "regular", "webAccess": "regular",
"pageAccess": { "pageAccess": {
"/report/:server/:channel": "power_users" "/report/:server/:channel": "power_users"
},
"colours": {
"wherever": {
"channels": {
"#test": "\u00032"
},
"nicks": "",
"type": ""
}
} }
} }

View File

@ -117,12 +117,6 @@ var report = function(dbot) {
message = event.input[2]; message = event.input[2];
if(_.has(event.allChannels, channelName)) { 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(); var id = uuid.v4();
this.db.save('notifies', id, { this.db.save('notifies', id, {
'id': id, 'id': id,
@ -133,6 +127,23 @@ var report = function(dbot) {
'message': message 'message': message
}, function() {}); }, 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', { event.reply(dbot.t('notified', {
'user': event.user, 'user': event.user,
'channel': channelName 'channel': channelName