fix bstat db counters

This commit is contained in:
Your Name 2025-01-04 02:44:49 +03:00
parent 8c81fe5c5e
commit d59552ae7d

View file

@ -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" \