diff --git a/modules/sstats/api.js b/modules/sstats/api.js index 2ca5a30..589ee64 100644 --- a/modules/sstats/api.js +++ b/modules/sstats/api.js @@ -13,7 +13,8 @@ var api = function(dbot) { var uStats = { 'id': id, 'lines': 0, - 'channels': {} + 'channels': {}, + 'creation': new Date().getTime() }; this.db.save('user_stats', id, uStats, function(err, uStats) { callback(uStats); @@ -29,7 +30,8 @@ var api = function(dbot) { 'createChannelStats': function(id, callback) { var cStats = { 'id': id, - 'lines': 0 + 'lines': 0, + 'creation': new Date().getTime() }; this.db.save('channel_stats', id, cStats, function(err, cStats) { callback(cStats); diff --git a/modules/sstats/sstats.js b/modules/sstats/sstats.js index c093abd..c8bbfdb 100644 --- a/modules/sstats/sstats.js +++ b/modules/sstats/sstats.js @@ -5,6 +5,8 @@ var _ = require('underscore')._; var sstats = function(dbot) { + if(!_.has(dbot.db, 'ssinception')) dbot.db.ssinception = new Date().getTime(); + this.listener = function(event) { event.cStats.lines++; event.uStats.lines++;