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": {
|
"api": {
|
||||||
|
"load": false,
|
||||||
"http": {
|
"http": {
|
||||||
"port": 5000
|
"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
|
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')
|
this.logger.status('Shards spawned');
|
||||||
.catch(() => this.logger.warn(`Error importing API files, continuing without`));
|
|
||||||
|
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`));
|
// const API = await import('./api/index.js').catch(() => this.logger.warn(`Error importing API files, continuing without`));
|
||||||
if (API) {
|
if (API) {
|
||||||
this.logger.info('Booting up API');
|
this.logger.info('Booting up API');
|
||||||
|
Loading…
Reference in New Issue
Block a user