Fix bug with warnings if no warnings exist
This commit is contained in:
parent
ec43caeb1e
commit
2a41eda129
2 changed files with 5 additions and 14 deletions
|
@ -36,7 +36,7 @@ jarvis = commands.Bot(
|
|||
)
|
||||
slash = SlashCommand(jarvis, sync_commands=True, sync_on_cog_reload=True)
|
||||
jarvis_self = Process()
|
||||
__version__ = "1.2.0"
|
||||
__version__ = "1.2.1"
|
||||
|
||||
|
||||
db = DBManager(get_config().mongo).mongo
|
||||
|
|
|
@ -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
|
||||
|
@ -832,7 +823,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 warnings
|
||||
if len(warnings) > 0
|
||||
else ["None"]
|
||||
)
|
||||
|
||||
|
@ -841,7 +832,7 @@ class AdminCog(commands.Cog):
|
|||
active = active[:10]
|
||||
active.append("\n>10 active, results truncated")
|
||||
|
||||
total = len(warnings) if warnings else 0
|
||||
total = len(warnings)
|
||||
fields = [
|
||||
Field(f"{n_active} Active", "\n".join(active)),
|
||||
Field("Total", total),
|
||||
|
|
Loading…
Add table
Reference in a new issue