mirror of
https://github.com/reality/dbot.git
synced 2024-12-02 17:09:29 +01:00
Now uses an external configuration file.
This commit is contained in:
parent
851f510973
commit
372c03f6af
17
run.js
17
run.js
@ -6,18 +6,21 @@ require('./snippets');
|
|||||||
var modules = ['spelling', 'web', 'modehate', 'user', 'admin', 'puns', 'kick', 'karma', 'youare', 'quotes'];
|
var modules = ['spelling', 'web', 'modehate', 'user', 'admin', 'puns', 'kick', 'karma', 'youare', 'quotes'];
|
||||||
|
|
||||||
var DBot = function(dModules, timers) {
|
var DBot = function(dModules, timers) {
|
||||||
this.admin = 'reality';
|
this.config = JSON.parse(fs.readFileSync('config.json', 'utf-8'));
|
||||||
this.name = 'depressionbot';
|
|
||||||
|
|
||||||
this.db = JSON.parse(fs.readFileSync('db.json', 'utf-8'));
|
this.db = JSON.parse(fs.readFileSync('db.json', 'utf-8'));
|
||||||
this.timers = timers.create();
|
|
||||||
|
|
||||||
|
this.admin = this.config.admin || 'reality';
|
||||||
|
this.name = this.config.name || 'depressionbot';
|
||||||
|
|
||||||
|
this.timers = timers.create();
|
||||||
this.waitingForKarma = false;
|
this.waitingForKarma = false;
|
||||||
|
|
||||||
this.instance = jsbot.createJSBot(this.name, 'elara.ivixor.net', 6667, this, function() {
|
this.instance = jsbot.createJSBot(this.name, 'elara.ivixor.net', 6667, this, function() {
|
||||||
this.instance.join('#42');
|
if(this.config.hasOwnProperty('channels')) {
|
||||||
this.instance.join('#not42');
|
for(channel in this.config.channels) {
|
||||||
this.instance.join('#itonlygetsworse');
|
this.instance.join(channel);
|
||||||
|
}
|
||||||
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
this.moduleNames = dModules;
|
this.moduleNames = dModules;
|
||||||
|
Loading…
Reference in New Issue
Block a user