diff options
author | Luca Matei Pintilie <lucafulger@gmail.com> | 2021-09-19 18:28:55 +0000 |
---|---|---|
committer | Luca Matei Pintilie <lucafulger@gmail.com> | 2021-09-19 18:28:55 +0000 |
commit | e359f55cf3060784f393c1f03080ed4c5998e4c8 (patch) | |
tree | 64de890c0de81ac14ffcde5a4a4521be6cce7cf4 | |
parent | 1cf369aa65a6ebc46c7dc7e8a9f0aaaf02bfc0ba (diff) | |
download | speedrunbot-slash-e359f55cf3060784f393c1f03080ed4c5998e4c8.tar speedrunbot-slash-e359f55cf3060784f393c1f03080ed4c5998e4c8.tar.gz speedrunbot-slash-e359f55cf3060784f393c1f03080ed4c5998e4c8.tar.bz2 speedrunbot-slash-e359f55cf3060784f393c1f03080ed4c5998e4c8.tar.lz speedrunbot-slash-e359f55cf3060784f393c1f03080ed4c5998e4c8.tar.xz speedrunbot-slash-e359f55cf3060784f393c1f03080ed4c5998e4c8.tar.zst speedrunbot-slash-e359f55cf3060784f393c1f03080ed4c5998e4c8.zip |
Add ILs to categories command
-rwxr-xr-x | src/srcom/categories.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/srcom/categories.ts b/src/srcom/categories.ts index 1b62fef..3ead604 100755 --- a/src/srcom/categories.ts +++ b/src/srcom/categories.ts @@ -35,13 +35,16 @@ export async function categories( const res = await fetch(`${SRC_API}/games/${gameId}/categories`); const categories = (await res.json()).data as SpeedrunCom.Category[]; const fullGameCategories: string[] = []; + const individualLevelCategories: string[] = []; const miscCategories: string[] = []; categories.forEach((category) => { if (category.miscellaneous) miscCategories.push(category.name); - else fullGameCategories.push(category.name); + else if(category.type === "per-game") fullGameCategories.push(category.name); + else if(category.type === "per-level") individualLevelCategories.push(category.name); }); output.push(`${fmt.bold(`Categories - ${game}`)}`); output.push(`Fullgame: ${fullGameCategories.join(", ")}`); + output.push(`Individual Level: ${individualLevelCategories.join(", ")}`); output.push(`Miscellaneous: ${miscCategories.join(", ")}`); } return output.join("\n"); |