From bf36e9922480f62f8a5750db63e7cf1d9c47567b Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Mon, 12 Aug 2024 17:48:01 -0400 Subject: [PATCH] fix(aurora): fixed a registry error --- aurora/aurora.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aurora/aurora.py b/aurora/aurora.py index 20bff21..63900ef 100644 --- a/aurora/aurora.py +++ b/aurora/aurora.py @@ -13,6 +13,7 @@ from datetime import datetime, timedelta, timezone from math import ceil import discord +from class_registry.registry import RegistryKeyError from dateutil.parser import ParserError, parse from discord.ext import tasks from redbot.core import app_commands, commands, data_manager @@ -1122,9 +1123,10 @@ class Aurora(commands.Cog): async def aurora_settings_type(self, ctx: commands.Context, moderation_type: str): """Manage configuration options for specific moderation types. - See [the documentation](https://seacogs.coastalcommits.com/Aurora/Types) for a list of built-in moderation types.""" - registered_type = type_registry.get(moderation_type) - if not registered_type: + See [the documentation](https://seacogs.coastalcommits.com/Aurora/Types) for a list of built-in moderation types, or run this command with a junk argument (`awasd` or something) to see a list of valid types.""" + try: + registered_type = type_registry.get(moderation_type) + except RegistryKeyError: types = "`, `".join(type_registry.keys()) await ctx.send(error("`moderation_type` is not a valid moderation type.\nValid types are:\n" + types)) return