diff options
-rwxr-xr-x | post_bot.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/post_bot.py b/post_bot.py index d75912f..a26d544 100755 --- a/post_bot.py +++ b/post_bot.py @@ -51,7 +51,7 @@ def acheive_limit(): 'page':'topic', 'action':'reply', 'topic_id':'1557621', - 'reply_message':"Done for today!\nSleeping until 06:00 UTC.".format("04:00"), + 'reply_message':"Done for today!\nSleeping until 06:01 UTC.", 'box_color':'#0000ff', 'post_color':'#0', 'post_style':'0' @@ -68,11 +68,23 @@ def acheive_limit(): 'post_style':'0' }) + +rs.post('https://recolor.me/topic/1557621', data={ + 'key':key, + 'page':'topic', + 'action':'reply', + 'topic_id':'1557621', + 'reply_message':"Server is booting, or service has restarted.\nThe time is {}".format(datetime.now(timezone.utc)) + 'box_color':'#0000ff', + 'post_color':'#0', + 'post_style':'0' + }) + acheive_limit() while True: current_time = datetime.now(timezone.utc) - desired_time = current_time.replace(day=current_time.day+1, hour=6, minute=0, second=0, microsecond=0) + desired_time = current_time.replace(day=current_time.day+1, hour=6, minute=1, second=0, microsecond=0) print("starting next run at {}".format(str(desired_time))) cap_thread = Timer((desired_time - current_time).seconds+1, acheive_limit) cap_thread.start() |