From 15f882085a887ed8a92ef4034965ed8ed5457877 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 2 Nov 2024 10:42:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B1=D1=8B=D0=BB=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D1=83=D1=87=D1=91=D1=82?= =?UTF-8?q?=20time2cdm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ds.py | 5 +++++ tg.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ds.py b/ds.py index 673d54d..36125c9 100644 --- a/ds.py +++ b/ds.py @@ -221,6 +221,11 @@ async def time2cdm(message): amount = time*course if update_time(API_TOKEN, id, '0'): if coins_add(API_TOKEN, id, str(amount)): + # Статистика + stat = read('stat.json') + date = datetime.today().strftime('%Y-%m-%d') + stat[date]['time2cdm'] += amount + write(stat, 'stat.json') await send(f'''Вы успешно конвертировали время на сервере в `{str(amount)}` CDM.''') async def stats(message): diff --git a/tg.py b/tg.py index 33f7b58..2411d5d 100644 --- a/tg.py +++ b/tg.py @@ -210,6 +210,11 @@ def time2cdm(message): amount = time*course if update_time(API_TOKEN, id, '0'): if coins_add(API_TOKEN, id, str(amount)): + # Статистика + stat = read('stat.json') + date = datetime.today().strftime('%Y-%m-%d') + stat[date]['time2cdm'] += amount + write(stat, 'stat.json') bot.reply_to(message, f'''Вы успешно конвертировали время на сервере в {hcode(str(amount))} CDM.''' , parse_mode='HTML')