feat(bot): ✨ Add "Ongoing Bans" stat to p.stats and reduce default iterations to 4.

This commit is contained in:
Nyeki.py
2024-10-25 20:33:43 -03:00
parent 1c77532a7f
commit 20b22a1f17
+11 -1
View File
@@ -329,7 +329,7 @@ class Mods(base.Cog):
@commands.command() @commands.command()
@commands.is_owner() @commands.is_owner()
async def stats( async def stats(
self, ctx: commands.Context, iterations: int = 5, wait: int = 5 self, ctx: commands.Context, iterations: int = 4, wait: int = 5
) -> None: ) -> None:
""" """
Shows all Payphone's stats. Shows all Payphone's stats.
@@ -362,6 +362,16 @@ class Mods(base.Cog):
lambda: models.Call.filter(ended_at=None).count(), lambda: models.Call.filter(ended_at=None).count(),
), ),
("Bans", lambda: models.Ban.all().count()), ("Bans", lambda: models.Ban.all().count()),
(
"Ongoing Bans",
lambda: models.Ban.filter(
expressions.Q(
expires_at=None,
expires_at__gt=datetime.now(timezone.utc),
join_type="OR",
)
).count(),
),
("Reports", lambda: models.Report.all().count()), ("Reports", lambda: models.Report.all().count()),
( (
"On-review Reports", "On-review Reports",