diff options
| author | 2018-07-24 02:08:07 -0400 | |
|---|---|---|
| committer | 2018-07-24 02:08:07 -0400 | |
| commit | 3a9b3b77fb350cdfd02970e6e00b1df383954b79 (patch) | |
| tree | 6ba8b83c673ba867af16d83987b5eed2b76fdc41 | |
| parent | Use 'Muted' role, show actor in infraction list (diff) | |
Show active status in infraction list, fix Discord pagination rendering issue
| -rw-r--r-- | bot/cogs/moderation.py | 9 | ||||
| -rw-r--r-- | bot/pagination.py | 8 |
2 files changed, 14 insertions, 3 deletions
diff --git a/bot/cogs/moderation.py b/bot/cogs/moderation.py index c4ae52401..69cdfb10c 100644 --- a/bot/cogs/moderation.py +++ b/bot/cogs/moderation.py @@ -371,7 +371,8 @@ class Moderation: ctx=ctx, embed=embed, empty=True, - max_lines=5 + max_lines=3, + max_size=1000 ) elif isinstance(arg, str): @@ -449,15 +450,17 @@ class Moderation: actor_id = int(infraction_object["actor"]["user_id"]) guild: Guild = self.bot.get_guild(constants.Guild.id) actor = guild.get_member(actor_id) + active = infraction_object["active"] is True return "\n".join(( - "===============", + "**===============**" if active else "===============", + "Status: {0}".format("__**Active**__" if active else "Inactive"), "Type: **{0}**".format(infraction_object["type"]), "Reason: {0}".format(infraction_object["reason"] or "*None*"), "Created: {0}".format(infraction_object["inserted_at"]), "Expires: {0}".format(infraction_object["expires_at"] or "*Permanent*"), "Actor: {0}".format(actor.mention if actor else actor_id), - "===============", + "**===============**" if active else "===============" )) diff --git a/bot/pagination.py b/bot/pagination.py index 49fae1e2e..9319a5b60 100644 --- a/bot/pagination.py +++ b/bot/pagination.py @@ -207,6 +207,8 @@ class LinePaginator(Paginator): log.debug(f"Got first page reaction - changing to page 1/{len(paginator.pages)}") + embed.description = "" + await message.edit(embed=embed) embed.description = paginator.pages[current_page] if footer_text: embed.set_footer(text=f"{footer_text} (Page {current_page + 1}/{len(paginator.pages)})") @@ -220,6 +222,8 @@ class LinePaginator(Paginator): log.debug(f"Got last page reaction - changing to page {current_page + 1}/{len(paginator.pages)}") + embed.description = "" + await message.edit(embed=embed) embed.description = paginator.pages[current_page] if footer_text: embed.set_footer(text=f"{footer_text} (Page {current_page + 1}/{len(paginator.pages)})") @@ -237,6 +241,8 @@ class LinePaginator(Paginator): current_page -= 1 log.debug(f"Got previous page reaction - changing to page {current_page + 1}/{len(paginator.pages)}") + embed.description = "" + await message.edit(embed=embed) embed.description = paginator.pages[current_page] if footer_text: @@ -256,6 +262,8 @@ class LinePaginator(Paginator): current_page += 1 log.debug(f"Got next page reaction - changing to page {current_page + 1}/{len(paginator.pages)}") + embed.description = "" + await message.edit(embed=embed) embed.description = paginator.pages[current_page] if footer_text: |