forked from Galactic/galactic-bot
22 lines
516 B
JavaScript
22 lines
516 B
JavaScript
class Provider {
|
|
|
|
constructor(manager, opts) {
|
|
|
|
if(!opts.config) throw new Error('No config file provided!');
|
|
this.config = opts.config[opts.name];
|
|
if(this.config && (!this.config.database || !this.config.host)) throw new Error('Invalid config file provided!' + JSON.stringify(this.config));
|
|
|
|
this.manager = manager;
|
|
|
|
this.name = opts.name;
|
|
|
|
this.connection = null;
|
|
this.db = null;
|
|
|
|
this._initialized = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = Provider; |