Change formatting to account for missing fields
This commit is contained in:
parent
a35561d567
commit
714fd36fef
1 changed files with 5 additions and 3 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Reference in a new issue