Add hide_via to InlineResult.click (#1084)

This commit is contained in:
Manuel1510 2019-01-10 23:42:58 +01:00 committed by Lonami
parent ca2c8687c8
commit eda4178333

View File

@ -98,7 +98,7 @@ class InlineResult:
return self.result.document
async def click(self, entity, reply_to=None,
silent=False, clear_draft=False):
silent=False, clear_draft=False, hide_via=False):
"""
Clicks this result and sends the associated `message`.
@ -115,6 +115,10 @@ class InlineResult:
clear_draft (`bool`, optional):
Whether the draft should be removed after sending the
message from this result or not. Defaults to ``False``.
hide_via (`bool`, optional):
Whether the "via @bot" should be hidden or not.
Only works with certain bots (like @bing or @gif).
"""
entity = await self._client.get_input_entity(entity)
reply_id = None if reply_to is None else utils.get_message_id(reply_to)
@ -124,6 +128,7 @@ class InlineResult:
id=self.result.id,
silent=silent,
clear_draft=clear_draft,
hide_via=hide_via,
reply_to_msg_id=reply_id
)
return self._client._get_response_message(