forked from GitHub/dbot
double derp
This commit is contained in:
parent
f6b8ff9030
commit
b3a558d81c
@ -74,13 +74,11 @@ var sstats = function(dbot) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.listener = function(event) {
|
this.listener = function(event) {
|
||||||
if(event.message.charAt(0) != '~') return;
|
|
||||||
|
|
||||||
event.cStats.lines++;
|
event.cStats.lines++;
|
||||||
event.uStats.lines++;
|
event.uStats.lines++;
|
||||||
|
|
||||||
event.message = event.message.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()]/g, "");
|
var message = event.message.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()]/g, "");
|
||||||
var words = event.message.split(' '),
|
var words = message.split(' '),
|
||||||
wCount = words.length,
|
wCount = words.length,
|
||||||
capitals = 0,
|
capitals = 0,
|
||||||
curses = 0;
|
curses = 0;
|
||||||
@ -115,6 +113,7 @@ var sstats = function(dbot) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Look for tracked words.
|
// Look for tracked words.
|
||||||
|
if(event.message.charAt(0) != '~') return;
|
||||||
var wMap = {}; // Why reduce isn't working idk
|
var wMap = {}; // Why reduce isn't working idk
|
||||||
_.each(words, function(word) {
|
_.each(words, function(word) {
|
||||||
word = word.toLowerCase();
|
word = word.toLowerCase();
|
||||||
@ -133,6 +132,7 @@ var sstats = function(dbot) {
|
|||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}, this);
|
}, this);
|
||||||
|
}
|
||||||
|
|
||||||
this.db.save('channel_stats', event.cStats.id, event.cStats, function() {});
|
this.db.save('channel_stats', event.cStats.id, event.cStats, function() {});
|
||||||
this.db.save('user_stats', event.uStats.id, event.uStats, function() {});
|
this.db.save('user_stats', event.uStats.id, event.uStats, function() {});
|
||||||
|
Loading…
Reference in New Issue
Block a user