Fix on_command to support message commands
This commit is contained in:
parent
8f0872b304
commit
a4b0ae2b79
1 changed files with 2 additions and 2 deletions
|
@ -164,14 +164,14 @@ class Jarvis(Snake):
|
||||||
return await super().on_command_error(ctx, error, *args, **kwargs)
|
return await super().on_command_error(ctx, error, *args, **kwargs)
|
||||||
|
|
||||||
# Modlog
|
# Modlog
|
||||||
async def on_command(self, ctx: InteractionContext) -> None:
|
async def on_command(self, ctx: Context) -> None:
|
||||||
"""Lepton on_command override."""
|
"""Lepton on_command override."""
|
||||||
if not isinstance(ctx.channel, DMChannel) and ctx.invoked_name not in ["pw"]:
|
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"))
|
modlog = await Setting.find_one(q(guild=ctx.guild.id, setting="activitylog"))
|
||||||
if modlog:
|
if modlog:
|
||||||
channel = await ctx.guild.fetch_channel(modlog.value)
|
channel = await ctx.guild.fetch_channel(modlog.value)
|
||||||
args = []
|
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}")
|
args.append(f"{KEY_FMT}context target:{VAL_FMT}{ctx.target}{RESET}")
|
||||||
for k, v in ctx.kwargs.items():
|
for k, v in ctx.kwargs.items():
|
||||||
if isinstance(v, str):
|
if isinstance(v, str):
|
||||||
|
|
Loading…
Add table
Reference in a new issue