diff --git a/spaceapi/utils.py b/spaceapi/utils.py --- a/spaceapi/utils.py +++ b/spaceapi/utils.py @@ -5,8 +5,8 @@ import os.path import random import smtplib import ssl +from datetime import datetime from functools import partial -from time import time import mastodon import tweepy @@ -32,6 +32,9 @@ possible_open_messages = ( "Let the Chaos begin! We're open!", "What do we hack now? Come and see, we've just opened!", "TUWAT! Come and hack. We are open!", + "It's {time:%H:%M} and we are open! Come and hack!", + "We just opened our doors at {time:%H:%M}!", + "Bootup process finished at {time:%H:%M}! Doors opened!", ) possible_closed_messages = ( @@ -42,6 +45,8 @@ possible_closed_messages = ( "Poweroff process finished! We're closed!", "Singularity reached! The space is closed!", "Dream of electric sheeps! We are closed!", + "We closed our doors at {time:%H:%M}. See you soon.", + "Poweroff process finished at {time:%H:%M}. We're closed!", ) @@ -144,6 +149,7 @@ class ActiveStatusv14(Singleton, dict): if self["state"]["open"] else random.choice(possible_closed_messages) ) + message = message.format(time=datetime.now()) self.send_tweet(message) self.send_toot(message) @@ -224,7 +230,7 @@ class ActiveStatusv14(Singleton, dict): else: self["state"]["trigger_person"] = trigger_person - self["state"]["lastchange"] = int(time()) + self["state"]["lastchange"] = int(datetime.now().timestamp()) if message is not None and message: self["state"]["message"] = message