summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Weiland <techcrazybsw@gmail.com>2020-11-02 08:27:00 -0600
committerBrett Weiland <techcrazybsw@gmail.com>2020-11-02 08:27:00 -0600
commitd0908100a5cdab8f5d36a9132e72904a56e7c526 (patch)
tree5e5a65368450e69eb29617ede6bf6a6974993159
parenta801659c806c4ffba43fd4f23a5e157b726cc6dd (diff)
modified: post_bot.py
-rwxr-xr-xpost_bot.py8
1 files 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()