From 569265f1c79dfa1326487932074171b3e68c28b4 Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 25 May 2014 18:24:13 +0000 Subject: [PATCH] lowercase --- modules/report/api.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/report/api.js b/modules/report/api.js index 557fb66..d0b2800 100644 --- a/modules/report/api.js +++ b/modules/report/api.js @@ -5,7 +5,11 @@ var uuid = require('node-uuid'), var api = function(dbot) { var api = { 'notify': function(type, server, user, cName, message) { - var id = uuid.v4(); + var id = uuid.v4(), + tags = []; + _.each(message.match(/(#\w+)/g), function(match) { + tags.push(match.toLowerCase()); + }); this.db.save('notifies', id, { 'id': id, 'server': server, @@ -14,7 +18,7 @@ var api = function(dbot) { 'user': user.id, 'time': new Date().getTime(), 'message': message, - 'tags': message.match(/(#\w+)/g) + 'tags': tags }, function() {}); var channel = dbot.instance.connections[server].channels[cName];