[Quiz] Catch bad category ID

This commit is contained in:
aikaterna
2021-04-12 11:04:13 -07:00
committed by GitHub
parent 9bce142556
commit 6d2045bd39

View File

@@ -108,7 +108,10 @@ class Quiz(commands.Cog):
if 9 <= int(category_name_or_id) >= 32:
return await ctx.send(f"Invalid category number. Use `{ctx.prefix}quiz categories` to see a list.")
category_id = category_name_or_id
category_name = await self.category_name_from_id(int(category_name_or_id))
try:
category_name = await self.category_name_from_id(int(category_name_or_id))
except RuntimeError:
return await ctx.send(f"Invalid category ID. Use `{ctx.prefix}quiz categories` to see a list.")
else:
# cat name specified
try: