From e9cb03814f472823d92873a171a5f2f9fb5ea601 Mon Sep 17 00:00:00 2001 From: Rykov7 Date: Sat, 23 Dec 2023 22:24:56 +0300 Subject: [PATCH] Fix shelve counter. --- src/report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/report.py b/src/report.py index e09c571..75a773f 100644 --- a/src/report.py +++ b/src/report.py @@ -14,7 +14,7 @@ def increment(chat_id: int, banned: bool = True): Увеличивает счетчик банов или удаленных """ category = "Banned" if banned else "Deleted" - with shelve.open(f"{DATA}{chat_id}") as shelve_db: + with shelve.open(f"{DATA}{chat_id}", writeback=True) as shelve_db: shelve_db[category] += 1