fix(aurora): show metadata key/value pairs in /case

This commit is contained in:
Seaswimmer 2024-05-24 04:12:28 -04:00
parent 7a9c9846de
commit 9a4f19f4a1
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F
2 changed files with 5 additions and 0 deletions

View file

@ -1002,6 +1002,7 @@ class Aurora(commands.Cog):
None,
None,
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 log(interaction, moderation.id)

View file

@ -188,13 +188,17 @@ async def case_factory(interaction: Interaction, moderation: Moderation) -> Embe
if moderation.metadata:
if moderation.metadata["imported_from"]:
del moderation.metadata["imported_from"]
embed.description += (
f"\n**Imported From:** {moderation.metadata['imported_from']}"
)
if moderation.metadata["imported_timestamp"]:
del moderation.metadata["imported_timestamp"]
embed.description += (
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)