From 4e12f2e03a4656400f10e525b79c3a989fe860d5 Mon Sep 17 00:00:00 2001 From: graynk Date: Sun, 20 Feb 2022 20:46:18 +0500 Subject: [PATCH] we need to log current timestamp, not message, because the message may be old --- bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index ee09e57..220db8a 100644 --- a/bot.py +++ b/bot.py @@ -143,8 +143,8 @@ def transcribe(file_name: str, message: Message, lang_code: str = 'ru-RU', alter (message.chat_id,)) cur.execute("update customer set balance = balance - (%s);", (actual_duration,)) - cur.execute("insert into stat(user_id, message_timestamp, duration) values (%s, %s, %s);", - (message.chat_id, message.date, actual_duration)) + cur.execute("insert into stat(user_id, message_timestamp, duration) values (%s, current_timestamp, %s);", + (message.chat_id, actual_duration)) conn.commit() os.remove(file_name)