main: add signal_timestamp_to_datetime()
This commit is contained in:
parent
5a2ff14d35
commit
7ec74d859f
5
main.py
5
main.py
@ -17,6 +17,9 @@ class Config(BaseModel):
|
||||
apiurl: str
|
||||
number: str
|
||||
|
||||
def signal_timestamp_to_datetime(timestamp: str) -> datetime.datetime:
|
||||
return datetime.datetime.fromtimestamp(int(timestamp)/1000)
|
||||
|
||||
class SignalAPI:
|
||||
|
||||
def __init__(self, apiurl, number):
|
||||
@ -256,7 +259,7 @@ class LabCleaningBot:
|
||||
res = self.api.send_message(message)
|
||||
|
||||
if is_ok(res):
|
||||
timestamp = datetime.datetime.fromtimestamp(int(res.unwrap().timestamp)/1000)
|
||||
timestamp = signal_timestamp_to_datetime(res.unwrap().timestamp)
|
||||
request.requested_at = timestamp
|
||||
else:
|
||||
print(res.unwrap_err())
|
||||
|
Loading…
Reference in New Issue
Block a user