aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Matei Pintilie <lucafulger@gmail.com>2021-09-19 18:28:55 +0000
committerLuca Matei Pintilie <lucafulger@gmail.com>2021-09-19 18:28:55 +0000
commite359f55cf3060784f393c1f03080ed4c5998e4c8 (patch)
tree64de890c0de81ac14ffcde5a4a4521be6cce7cf4
parent1cf369aa65a6ebc46c7dc7e8a9f0aaaf02bfc0ba (diff)
downloadspeedrunbot-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-xsrc/srcom/categories.ts5
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");