fix #660 prepare parse mode for input_message_content (#661)

* fix #660 prepare parse mode for input_message_content of InlineQueryResult

* remove redundant get

* black lint

* add towncrier patch note
This commit is contained in:
darksidecat 2021-08-17 00:08:36 +03:00 committed by GitHub
parent 7cb0ac1ee2
commit 71eb5fc44e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 2 deletions

View file

@ -37,5 +37,12 @@ class AnswerInlineQuery(TelegramMethod[bool]):
def build_request(self, bot: Bot) -> Request:
data: Dict[str, Any] = self.dict()
prepare_parse_mode(bot, data["results"])
input_message_contents = []
for result in data["results"]:
input_message_content = result.get("input_message_content", None)
if input_message_content is not None:
input_message_contents.append(input_message_content)
prepare_parse_mode(bot, data["results"] + input_message_contents)
return Request(method="answerInlineQuery", data=data)