forked from GitHub/dbot
external lpmcount
This commit is contained in:
parent
0f1c6c6782
commit
e62a1c8484
@ -1,13 +1,18 @@
|
|||||||
var _ = require('underscore')._;
|
var _ = require('underscore')._;
|
||||||
|
|
||||||
var cspeed = function(dbot) {
|
var cspeed = function(dbot) {
|
||||||
if(!_.has(dbot.db.cspeed)) {
|
|
||||||
dbot.db.cspeed = {};
|
|
||||||
}
|
|
||||||
this.watches = dbot.db.cspeed;
|
this.watches = dbot.db.cspeed;
|
||||||
this.outputChannel = dbot.config.modules.cspeed.outputChannel;
|
this.outputChannel = dbot.config.modules.cspeed.outputChannel;
|
||||||
this.counts = {};
|
this.counts = {};
|
||||||
|
|
||||||
|
this.api = {
|
||||||
|
'getCounts': function(callback) {
|
||||||
|
callback(this.counts);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.api['getCounts'].external = true;
|
||||||
|
this.api['getCounts'].extMap = [ 'callback' ];
|
||||||
|
|
||||||
this.commands = {
|
this.commands = {
|
||||||
'addlpmwatch': function(event) {
|
'addlpmwatch': function(event) {
|
||||||
var channel = event.params[1];
|
var channel = event.params[1];
|
||||||
|
@ -108,7 +108,9 @@ var users = function(dbot) {
|
|||||||
// Track nick changes
|
// Track nick changes
|
||||||
this.listener = function(event) {
|
this.listener = function(event) {
|
||||||
// Update current nick
|
// Update current nick
|
||||||
console.log(event);
|
async.waterfall([
|
||||||
|
|
||||||
|
]);
|
||||||
this.api.resolveUser(event.server, event.user, function(err, user) {
|
this.api.resolveUser(event.server, event.user, function(err, user) {
|
||||||
if(user) {
|
if(user) {
|
||||||
this.api.resolveUser(event.server, event.message, function(err, eUser) {
|
this.api.resolveUser(event.server, event.message, function(err, eUser) {
|
||||||
|
8
run.js
8
run.js
@ -122,13 +122,15 @@ DBot.prototype.t = function(string, formatData) {
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
// Save the database file
|
// Save the database file
|
||||||
DBot.prototype.save = function() {
|
DBot.prototype.save = function(cb) {
|
||||||
fs.writeFileSync('db.json', JSON.stringify(this.db, null, ' '));
|
fs.writeFile('db.json', JSON.stringify(this.db, null, ' '), cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Hot-reload module files.
|
// Hot-reload module files.
|
||||||
DBot.prototype.reloadModules = function() {
|
DBot.prototype.reloadModules = function() {
|
||||||
this.save();
|
this.save().then(function() {
|
||||||
|
console.log('test');
|
||||||
|
});
|
||||||
|
|
||||||
if(this.modules) { // Run 'onDestroy' code for each module if it exists.
|
if(this.modules) { // Run 'onDestroy' code for each module if it exists.
|
||||||
_.each(this.modules, function(module) {
|
_.each(this.modules, function(module) {
|
||||||
|
Loading…
Reference in New Issue
Block a user