Fix on_command to support message commands

This commit is contained in:
Zeva Rose 2022-04-19 17:01:36 -06:00
parent 8f0872b304
commit a4b0ae2b79

View file

@ -164,14 +164,14 @@ class Jarvis(Snake):
return await super().on_command_error(ctx, error, *args, **kwargs)
# Modlog
async def on_command(self, ctx: InteractionContext) -> None:
async def on_command(self, ctx: Context) -> None:
"""Lepton on_command override."""
if not isinstance(ctx.channel, DMChannel) and ctx.invoked_name not in ["pw"]:
modlog = await Setting.find_one(q(guild=ctx.guild.id, setting="activitylog"))
if modlog:
channel = await ctx.guild.fetch_channel(modlog.value)
args = []
if ctx.target_id:
if isinstance(ctx, InteractionContext) and ctx.target_id:
args.append(f"{KEY_FMT}context target:{VAL_FMT}{ctx.target}{RESET}")
for k, v in ctx.kwargs.items():
if isinstance(v, str):