Update modcase styling to include extra info
This commit is contained in:
parent
4965579897
commit
2630cf4c92
1 changed files with 14 additions and 10 deletions
|
@ -54,7 +54,8 @@ class CaseCog(Cog):
|
|||
console = Console()
|
||||
|
||||
action_output = ""
|
||||
for action in mod_case.actions:
|
||||
action_output_extra = ""
|
||||
for idx, action in enumerate(mod_case.actions):
|
||||
parent_action = await ACTIONS_LOOKUP[action.action_type].find_one(q(id=action.parent))
|
||||
if not parent_action:
|
||||
action.orphaned = True
|
||||
|
@ -69,13 +70,16 @@ class CaseCog(Cog):
|
|||
console.print(action_table)
|
||||
|
||||
tmp_output = cap.get()
|
||||
if len(tmp_output) >= 1000:
|
||||
if len(tmp_output) >= 800:
|
||||
action_output_extra = f"... and {len(mod_case.actions[idx:])} more actions"
|
||||
break
|
||||
|
||||
action_output = tmp_output
|
||||
|
||||
note_output = ""
|
||||
for note in sorted(mod_case.notes, key=lambda x: x.created_at):
|
||||
note_output_extra = ""
|
||||
notes = sorted(mod_case.notes, key=lambda x: x.created_at)
|
||||
for idx, note in enumerate(notes):
|
||||
admin = await self.bot.fetch_user(note.admin)
|
||||
admin_text = "N/A"
|
||||
if admin:
|
||||
|
@ -87,6 +91,7 @@ class CaseCog(Cog):
|
|||
|
||||
tmp_output = cap.get()
|
||||
if len(tmp_output) >= 1000:
|
||||
note_output_extra = f"... and {len(notes[idx:])} more notes"
|
||||
break
|
||||
|
||||
note_output = tmp_output
|
||||
|
@ -105,20 +110,19 @@ class CaseCog(Cog):
|
|||
if admin:
|
||||
admin_text = admin.mention
|
||||
|
||||
ts = int(mod_case.created_at.timestamp())
|
||||
|
||||
action_output = f"```ansi\n{action_output}\n```"
|
||||
note_output = f"```ansi\n{note_output}\n```"
|
||||
action_output = f"```ansi\n{action_output}\n{action_output_extra}\n```"
|
||||
note_output = f"```ansi\n{note_output}\n{note_output_extra}\n```"
|
||||
|
||||
fields = (
|
||||
EmbedField(name="Opened By", value=admin_text),
|
||||
EmbedField(name="Opened At", value=f"<t:{ts}:F>"),
|
||||
EmbedField(name="Actions", value=action_output),
|
||||
EmbedField(name="Notes", value=note_output),
|
||||
)
|
||||
|
||||
embed = build_embed(
|
||||
title="Moderation Case", description=f"{status} case against {user_text}", fields=fields
|
||||
title=f"Moderation Case [{mod_case.id}]",
|
||||
description=f"{status} case against {user_text} opened by {admin_text}",
|
||||
fields=fields,
|
||||
timestamp=mod_case.created_at,
|
||||
)
|
||||
icon_url = None
|
||||
if user:
|
||||
|
|
Loading…
Add table
Reference in a new issue