fix(aurora): fixed a registry error
This commit is contained in:
parent
7c69a89442
commit
bf36e99224
1 changed files with 5 additions and 3 deletions
|
@ -13,6 +13,7 @@ from datetime import datetime, timedelta, timezone
|
||||||
from math import ceil
|
from math import ceil
|
||||||
|
|
||||||
import discord
|
import discord
|
||||||
|
from class_registry.registry import RegistryKeyError
|
||||||
from dateutil.parser import ParserError, parse
|
from dateutil.parser import ParserError, parse
|
||||||
from discord.ext import tasks
|
from discord.ext import tasks
|
||||||
from redbot.core import app_commands, commands, data_manager
|
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):
|
async def aurora_settings_type(self, ctx: commands.Context, moderation_type: str):
|
||||||
"""Manage configuration options for specific moderation types.
|
"""Manage configuration options for specific moderation types.
|
||||||
|
|
||||||
See [the documentation](https://seacogs.coastalcommits.com/Aurora/Types) for a list of built-in moderation types."""
|
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)
|
registered_type = type_registry.get(moderation_type)
|
||||||
if not registered_type:
|
except RegistryKeyError:
|
||||||
types = "`, `".join(type_registry.keys())
|
types = "`, `".join(type_registry.keys())
|
||||||
await ctx.send(error("`moderation_type` is not a valid moderation type.\nValid types are:\n" + types))
|
await ctx.send(error("`moderation_type` is not a valid moderation type.\nValid types are:\n" + types))
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue