forked from Galactic/galactic-bot
add option to disable api loading
This commit is contained in:
parent
c5d2b292aa
commit
c15530dc90
@ -46,6 +46,7 @@
|
||||
}
|
||||
},
|
||||
"api": {
|
||||
"load": false,
|
||||
"http": {
|
||||
"port": 5000
|
||||
},
|
||||
|
@ -37,8 +37,10 @@ class BaseClient extends EventEmitter {
|
||||
process.exit(); // Prevent a boot loop when shards die due to an error in the client
|
||||
});
|
||||
|
||||
const API = await import('/Documents/My programs/GBot/api/index.js')
|
||||
.catch(() => this.logger.warn(`Error importing API files, continuing without`));
|
||||
this.logger.status('Shards spawned');
|
||||
|
||||
const API = this._options.api.load ? await import('/Documents/My programs/GBot/api/index.js')
|
||||
.catch(() => this.logger.warn(`Error importing API files, continuing without`)) : null;
|
||||
// const API = await import('./api/index.js').catch(() => this.logger.warn(`Error importing API files, continuing without`));
|
||||
if (API) {
|
||||
this.logger.info('Booting up API');
|
||||
|
Loading…
Reference in New Issue
Block a user