fix(aurora): show metadata key/value pairs in /case
This commit is contained in:
parent
7a9c9846de
commit
9a4f19f4a1
2 changed files with 5 additions and 0 deletions
|
@ -1002,6 +1002,7 @@ class Aurora(commands.Cog):
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
reason,
|
reason,
|
||||||
|
metadata={"interval": interval}
|
||||||
)
|
)
|
||||||
await interaction.edit_original_response(content=f"Slowmode in {channel.mention} has been set to {interval} seconds! (Case `#{moderation.id:,}`)\n**Reason** - `{reason}`")
|
await interaction.edit_original_response(content=f"Slowmode in {channel.mention} has been set to {interval} seconds! (Case `#{moderation.id:,}`)\n**Reason** - `{reason}`")
|
||||||
await log(interaction, moderation.id)
|
await log(interaction, moderation.id)
|
||||||
|
|
|
@ -188,13 +188,17 @@ async def case_factory(interaction: Interaction, moderation: Moderation) -> Embe
|
||||||
|
|
||||||
if moderation.metadata:
|
if moderation.metadata:
|
||||||
if moderation.metadata["imported_from"]:
|
if moderation.metadata["imported_from"]:
|
||||||
|
del moderation.metadata["imported_from"]
|
||||||
embed.description += (
|
embed.description += (
|
||||||
f"\n**Imported From:** {moderation.metadata['imported_from']}"
|
f"\n**Imported From:** {moderation.metadata['imported_from']}"
|
||||||
)
|
)
|
||||||
if moderation.metadata["imported_timestamp"]:
|
if moderation.metadata["imported_timestamp"]:
|
||||||
|
del moderation.metadata["imported_timestamp"]
|
||||||
embed.description += (
|
embed.description += (
|
||||||
f"\n**Imported Timestamp:** <t:{moderation.metadata['imported_timestamp']}> | <t:{moderation.metadata['imported_timestamp']}:R>"
|
f"\n**Imported Timestamp:** <t:{moderation.metadata['imported_timestamp']}> | <t:{moderation.metadata['imported_timestamp']}:R>"
|
||||||
)
|
)
|
||||||
|
for key, value in moderation.metadata.items():
|
||||||
|
embed.description += f"\n**{key.title()}:** {value}"
|
||||||
|
|
||||||
embed.add_field(name="Reason", value=box(moderation.reason), inline=False)
|
embed.add_field(name="Reason", value=box(moderation.reason), inline=False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue