Also reference kwargs for modlog command invoke, closes #43

This commit is contained in:
Zeva Rose 2021-07-11 17:11:15 -06:00
parent 23aa336ad5
commit 126916837f

View file

@ -427,12 +427,26 @@ class ModlogCog(commands.Cog):
channel = ctx.guild.get_channel(modlog["value"]) channel = ctx.guild.get_channel(modlog["value"])
fields = [ fields = [
Field("Command", ctx.name), Field("Command", ctx.name),
Field(
"Args",
" ".join(ctx.args) if ctx.args else "N/A",
False,
),
] ]
if ctx.args:
fields.append(
Field(
"Args",
" ".join(ctx.args),
False,
)
)
if ctx.kwargs:
kwargs_string = " ".join(
f"{k}: {ctx.kwargs[k]}" for k in ctx.kwargs
)
fields.append(
Field(
"Keyword Args",
kwargs_string,
False,
)
)
if ctx.subcommand_name: if ctx.subcommand_name:
fields.insert(1, Field("Subcommand", ctx.subcommand_name)) fields.insert(1, Field("Subcommand", ctx.subcommand_name))
embed = build_embed( embed = build_embed(