From d59552ae7d8f356937027232a542689c2d9b0b45 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 4 Jan 2025 02:44:49 +0300 Subject: [PATCH] fix bstat db counters --- src/stat.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stat.py b/src/stat.py index 43f033d..28f59a9 100644 --- a/src/stat.py +++ b/src/stat.py @@ -17,8 +17,8 @@ async def biomod(client, c): stats_most_chats = bio.most_infect_spam_chats.most_common() stats_most_chats = str(stats_most_chats).replace(',', '\n') when = datetime.timestamp(event.date) - count_eaten = int(c.execute(f"SELECT COUNT(*) FROM `avocado` WHERE expr_int <= {when} LIMIT 1").fetchone()[0]) - count_not_eaten = int(c.execute(f"SELECT COUNT(*) FROM `avocado` WHERE expr_int = 0 LIMIT 1").fetchone()[0]) + count_eaten = int(c.execute(f"SELECT COUNT(*) FROM `avocado` WHERE expr_int >= {when} LIMIT 1").fetchone()[0]) + count_not_eaten = int(c.execute(f"SELECT COUNT(*) FROM `avocado` WHERE expr_int == 0 LIMIT 1").fetchone()[0]) msg = "Session stats:\n" \ f"Medkit usage: {bio.medkit_usage}\n" \ f"Victims in db (eaten/not eaten): {count_eaten}/{count_not_eaten}\n" \