diff --git a/src/classes/Friends.ts b/src/classes/Friends.ts index b0e968345..848b96e84 100644 --- a/src/classes/Friends.ts +++ b/src/classes/Friends.ts @@ -54,12 +54,10 @@ export default class Friends { ).getSteamID64() }; - if (this.bot.manager.apiKey) { - params.key = this.bot.manager.apiKey; - } else { - params.access_token = this.bot.manager.accessToken; - } - void axios({ + const hasApiKey = !!this.bot.manager.apiKey; + params[hasApiKey ? 'key' : 'access_token'] = this.bot.manager[hasApiKey ? 'apiKey' : 'accessToken']; + + axios({ url: 'https://api.steampowered.com/IPlayerService/GetBadges/v1/', method: 'GET', params diff --git a/src/classes/TF2Inventory.ts b/src/classes/TF2Inventory.ts index 7c1fcf9f7..34558b79f 100644 --- a/src/classes/TF2Inventory.ts +++ b/src/classes/TF2Inventory.ts @@ -105,13 +105,10 @@ export default class TF2Inventory { access_token?: string; } = { steamid: this.getSteamID.toString() }; - if (this.manager.apiKey) { - params.key = this.manager.apiKey; - } else { - params.access_token = this.manager.accessToken; - } + const hasApiKey = !!this.manager.apiKey; + params[hasApiKey ? 'key' : 'access_token'] = this.manager[hasApiKey ? 'apiKey' : 'accessToken']; - void axios({ + axios({ url: 'https://api.steampowered.com/IEconItems_440/GetPlayerItems/v0001/', method: 'GET', params