Skip to content

Commit

Permalink
🔨 refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
idinium96 committed May 3, 2024
1 parent bb264ec commit 16e110b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
10 changes: 4 additions & 6 deletions src/classes/Friends.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions src/classes/TF2Inventory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 16e110b

Please sign in to comment.