From a4b0ae2b79ee5f76c8885b2aba2f9cbde89b2528 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 19 Apr 2022 17:01:36 -0600 Subject: [PATCH] Fix on_command to support message commands --- jarvis/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jarvis/client.py b/jarvis/client.py index cd9ee8a..2fb93d5 100644 --- a/jarvis/client.py +++ b/jarvis/client.py @@ -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):