Fix datetime shit again^2.

Signed-off-by: Abdulkadir Furkan Şanlı <me@abdulocra.cy>
This commit is contained in:
Abdulkadir Furkan Şanlı 2024-01-23 18:09:03 +01:00
parent 821ed5ab08
commit f7f5857ef1
Signed by: afk
SSH Key Fingerprint: SHA256:s1hULLl4YWdqU501MUfGe1CAG/m1pf9Cs6vFsqeTNHk

View File

@ -198,7 +198,7 @@ async def message_callback(client, room, event):
) # milisec to sec ) # milisec to sec
current_time = datetime.datetime.now(datetime.UTC) 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 seconds=30
): ):
intro_message = ( 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}" playlist_link = f"https://www.youtube.com/playlist?list={playlist_id}"
reply_msg = f"{sender}, here's the playlist of the week: {playlist_link}" reply_msg = f"{sender}, here's the playlist of the week: {playlist_link}"
await client.room_send( await client.room_send(