diff --git a/inline.py b/inline.py index da1af7e..97394bb 100644 --- a/inline.py +++ b/inline.py @@ -161,11 +161,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') @@ -212,10 +212,10 @@ class InlineBot: description=self.errorText ) - qValue = self.callRequest(command, senderid, querySearch) + resp = self.callRequest(command, senderid, querySearch) contentText = "" - if qValue == None: + if resp == None: return InlineQueryResultArticle( id=uuid.uuid4().hex, type="article",