Properly fix warnings
This commit is contained in:
parent
2a41eda129
commit
9111fd2406
1 changed files with 14 additions and 3 deletions
|
@ -11,8 +11,17 @@ from discord_slash.utils.manage_commands import create_choice, create_option
|
||||||
|
|
||||||
import jarvis
|
import jarvis
|
||||||
from jarvis.db import DBManager
|
from jarvis.db import DBManager
|
||||||
from jarvis.db.types import (Autopurge, Ban, Kick, Lock, Mute, Purge, Setting,
|
from jarvis.db.types import (
|
||||||
Unban, Warning)
|
Autopurge,
|
||||||
|
Ban,
|
||||||
|
Kick,
|
||||||
|
Lock,
|
||||||
|
Mute,
|
||||||
|
Purge,
|
||||||
|
Setting,
|
||||||
|
Unban,
|
||||||
|
Warning,
|
||||||
|
)
|
||||||
from jarvis.utils import build_embed
|
from jarvis.utils import build_embed
|
||||||
from jarvis.utils.field import Field
|
from jarvis.utils.field import Field
|
||||||
from jarvis.utils.permissions import admin_or_permissions
|
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}'
|
f'`{y.created_at.strftime("%Y-%m-%d %H:%M:%S")}` - {y.reason}'
|
||||||
for y in list(filter(lambda x: x.active, warnings))
|
for y in list(filter(lambda x: x.active, warnings))
|
||||||
]
|
]
|
||||||
if len(warnings) > 0
|
if warnings
|
||||||
else ["None"]
|
else ["None"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -831,6 +840,8 @@ class AdminCog(commands.Cog):
|
||||||
if len(active) > 10:
|
if len(active) > 10:
|
||||||
active = active[:10]
|
active = active[:10]
|
||||||
active.append("\n>10 active, results truncated")
|
active.append("\n>10 active, results truncated")
|
||||||
|
elif len(active) == 0:
|
||||||
|
active = ["None"]
|
||||||
|
|
||||||
total = len(warnings)
|
total = len(warnings)
|
||||||
fields = [
|
fields = [
|
||||||
|
|
Loading…
Add table
Reference in a new issue