Merge pull request 'use nice timestamps (like ISO 8601)' (#1) from paige/quotes-bot-python:main into main
Reviewed-on: #1
This commit is contained in:
commit
ee73b777ba
1 changed files with 3 additions and 1 deletions
4
bot.py
4
bot.py
|
@ -1,6 +1,7 @@
|
||||||
import simplematrixbotlib as botLibrary
|
import simplematrixbotlib as botLibrary
|
||||||
import json
|
import json
|
||||||
import fetch
|
import fetch
|
||||||
|
import time
|
||||||
|
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
|
||||||
|
@ -76,8 +77,9 @@ async def make_choice(room, message):
|
||||||
|
|
||||||
def formatData(data):
|
def formatData(data):
|
||||||
if data is not None:
|
if data is not None:
|
||||||
|
timestamp = time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(data['created']))
|
||||||
dataToFormat = data
|
dataToFormat = data
|
||||||
created = str(data['created'])
|
created = timestamp
|
||||||
description = str(data['desc'])
|
description = str(data['desc'])
|
||||||
imageid = str(data['iid'])
|
imageid = str(data['iid'])
|
||||||
ocr = str(data['ocr'])
|
ocr = str(data['ocr'])
|
||||||
|
|
Loading…
Add table
Reference in a new issue