3
0
mirror of https://github.com/reality/dbot.git synced 2025-01-11 20:42:37 +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 'message': message
}, function() {}); }, function() {});
var notifier = event.user, var notifier = '[' + event.user + ']',
cChan = channelName, cChan = channelName,
type = 'notify'; type = 'notify';
if(_.has(this.config.colours, event.server)) { if(_.has(this.config.colours, event.server)) {
var colours = 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'; type = colours['type'] + type + '\u000f';
if(_.has(colours['channels'], channelName)) { if(_.has(colours['channels'], channelName)) {
cChan = colours['channels'][channelName] + cChan = colours['channels'][channelName] +
cChan + "\u000f"; cChan + "\u000f";
} }
_.each(message.match(/ @([\d\w\s*|-]+?)( |$)/g), function(user) { _.each(message.match(/@([\d\w\s*|-]+?)( |$)/g), function(user) {
notifier += '[' + colours['nicks'] + user.replace(/ @/, "") + '\u000f]'; 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 "); "@$1\u000f ");
} }

View File

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