From f7f5857ef1b6e355f828df0e027109955fda85ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abdulkadir=20Furkan=20=C5=9Eanl=C4=B1?= Date: Tue, 23 Jan 2024 18:09:03 +0100 Subject: [PATCH] Fix datetime shit again^2. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Abdulkadir Furkan Şanlı --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 0aaad6f..32f6489 100755 --- a/main.py +++ b/main.py @@ -198,7 +198,7 @@ async def message_callback(client, room, event): ) # milisec to sec current_time = datetime.datetime.now(datetime.UTC) - if body == "!parkerbot" and current_time - timestamp_sec < timedelta( + if body == "!parkerbot" and current_time - timestamp_sec < datetime.timedelta( seconds=30 ): intro_message = ( @@ -227,7 +227,7 @@ async def message_callback(client, room, event): }, ) - if body == "!pow" and current_time - timestamp_sec < timedelta(seconds=30): + if body == "!pow" and current_time - timestamp_sec < datetime.timedelta(seconds=30): playlist_link = f"https://www.youtube.com/playlist?list={playlist_id}" reply_msg = f"{sender}, here's the playlist of the week: {playlist_link}" await client.room_send(