diff --git a/jarvis/cogs/admin.py b/jarvis/cogs/admin.py index 31f2a48..942e050 100644 --- a/jarvis/cogs/admin.py +++ b/jarvis/cogs/admin.py @@ -11,17 +11,8 @@ from discord_slash.utils.manage_commands import create_choice, create_option import jarvis from jarvis.db import DBManager -from jarvis.db.types import ( - Autopurge, - Ban, - Kick, - Lock, - Mute, - Purge, - Setting, - Unban, - Warning, -) +from jarvis.db.types import (Autopurge, Ban, Kick, Lock, Mute, Purge, Setting, + Unban, Warning) from jarvis.utils import build_embed from jarvis.utils.field import Field from jarvis.utils.permissions import admin_or_permissions @@ -827,21 +818,17 @@ class AdminCog(commands.Cog): async def _warnings(self, ctx: SlashContext, user: User): await ctx.defer() warnings = Warning.get_many(user=user.id, guild=ctx.guild.id) - active = ( - [ - f'`{y.created_at.strftime("%Y-%m-%d %H:%M:%S")}` - {y.reason}' - for y in list(filter(lambda x: x.active, warnings)) - ] - if warnings - else ["None"] - ) + active = [ + f'`{y.created_at.strftime("%Y-%m-%d %H:%M:%S")}` - {y.reason}' + for y in list(filter(lambda x: x.active, warnings)) + ] n_active = len(active) if len(active) > 10: active = active[:10] active.append("\n>10 active, results truncated") elif len(active) == 0: - active = ["None"] + active = ["No active warnings"] total = len(warnings) fields = [