Skip to content

Commit

Permalink
Add Steam API Key default and error
Browse files Browse the repository at this point in the history
  • Loading branch information
EwanLyon committed Mar 15, 2021
1 parent 13ee64b commit 1d1df37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion configschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
},
"steamApiKey": {
"type": "string",
"description": "Steam API key used to get steam profile pictures (https://steamcommunity.com/dev/apikey)"
"description": "Steam API key used to get steam profile pictures (https://steamcommunity.com/dev/apikey)",
"default": "STEAM-API-KEY"
},
"gameSettings": {
"type": "object",
Expand Down
4 changes: 4 additions & 0 deletions src/extension/util/steam-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export async function getProfilePicture(steamid: string): Promise<{ id: string;
return json.response.players.map((player: Record<string, unknown>) => {
return { id: player.steamid, pfp: player.avatarfull };
});
} else {
nodecg.log.error('No Steam API Key')
}

return [];
Expand Down Expand Up @@ -51,6 +53,8 @@ export async function getProfileData(steamids: string[]): Promise<SteamProfileDa
realname: player.realname,
} as SteamProfileData;
});
} else {
nodecg.log.error('No Steam API Key')
}

return [];
Expand Down

0 comments on commit 1d1df37

Please sign in to comment.