3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-23 20:39:25 +01:00

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,
'user': user.id,
'time': new Date().getTime(),
'message': message
'message': message,
'tags': message.match(/(#\w+)/g)
}, function() {});
var channel = dbot.instance.connections[server].channels[cName];

View File

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