Fixed another issue w/ loglevels, and one await in infractions.

This commit is contained in:
Vegard Berg 2022-08-29 02:50:55 +02:00
parent 9c8be82481
commit 11ee60cd62
Signed by: myrkvi
GPG Key ID: BFE35EA1A44D5E40
2 changed files with 7 additions and 7 deletions

View File

@ -127,19 +127,19 @@ async def bot_info_command(ctx: InteractionContext):
def set_loglevel(level: str): def set_loglevel(level: str):
loglevel = logging.WARNING loglevel = logging.WARNING
match str(level).lower(): match str(level).lower().strip():
case "d", "debug": case "d" | "debug":
loglevel = logging.DEBUG loglevel = logging.DEBUG
case "i", "info", "information": case "i" | "info" | "information":
loglevel = logging.INFO loglevel = logging.INFO
case "w", "warn", "warning": case "w" | "warn" | "warning":
loglevel = logging.WARNING loglevel = logging.WARNING
case "e", "error": case "e" | "error":
loglevel = logging.ERROR loglevel = logging.ERROR
case "c", "critical": case "c" | "critical":
loglevel = logging.CRITICAL loglevel = logging.CRITICAL
case _: case _:

View File

@ -214,7 +214,7 @@ class Infractions(Extension):
guild_settings: Optional[GuildSettings] = GuildSettings.get_or_none(GuildSettings.guild_id == int(ctx.guild_id)) guild_settings: Optional[GuildSettings] = GuildSettings.get_or_none(GuildSettings.guild_id == int(ctx.guild_id))
if guild_settings is not None: if guild_settings is not None:
if guild_settings.admin_channel is not None: if guild_settings.admin_channel is not None:
admin_channel = self.client.fetch_channel(int(guild_settings.admin_channel)) admin_channel = await self.client.fetch_channel(int(guild_settings.admin_channel))
if admin_channel is not None: if admin_channel is not None:
await admin_channel.send(embed=Embed( await admin_channel.send(embed=Embed(
title=f"Warned {user.display_name} ({user.username}#{user.discriminator}, {user.id})", title=f"Warned {user.display_name} ({user.username}#{user.discriminator}, {user.id})",