diff --git a/options.json b/options.json index 2158201..d3aca0c 100644 --- a/options.json +++ b/options.json @@ -46,6 +46,7 @@ } }, "api": { + "load": false, "http": { "port": 5000 }, diff --git a/src/middleware/BaseClient.js b/src/middleware/BaseClient.js index 1005df3..5fa8c6c 100644 --- a/src/middleware/BaseClient.js +++ b/src/middleware/BaseClient.js @@ -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');