3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-24 11:42:36 +01:00

there we go

This commit is contained in:
reality 2013-08-21 19:51:41 +00:00
parent 7bbea38454
commit cc52b81eb2
2 changed files with 9 additions and 8 deletions

View File

@ -127,23 +127,24 @@ var report = function(dbot) {
'message': message
}, function() {});
var notifier = event.user,
var notifier = '[' + event.user + ']',
cChan = channelName,
type = 'notify';
if(_.has(this.config.colours, event.server)) {
var colours = this.config.colours[event.server];
notifier = colours['nicks'] + notifier + '\u000f';
notifier = '[' + colours['nicks'] + event.user + '\u000f]';
type = colours['type'] + type + '\u000f';
if(_.has(colours['channels'], channelName)) {
cChan = colours['channels'][channelName] +
cChan + "\u000f";
}
_.each(message.match(/ @([\d\w\s*|-]+?)( |$)/g), function(user) {
notifier += '[' + colours['nicks'] + user.replace(/ @/, "") + '\u000f]';
_.each(message.match(/@([\d\w\s*|-]+?)( |$)/g), function(user) {
user = user.replace(/@([\d\w\s*|-]+?)( |$)/, "$1");
notifier += '[' + colours['nicks'] + user + '\u000f]';
});
message = message.replace(/ @([\d\w\s*|-]+?)( |$)/g, " " + colours['nicks'] +
message = message.replace(/@([\d\w\s*|-]+?)( |$)/g, colours['nicks'] +
"@$1\u000f ");
}

View File

@ -45,9 +45,9 @@
"it": "Non sono presente in {channel}."
},
"notify": {
"en": "[{type}][{channel}][{notifier}] {message}",
"fr": "[{type}][{channel}][{notifier}] {message}",
"it": "[{type}][{channel}][{notifier}] {message}"
"en": "[{type}][{channel}]{notifier} {message}",
"fr": "[{type}][{channel}]{notifier} {message}",
"it": "[{type}][{channel}]{notifier} {message}"
},
"notified": {
"en": "{user}: {channel} staff notified.",