From ca5a8cea139a234b5603542aad839c81374d973b Mon Sep 17 00:00:00 2001 From: Devesh Pal Date: Thu, 5 Aug 2021 09:03:25 +0530 Subject: [PATCH] Resolving conflict --- telethon/tl/custom/inlineresult.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/telethon/tl/custom/inlineresult.py b/telethon/tl/custom/inlineresult.py index a1ce86e7..15639aa5 100644 --- a/telethon/tl/custom/inlineresult.py +++ b/telethon/tl/custom/inlineresult.py @@ -102,7 +102,7 @@ class InlineResult: elif isinstance(self.result, types.BotInlineMediaResult): return self.result.document - async def click(self, entity=None, reply_to=None, + async def click(self, entity=None, reply_to=None, comment_to=None, silent=False, clear_draft=False, hide_via=False, background=None): """ @@ -115,6 +115,11 @@ class InlineResult: reply_to (`int` | `Message `, optional): If present, the sent message will reply to this ID or message. + comment_to (`int` | `Message `, optional): + Similar to ``reply_to``, but replies in the linked group of a + broadcast channel instead (effectively leaving a "comment to" + the specified message). + silent (`bool`, optional): Whether the message should notify people with sound or not. Defaults to `False` (send with a notification sound unless @@ -140,7 +145,11 @@ class InlineResult: else: raise ValueError('You must provide the entity where the result should be sent to') - reply_id = None if reply_to is None else utils.get_message_id(reply_to) + if comment_to: + entity, reply_id = await self._client._get_comment_data(entity, comment_to) + else: + reply_id = None if reply_to is None else utils.get_message_id(reply_to) + req = functions.messages.SendInlineBotResultRequest( peer=entity, query_id=self._query_id,