From d0908100a5cdab8f5d36a9132e72904a56e7c526 Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Mon, 2 Nov 2020 08:27:00 -0600 Subject: modified: post_bot.py --- post_bot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/post_bot.py b/post_bot.py index a26d544..c7eb064 100755 --- a/post_bot.py +++ b/post_bot.py @@ -2,7 +2,7 @@ import requests import re from time import sleep -from datetime import datetime, timezone +from datetime import datetime, timezone, timedelta from os import fork from threading import Timer @@ -74,7 +74,7 @@ rs.post('https://recolor.me/topic/1557621', data={ 'page':'topic', 'action':'reply', 'topic_id':'1557621', - 'reply_message':"Server is booting, or service has restarted.\nThe time is {}".format(datetime.now(timezone.utc)) + 'reply_message':"Server is booting, or service has restarted.\nThe time is {}.\nExistance started {} seconds ago.".format(datetime.now(timezone.utc), datetime.now(timezone.utc).timestamp()), 'box_color':'#0000ff', 'post_color':'#0', 'post_style':'0' @@ -84,9 +84,9 @@ acheive_limit() while True: current_time = datetime.now(timezone.utc) - desired_time = current_time.replace(day=current_time.day+1, hour=6, minute=1, second=0, microsecond=0) + desired_time = current_time.replace(day=current_time.day, hour=6, minute=1, second=0, microsecond=0) + timedelta(days=1) print("starting next run at {}".format(str(desired_time))) - cap_thread = Timer((desired_time - current_time).seconds+1, acheive_limit) + cap_thread = Timer((desired_time - current_time).total_seconds() + 1, acheive_limit) cap_thread.start() cap_thread.join() -- cgit v1.2.3