From 714fd36fef7121433b5c943e8432d18a4c87255b Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Tue, 3 May 2022 16:24:07 -0600 Subject: [PATCH] Change formatting to account for missing fields --- jarvis/cogs/admin/modcase.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jarvis/cogs/admin/modcase.py b/jarvis/cogs/admin/modcase.py index c91e8fd..f88366b 100644 --- a/jarvis/cogs/admin/modcase.py +++ b/jarvis/cogs/admin/modcase.py @@ -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(