forked from n/quotes-bot-python
Fuck you zayd
This commit is contained in:
parent
b685fa6e18
commit
b572834329
2 changed files with 17 additions and 8 deletions
23
bot.py
23
bot.py
|
@ -79,13 +79,22 @@ async def make_choice(room, message):
|
|||
quoteData = fetch.fetchQuoteData(id)
|
||||
|
||||
def formatData(data):
|
||||
dataToFormat = data
|
||||
created = str(data['created'])
|
||||
description = str(data['desc'])
|
||||
imageid = str(data['iid'])
|
||||
ocr = str(data['ocr'])
|
||||
score = str(data['score'])
|
||||
return created, description, imageid, ocr, score
|
||||
if data is not None:
|
||||
dataToFormat = data
|
||||
created = str(data['created'])
|
||||
description = str(data['desc'])
|
||||
imageid = str(data['iid'])
|
||||
ocr = str(data['ocr'])
|
||||
score = str(data['score'])
|
||||
return created, description, imageid, ocr, score
|
||||
else:
|
||||
dataToFormat = data
|
||||
created = "Error"
|
||||
description = "Error"
|
||||
imageid = "Error"
|
||||
ocr = "Error"
|
||||
score = "Error"
|
||||
return created, description, imageid, ocr, score
|
||||
|
||||
if debugMode == False:
|
||||
created, description, imageid, ocr, score = formatData(quoteData)
|
||||
|
|
2
fetch.py
2
fetch.py
|
@ -30,7 +30,7 @@ def fetchQuoteData(quoteId):
|
|||
print(quoteData.json())
|
||||
else:
|
||||
print(f"An error occured while saving the file: {quoteData.status_code}")
|
||||
return "This file probably doesn't exist."
|
||||
return None
|
||||
|
||||
def fetchTopQuotes(instance):
|
||||
raise NotImplementedError
|
||||
|
|
Loading…
Add table
Reference in a new issue