Skip to content

Commit

Permalink
🔨 fix eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
idinium96 committed Jul 7, 2022
1 parent f66a5e4 commit 2714582
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/classes/Bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ export default class Bot {

let promise = Promise.resolve();

return new Promise(async (resolve, reject) => {
return new Promise((resolve, reject) => {
const checkIfStopping = () => {
if (this.botManager.isStopping) return reject();
};
Expand Down
36 changes: 16 additions & 20 deletions src/classes/BotManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,32 +60,28 @@ export default class BotManager {
}
});

return new Promise(async (resolve, reject) => {
try {
log.debug('Connecting to PM2...');
await this.connectToPM2();
try {
log.debug('Connecting to PM2...');
await this.connectToPM2();

log.info('Starting bot...');
this.pricer.init(options.enableSocket);
this.bot = new Bot(this, options, this.pricer);
log.info('Starting bot...');
this.pricer.init(options.enableSocket);
this.bot = new Bot(this, options, this.pricer);

await this.bot.start();
await this.bot.start();

this.pricer.connect(this.bot?.options.enableSocket);
this.pricer.connect(this.bot?.options.enableSocket);

this.schemaManager = this.bot.schemaManager;

resolve();
} catch (err) {
if (this.isStopping) {
return resolve(this.stop(null, false, false));
}
this.schemaManager = this.bot.schemaManager;
} catch (err) {
if (this.isStopping) {
return Promise.resolve(this.stop(null, false, false));
}

if (err) {
reject(err);
}
if (err) {
throw err;
}
});
}
}

stop(err: Error | null, checkIfReady = true, rudely = false): void {
Expand Down

0 comments on commit 2714582

Please sign in to comment.