missing selfs

This commit is contained in:
Christian Rendina 2020-05-05 17:21:36 +02:00
parent 497cfe33b0
commit 1778aeab50

View File

@ -67,16 +67,16 @@ class JSONResponse(object):
self.imgUrl = img
self.htmlDesc = dsc
def isAuthorized():
def isAuthorized(self):
return self.auth
def succeeded():
def succeeded(self):
return self.success
def getHtmlDesc():
def getHtmlDesc(self):
return self.htmlDesc
def getImageUrl():
def getImageUrl(self):
return self.imgUrl
class Config:
@ -162,11 +162,11 @@ class InlineBot:
return None
resp = None
#try:
resp = json.loads(r.text, object_hook = jsonasResponse)
#except:
# self.logger.warning('JSON deserialization failed')
# return None ## Invalid json
try:
resp = json.loads(r.text, object_hook = jsonasResponse)
except:
self.logger.warning('JSON deserialization failed')
return None ## Invalid json
if not resp.isAuthorized() or not resp.succeeded():
self.logger.warning('Unathorized/Unsuccessfull')