Properly fix warnings

This commit is contained in:
Zeva Rose 2021-07-22 09:58:58 -06:00
parent 2a41eda129
commit 9111fd2406

View file

@ -11,8 +11,17 @@ 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
@ -823,7 +832,7 @@ class AdminCog(commands.Cog):
f'`{y.created_at.strftime("%Y-%m-%d %H:%M:%S")}` - {y.reason}'
for y in list(filter(lambda x: x.active, warnings))
]
if len(warnings) > 0
if warnings
else ["None"]
)
@ -831,6 +840,8 @@ class AdminCog(commands.Cog):
if len(active) > 10:
active = active[:10]
active.append("\n>10 active, results truncated")
elif len(active) == 0:
active = ["None"]
total = len(warnings)
fields = [