3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 14:29:29 +01:00

fix the host matching thing and make the regex sexier

This commit is contained in:
reality 2013-08-24 20:27:44 +00:00
parent abee98b68d
commit dfde53b8ac

View File

@ -157,12 +157,11 @@ var report = function(dbot) {
cChan + "\u000f"; cChan + "\u000f";
} }
_.each(message.match(/@([\d\w\s*|-]+?)( |$|,|\.)/g), function(user) { _.each(message.match(/ @([\d\w*|-]+)/g), function(user) {
user = user.replace(/@([\d\w\s*|-]+?)( |$|,|\.)/, "$1"); user = user.substr(1);
notifier += '[' + colours['nicks'] + user + '\u000f]'; message = message.replace(user, colours['nicks'] + user + "\u000f");
notifier += '[' + colours['nicks'] + user.substr(1) + '\u000f]';
}); });
message = message.replace(/@([\d\w\s*|-]+?)( |$|,|\.)/g, colours['nicks'] +
"@$1\u000f$2");
} }
this.api.notify(event.server, channelName, dbot.t('notify', { this.api.notify(event.server, channelName, dbot.t('notify', {