mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +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)
|
entity = await self.get_input_entity(entity)
|
||||||
if comment_to is not None:
|
if comment_to is not None:
|
||||||
entity, reply_to = await self._get_comment_data(entity, comment_to)
|
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 isinstance(message, types.Message):
|
||||||
if buttons is None:
|
if buttons is None:
|
||||||
|
@ -868,7 +870,7 @@ class MessageMethods:
|
||||||
message=message.message or '',
|
message=message.message or '',
|
||||||
silent=silent,
|
silent=silent,
|
||||||
background=background,
|
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,
|
reply_markup=markup,
|
||||||
entities=message.entities,
|
entities=message.entities,
|
||||||
clear_draft=clear_draft,
|
clear_draft=clear_draft,
|
||||||
|
@ -890,7 +892,7 @@ class MessageMethods:
|
||||||
message=message,
|
message=message,
|
||||||
entities=formatting_entities,
|
entities=formatting_entities,
|
||||||
no_webpage=not link_preview,
|
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,
|
clear_draft=clear_draft,
|
||||||
silent=silent,
|
silent=silent,
|
||||||
background=background,
|
background=background,
|
||||||
|
|
|
@ -408,8 +408,9 @@ class UploadMethods:
|
||||||
raise TypeError('Cannot use {!r} as file'.format(file))
|
raise TypeError('Cannot use {!r} as file'.format(file))
|
||||||
|
|
||||||
markup = self.build_reply_markup(buttons)
|
markup = self.build_reply_markup(buttons)
|
||||||
|
reply_to = None if reply_to is None else types.InputReplyToMessage(reply_to)
|
||||||
request = functions.messages.SendMediaRequest(
|
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,
|
entities=msg_entities, reply_markup=markup, silent=silent,
|
||||||
schedule_date=schedule, clear_draft=clear_draft,
|
schedule_date=schedule, clear_draft=clear_draft,
|
||||||
background=background
|
background=background
|
||||||
|
|
|
@ -158,7 +158,7 @@ class InlineResult:
|
||||||
background=background,
|
background=background,
|
||||||
clear_draft=clear_draft,
|
clear_draft=clear_draft,
|
||||||
hide_via=hide_via,
|
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(
|
return self._client._get_response_message(
|
||||||
req, await self._client(req), entity)
|
req, await self._client(req), entity)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user