Skip to content

Commit 87294fc

Browse files
committed
🔨 re-re-refactor
1 parent bd804bf commit 87294fc

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/classes/Friends.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ export default class Friends {
4949
: this.bot.client.steamID
5050
).getSteamID64()
5151
};
52-
const hasApiKey = !!this.bot.manager.apiKey;
53-
params[hasApiKey ? 'key' : 'access_token'] = this.bot.manager[hasApiKey ? 'apiKey' : 'accessToken'];
52+
53+
if (!!this.bot.manager.apiKey) params.key = this.bot.manager.apiKey;
54+
else params.access_token = this.bot.manager.accessToken;
5455

5556
apiRequest<GetBadges>({
5657
method: 'GET',

src/classes/TF2Inventory.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ export default class TF2Inventory {
100100
private fetch(): Promise<void> {
101101
return new Promise((resolve, reject) => {
102102
const params: SteamRequestParams = { steamid: this.getSteamID.toString() };
103-
const hasApiKey = !!this.manager.apiKey;
104-
params[hasApiKey ? 'key' : 'access_token'] = this.manager[hasApiKey ? 'apiKey' : 'accessToken'];
103+
104+
if (!!this.manager.apiKey) params.key = this.manager.apiKey;
105+
else params.access_token = this.manager.accessToken;
105106

106107
apiRequest<GetPlayerItems>({
107108
method: 'GET',

0 commit comments

Comments
 (0)