From 23a93b5dbdec0f9f259ad217588393ac0e4f081b Mon Sep 17 00:00:00 2001 From: Rykov7 Date: Mon, 20 Feb 2023 05:21:52 +0300 Subject: [PATCH] fix rollback --- app/report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/report.py b/app/report.py index b4edb9e..ac93c5d 100644 --- a/app/report.py +++ b/app/report.py @@ -8,7 +8,7 @@ def create_report_text(chat_id): top_users = '' flooders = [] if os.path.exists(f'{DATA}{chat_id}.db'): - with shelve.open(f'{DATA}{chat_id}') as s: + with shelve.open(f'{DATA}{chat_id}', writeback=True) as s: for user_id in ROLLBACK: if user_id in s['Messages'] and s['Messages'][user_id]['Count'] > 10: s['Messages'][user_id]['Count'] //= 3