forked from GitHub/dbot
colours for ~notify [#560]
This commit is contained in:
parent
509911aae0
commit
493f29ff57
@ -7,5 +7,14 @@
|
||||
"webAccess": "regular",
|
||||
"pageAccess": {
|
||||
"/report/:server/:channel": "power_users"
|
||||
},
|
||||
"colours": {
|
||||
"wherever": {
|
||||
"channels": {
|
||||
"#test": "\u00032"
|
||||
},
|
||||
"nicks": "",
|
||||
"type": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user