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] =?UTF-8?q?=F0=9F=94=A8=20fix=20still=20getting=20error=20?= =?UTF-8?q?if=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(); }); });