diff --git a/inline.py b/inline.py
index 7118783..da1af7e 100644
--- a/inline.py
+++ b/inline.py
@@ -116,7 +116,6 @@ class Config:
return self.userAgent
def jsonasResponse(dct):
- print("LOG:::",str(dct))
if "imageUrl" in dct:
return JSONResponse(dct["authorized"], dct["success"], dct["imageUrl"], "")
elif "htmlDescription" in dct:
@@ -145,7 +144,7 @@ class InlineBot:
self.commands.append(Command("Yiff", "Yiff", "imageurl", "imageUrl"))
self.commands.append(Command("Lewd", "Say hi to the police", "imageurl", "imageUrl"))
self.commands.append(Command("Rasoio", "Dai facciamogli lo scherzo del rasoio!1!!", "genericurl", "htmlDescription"))
- self.cancerCommand = Command("Cancer", "Search cancer", "imageurl", "imageurl")
+ self.cancerCommand = Command("Cancer", "Search cancer", "imageurl", "imageUrl")
def callRequest(self, command, senderid, text = ""):
if not command:
@@ -172,13 +171,7 @@ class InlineBot:
self.logger.warning('Unathorized/Unsuccessfull')
return None
- txt = r.headers[command.getHeaderField()]
-
- if len(txt) < 1:
- self.logger.warning('Wrong response in header:',command.getHeaderField())
- return None ## Wrong api?
-
- return txt
+ return resp
def start(self):
self.prequest = Request(con_pool_size=int(self.config.getBotConnectionPool()))
@@ -204,7 +197,7 @@ class InlineBot:
def errorHandler(self, update, context):
"""Log Errors caused by Updates."""
- self.logger.warning('Update "%s" caused error "%s"', update, context.error)
+ self.logger.error('Update "%s" caused error "%s"', update, context.error)
def commandStart(self, update, context):
context.bot.send_message(chat_id=update.effective_chat.id, text="Inline cancer, clop, furry spammer (h0nus)",parse_mode="HTML")
@@ -232,9 +225,9 @@ class InlineBot:
)
if command.getMode() == "imageurl":
- contentText = InputTextMessageContent("HonusBot", "HTML")
+ contentText = InputTextMessageContent("HonusBot", "HTML")
elif command.getMode() == "genericurl":
- contentText = InputTextMessageContent("link", "HTML")
+ contentText = InputTextMessageContent("link", "HTML")
else:
contentText = InputTextMessageContent("Error", "HTML")