Fixed another issue w/ loglevels, and one await in infractions.
This commit is contained in:
parent
9c8be82481
commit
11ee60cd62
12
Heimdallr.py
12
Heimdallr.py
|
@ -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 _:
|
||||||
|
|
|
@ -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})",
|
||||||
|
|
Loading…
Reference in New Issue