WIP: Moderation type registry #26
1 changed files with 7 additions and 6 deletions
|
@ -187,18 +187,19 @@ async def case_factory(interaction: Interaction, moderation: Moderation) -> Embe
|
||||||
embed.description += f"\n**Role:** {role.name}"
|
embed.description += f"\n**Role:** {role.name}"
|
||||||
|
|
||||||
if moderation.metadata:
|
if moderation.metadata:
|
||||||
if moderation.metadata["imported_from"]:
|
if moderation.metadata.get("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"]:
|
moderation.metadata.pop("imported_from")
|
||||||
del moderation.metadata["imported_timestamp"]
|
if moderation.metadata.get("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():
|
moderation.metadata.pop("imported_timestamp")
|
||||||
embed.description += f"\n**{key.title()}:** {value}"
|
if moderation.metadata.items():
|
||||||
|
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