From 1d1df37d842945622f0ec7217ee3b0f7c9148659 Mon Sep 17 00:00:00 2001 From: Ewan Lyon Date: Mon, 15 Mar 2021 11:29:37 +1100 Subject: [PATCH] Add Steam API Key default and error --- configschema.json | 3 ++- src/extension/util/steam-api.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configschema.json b/configschema.json index dae2760..d6c728b 100644 --- a/configschema.json +++ b/configschema.json @@ -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", diff --git a/src/extension/util/steam-api.ts b/src/extension/util/steam-api.ts index a55b2e3..0c87d15 100644 --- a/src/extension/util/steam-api.ts +++ b/src/extension/util/steam-api.ts @@ -17,6 +17,8 @@ export async function getProfilePicture(steamid: string): Promise<{ id: string; return json.response.players.map((player: Record) => { return { id: player.steamid, pfp: player.avatarfull }; }); + } else { + nodecg.log.error('No Steam API Key') } return []; @@ -51,6 +53,8 @@ export async function getProfileData(steamids: string[]): Promise