- Attempt a different time pattern if failing first
This commit is contained in:
parent
5d5a2e0e9c
commit
da08e30fa9
1 changed files with 9 additions and 2 deletions
|
|
@ -150,8 +150,15 @@ class DiscordConnector:
|
|||
"""
|
||||
Add line of text to text list. Assumes the message is from the correct room
|
||||
"""
|
||||
utc_time = time.strptime(
|
||||
message["timestamp"], "%Y-%m-%dT%H:%M:%S.%f%z")
|
||||
utc_time = None
|
||||
try:
|
||||
utc_time = time.strptime(
|
||||
message["timestamp"], "%Y-%m-%dT%H:%M:%S.%f%z")
|
||||
except ValueError:
|
||||
utc_time = time.strptime(
|
||||
message["timestamp"], "%Y-%m-%dT%H:%M:%S%z")
|
||||
|
||||
|
||||
epoch_time = calendar.timegm(utc_time)
|
||||
username = message["author"]["username"]
|
||||
if("nick" in message and message['nick'] and len(message["nick"]) > 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue