Aggiornare 'inline.py'

This commit is contained in:
HonusBot 2020-03-09 00:21:55 +01:00
parent 33d2609a6c
commit 8295eb46a8

View File

@ -67,7 +67,7 @@ class InlineBot:
context.bot.send_message(chat_id=update.effective_chat.id, text="Inline cancer, clop, furry spammer (h0nus)",parse_mode="HTML")
def makeResult(self, qTitle, qMode, qDesc, qValue):
if qMode == "text":
if qMode == "imageurl":
return InlineQueryResultArticle(
id=uuid.uuid4().hex,
type="article",
@ -75,12 +75,12 @@ class InlineBot:
input_message_content=InputTextMessageContent("<a href=\"" + qValue + "\">HonusBot</a>", "HTML"),
description=qDesc
)
if qMode == "image":
if qMode == "genericurl":
return InlineQueryResultArticle(
id=uuid.uuid4().hex,
type="article",
title=qTitle,
input_message_content=InputTextMessageContent("<a href=\"" + qValue + "\">Scherzo del rasoio</a>", "HTML"),
input_message_content=InputTextMessageContent("<a href=\"" + qValue + "\">link</a>", "HTML"),
description=qDesc
)
return InlineQueryResultArticle(
@ -96,15 +96,15 @@ class InlineBot:
query = update.inline_query.query
results = list()
if not query:
results.append(self.makeResult("Pony", "image", "yay, ponies!", self.callRequest("pony", "imageurl", senderid, query)))
results.append(self.makeResult("Clop", "image", "NSFW ponies", self.callRequest("clop", "imageurl", senderid, query)))
results.append(self.makeResult("Furry", "image", "Furries", self.callRequest("furry", "imageurl", senderid, query)))
results.append(self.makeResult("Loli", "image", "Cute lolis", self.callRequest("loli", "imageurl", senderid, query)))
results.append(self.makeResult("Yiff", "image", "Yiff", self.callRequest("yiff", "imageurl", senderid, query)))
results.append(self.makeResult("Lewd", "image", "Say hi to the police", self.callRequest("lewd", "imageurl", senderid, query)))
results.append(self.makeResult("Rasoio", "html", "Dai facciamogli lo scherzo del rasoio!1!!", self.callRequest("rasoio", "htmldescription", senderid, query)))
results.append(self.makeResult("Pony", "imageurl", "yay, ponies!", self.callRequest("pony", "imageurl", senderid, query)))
results.append(self.makeResult("Clop", "imageurl", "NSFW ponies", self.callRequest("clop", "imageurl", senderid, query)))
results.append(self.makeResult("Furry", "imageurl", "Furries", self.callRequest("furry", "imageurl", senderid, query)))
results.append(self.makeResult("Loli", "imageurl", "Cute lolis", self.callRequest("loli", "imageurl", senderid, query)))
results.append(self.makeResult("Yiff", "imageurl", "Yiff", self.callRequest("yiff", "imageurl", senderid, query)))
results.append(self.makeResult("Lewd", "imageurl", "Say hi to the police", self.callRequest("lewd", "imageurl", senderid, query)))
results.append(self.makeResult("Rasoio", "genericurl", "Dai facciamogli lo scherzo del rasoio!1!!", self.callRequest("rasoio", "htmldescription", senderid, query)))
else:
results.append(self.makeResult("Cancer", "image", "Search cancer about " + query, self.callRequest("cancer", "imageurl", senderid, query)))
results.append(self.makeResult("Cancer", "imageurl", "Search cancer about " + query, self.callRequest("cancer", "imageurl", senderid, query)))
context.bot.answer_inline_query(update.inline_query.id, results, 1, False)
InlineBot().start()