mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-21 17:06:36 +03:00
Fix reply_to can be optional
This commit is contained in:
parent
75ed58ad89
commit
164d35681e
|
@ -838,6 +838,8 @@ class MessageMethods:
|
|||
entity = await self.get_input_entity(entity)
|
||||
if comment_to is not None:
|
||||
entity, reply_to = await self._get_comment_data(entity, comment_to)
|
||||
else:
|
||||
reply_to = utils.get_message_id(reply_to)
|
||||
|
||||
if isinstance(message, types.Message):
|
||||
if buttons is None:
|
||||
|
@ -868,7 +870,7 @@ class MessageMethods:
|
|||
message=message.message or '',
|
||||
silent=silent,
|
||||
background=background,
|
||||
reply_to=types.InputReplyToMessage(utils.get_message_id(reply_to)),
|
||||
reply_to=None if reply_to is None else types.InputReplyToMessage(reply_to),
|
||||
reply_markup=markup,
|
||||
entities=message.entities,
|
||||
clear_draft=clear_draft,
|
||||
|
@ -890,7 +892,7 @@ class MessageMethods:
|
|||
message=message,
|
||||
entities=formatting_entities,
|
||||
no_webpage=not link_preview,
|
||||
reply_to=types.InputReplyToMessage(utils.get_message_id(reply_to)),
|
||||
reply_to=None if reply_to is None else types.InputReplyToMessage(reply_to),
|
||||
clear_draft=clear_draft,
|
||||
silent=silent,
|
||||
background=background,
|
||||
|
|
|
@ -408,8 +408,9 @@ class UploadMethods:
|
|||
raise TypeError('Cannot use {!r} as file'.format(file))
|
||||
|
||||
markup = self.build_reply_markup(buttons)
|
||||
reply_to = None if reply_to is None else types.InputReplyToMessage(reply_to)
|
||||
request = functions.messages.SendMediaRequest(
|
||||
entity, media, reply_to=types.InputReplyToMessage(reply_to), message=caption,
|
||||
entity, media, reply_to=reply_to, message=caption,
|
||||
entities=msg_entities, reply_markup=markup, silent=silent,
|
||||
schedule_date=schedule, clear_draft=clear_draft,
|
||||
background=background
|
||||
|
|
|
@ -158,7 +158,7 @@ class InlineResult:
|
|||
background=background,
|
||||
clear_draft=clear_draft,
|
||||
hide_via=hide_via,
|
||||
reply_to=types.InputReplyToMessage(reply_id)
|
||||
reply_to=None if reply_id is None else types.InputReplyToMessage(reply_id)
|
||||
)
|
||||
return self._client._get_response_message(
|
||||
req, await self._client(req), entity)
|
||||
|
|
Loading…
Reference in New Issue
Block a user