From f00e5bb12dd55726042e7721053081f1f061d6b4 Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Thu, 2 May 2024 20:15:05 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=94=A8=20fix=20still=20getting=20erro?= =?UTF-8?q?r=20if=20Steam=20API=20is=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Bot.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/classes/Bot.ts b/src/classes/Bot.ts index c1f6c1a2f..e26e7bfaa 100644 --- a/src/classes/Bot.ts +++ b/src/classes/Bot.ts @@ -1246,16 +1246,18 @@ export default class Bot { this.listingManager.setUserID(this.userID); } - if (this.options.steamApiKey) { - this.manager.apiKey = this.options.steamApiKey; - } - return new Promise((resolve, reject) => { this.manager.setCookies(cookies, err => { if (err) { return reject(err); } + // Steam API key likely become 0000s after calling setCookies + // if useAccessToken is false (STEAM_API_KEY is defined) + if (this.options.steamApiKey) { + this.manager.apiKey = this.options.steamApiKey; + } + resolve(); }); }); From d96d0c60da769f6c4bb43f39aeecb31d6f695b7c Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Thu, 2 May 2024 20:16:10 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20v5.12.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 501eca474..f6b9d8cde 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tf2autobot", - "version": "5.12.0", + "version": "5.12.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tf2autobot", - "version": "5.12.0", + "version": "5.12.1", "license": "MIT", "dependencies": { "@tf2autobot/bptf-listings": "^5.7.7", diff --git a/package.json b/package.json index 7885d7558..8f2a00b88 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tf2autobot", - "version": "5.12.0", + "version": "5.12.1", "description": "Fully automated TF2 trading bot advertising on www.backpack.tf using prices from www.prices.tf, Originally made by Nicklason.", "main": "dist/app.js", "scripts": { From 11fed1f62af4f57228f71d00faed84b282482934 Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Thu, 2 May 2024 20:27:23 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E2=86=A9=EF=B8=8F=20revert=20f00e5bb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Bot.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/classes/Bot.ts b/src/classes/Bot.ts index e26e7bfaa..c1f6c1a2f 100644 --- a/src/classes/Bot.ts +++ b/src/classes/Bot.ts @@ -1246,18 +1246,16 @@ export default class Bot { this.listingManager.setUserID(this.userID); } + if (this.options.steamApiKey) { + this.manager.apiKey = this.options.steamApiKey; + } + return new Promise((resolve, reject) => { this.manager.setCookies(cookies, err => { if (err) { return reject(err); } - // Steam API key likely become 0000s after calling setCookies - // if useAccessToken is false (STEAM_API_KEY is defined) - if (this.options.steamApiKey) { - this.manager.apiKey = this.options.steamApiKey; - } - resolve(); }); }); From 838aa8ae20ca82af11b7f7d43b530aa66617ee12 Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Thu, 2 May 2024 20:27:46 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20v5.12.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index f6b9d8cde..de747191e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tf2autobot", - "version": "5.12.1", + "version": "5.12.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "tf2autobot", - "version": "5.12.1", + "version": "5.12.2", "license": "MIT", "dependencies": { "@tf2autobot/bptf-listings": "^5.7.7", diff --git a/package.json b/package.json index 8f2a00b88..97095fd9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tf2autobot", - "version": "5.12.1", + "version": "5.12.2", "description": "Fully automated TF2 trading bot advertising on www.backpack.tf using prices from www.prices.tf, Originally made by Nicklason.", "main": "dist/app.js", "scripts": { From 133b3da1d3e96a66fe93c2d698d3d1d02ccf5bea Mon Sep 17 00:00:00 2001 From: idinium96 <47635037+idinium96@users.noreply.github.com> Date: Tue, 16 Jul 2024 23:47:09 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=94=A8=20temp=20patch:=20remove=20bro?= =?UTF-8?q?ken=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Bot.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/classes/Bot.ts b/src/classes/Bot.ts index c1f6c1a2f..3340c72c9 100644 --- a/src/classes/Bot.ts +++ b/src/classes/Bot.ts @@ -573,6 +573,7 @@ export default class Bot { } startAutoRefreshListings(): void { + return; // Automatically check for missing listings every 30 minutes let pricelistLength = 0; From 162486c420c6ee703f8d4ab88d727aa2faf3c409 Mon Sep 17 00:00:00 2001 From: Nicklas Date: Tue, 16 Jul 2024 22:05:13 +0200 Subject: [PATCH 6/6] fix: remove refresh token on access denied --- src/classes/Bot.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/classes/Bot.ts b/src/classes/Bot.ts index 3340c72c9..89b7707f0 100644 --- a/src/classes/Bot.ts +++ b/src/classes/Bot.ts @@ -1405,7 +1405,7 @@ export default class Bot { resolve(null); }; - const errorEvent = (err): void => { + const errorEvent = (err: CustomError): void => { gotEvent(); this.client.removeListener('loggedOn', loggedOnEvent); @@ -1413,7 +1413,14 @@ export default class Bot { log.error('Failed to sign in to Steam: ', err); - reject(err); + if (err.eresult === EResult.AccessDenied) { + // Access denied during login + this.deleteRefreshToken().finally(() => { + reject(err); + }); + } else { + reject(err); + } }; const timeout = setTimeout(() => {