tags or whatever

This commit is contained in:
reality 2014-05-25 17:16:53 +00:00
parent 6b2f2f8484
commit 6218def4df
2 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,8 @@ var api = function(dbot) {
'channel': cName, 'channel': cName,
'user': user.id, 'user': user.id,
'time': new Date().getTime(), 'time': new Date().getTime(),
'message': message 'message': message,
'tags': message.match(/(#\w+)/g)
}, function() {}); }, function() {});
var channel = dbot.instance.connections[server].channels[cName]; var channel = dbot.instance.connections[server].channels[cName];

View File

@ -33,6 +33,8 @@ var report = function(dbot) {
channel + "\u000f"; channel + "\u000f";
} }
message.replace(/(#\w+)/g, '\u000312$1\u000f');
_.each(message.match(/ @([\d\w*|-]+)/g), function(u) { _.each(message.match(/ @([\d\w*|-]+)/g), function(u) {
u = u.substr(1); u = u.substr(1);
message = message.replace(u, colours['nicks'] + u + "\u000f"); message = message.replace(u, colours['nicks'] + u + "\u000f");