Skip to content

Commit

Permalink
🔀 Merge pull request #1171 from TF2Autobot/native-promises
Browse files Browse the repository at this point in the history
Use native promises
  • Loading branch information
idinium96 authored Jul 7, 2022
2 parents d6dca00 + 2714582 commit a5f5eea
Show file tree
Hide file tree
Showing 28 changed files with 1,151 additions and 1,341 deletions.
107 changes: 7 additions & 100 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@
"@tf2autobot/tf2-schema": "^3.2.0",
"@tf2autobot/tf2-sku": "^2.0.3",
"@tf2autobot/tradeoffer-manager": "^2.14.0",
"async": "^3.2.4",
"axios": "^0.27.2",
"bluebird": "^3.7.2",
"bluebird-global": "^1.0.1",
"body-parser": "^1.20.0",
"callback-queue": "^3.0.0",
"change-case": "^4.1.2",
Expand All @@ -58,7 +55,6 @@
"pretty-ms": "^7.0.1",
"reconnecting-websocket": "^4.4.0",
"retry": "^0.13.1",
"sleep-async": "^1.0.5",
"socket.io-client": "^4.5.1",
"steam-totp": "^2.1.2",
"steam-user": "^4.24.3",
Expand All @@ -73,13 +69,12 @@
},
"devDependencies": {
"@babel/preset-typescript": "^7.17.12",
"@types/async": "^3.2.13",
"@types/bluebird-global": "^3.5.13",
"@types/cheerio": "^0.22.31",
"@types/death": "^1.1.2",
"@types/express": "^4.17.13",
"@types/graceful-fs": "^4.1.5",
"@types/jest": "^28.1.3",
"@types/node": "^17.0.41",
"@types/pluralize": "0.0.29",
"@types/request": "^2.48.8",
"@types/retry": "^0.12.2",
Expand Down
31 changes: 13 additions & 18 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ if (process.env.BOT_VERSION !== pjson.version) {
process.exit(1);
}

import 'bluebird-global';

import dotenv from 'dotenv';

dotenv.config({ path: path.join(__dirname, '../.env') });
Expand Down Expand Up @@ -143,20 +141,17 @@ process.on('message', message => {
}
});

void botManager.start(options).asCallback(err => {
if (err) {
throw err;
}

if (options.enableHttpApi) {
void import('./classes/HttpManager').then(({ default: HttpManager }) => {
botManager
.start(options)
.then(async () => {
if (options.enableHttpApi) {
const { default: HttpManager } = await import('./classes/HttpManager');
const httpManager = new HttpManager(options);

void httpManager.start().asCallback(err => {
if (err) {
throw err;
}
});
});
}
});
await httpManager.start();
}
})
.catch(err => {
if (err) {
throw err;
}
});
Loading

0 comments on commit a5f5eea

Please sign in to comment.