fix(aurora): fixed a registry error
All checks were successful
Actions / Build Documentation (MkDocs) (pull_request) Successful in 28s
Actions / Lint Code (Ruff & Pylint) (pull_request) Successful in 41s

This commit is contained in:
Seaswimmer 2024-08-12 17:48:01 -04:00
parent 7c69a89442
commit bf36e99224
Signed by: cswimr
GPG key ID: 3813315477F26F82

View file

@ -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