From 96ee4edf4834881482c44ec54a3da57cff6c04c7 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Mon, 2 May 2022 10:09:17 -0600 Subject: [PATCH] Fix context accessing to use invoked_name --- jarvis/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jarvis/client.py b/jarvis/client.py index 667b80c..05a1016 100644 --- a/jarvis/client.py +++ b/jarvis/client.py @@ -89,7 +89,7 @@ class Jarvis(Snake): self.logger.debug(f"{add} additions, {sub} removals") async def _prerun(self, ctx: Context, *args, **kwargs) -> None: - name = ctx.invoked_name + name = ctx.invoke_target if isinstance(ctx, InteractionContext) and ctx.target_id: kwargs["context target"] = ctx.target args = " ".join(f"{k}:{v}" for k, v in kwargs.items()) @@ -131,7 +131,7 @@ class Jarvis(Snake): self, ctx: Context, error: Exception, *args: list, **kwargs: dict ) -> None: """NAFF on_command_error override.""" - name = ctx.invoked_name if isinstance(ctx, InteractionContext) else ctx.invoked_target + name = ctx.invoke_target self.logger.debug(f"Handling error in {name}: {error}") if isinstance(error, CommandOnCooldown): await ctx.send(str(error), ephemeral=True) @@ -201,7 +201,7 @@ class Jarvis(Snake): # Modlog async def on_command(self, ctx: Context) -> None: """NAFF on_command override.""" - name = ctx.invoked_name if isinstance(ctx, InteractionContext) else ctx.invoked_target + name = ctx.invoke_target if not isinstance(ctx.channel, DMChannel) and name not in ["pw"]: modlog = await Setting.find_one(q(guild=ctx.guild.id, setting="activitylog")) if modlog: @@ -225,7 +225,7 @@ class Jarvis(Snake): fields = [ EmbedField( name="Command", - value=f"```ansi\n{CMD_FMT}{ctx.invoked_name}{RESET} {args}\n```", + value=f"```ansi\n{CMD_FMT}{ctx.invoke_target}{RESET} {args}\n```", inline=False, ), ]