Change formatting to account for missing fields

This commit is contained in:
Zeva Rose 2022-05-03 16:24:07 -06:00
parent a35561d567
commit 714fd36fef

View file

@ -78,7 +78,7 @@ class CaseCog(Cog):
note_output = ""
note_output_extra = ""
notes = sorted(mod_case.notes, key=lambda x: x.created_at)
notes = sorted(mod_case.notes or [], key=lambda x: x.created_at)
for idx, note in enumerate(notes):
admin = await self.bot.fetch_user(note.admin)
admin_text = "[N/A]"
@ -114,8 +114,10 @@ class CaseCog(Cog):
note_output = f"```ansi\n{note_output}\n{note_output_extra}\n```"
fields = (
EmbedField(name="Actions", value=action_output),
EmbedField(name="Notes", value=note_output),
EmbedField(
name="Actions", value=action_output if mod_case.actions else "No Actions Found"
),
EmbedField(name="Notes", value=note_output if mod_case.notes else "No Notes Found"),
)
embed = build_embed(