diff --git a/telethon/client/messages.py b/telethon/client/messages.py index 0f44c229..f2c129fa 100644 --- a/telethon/client/messages.py +++ b/telethon/client/messages.py @@ -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, diff --git a/telethon/client/uploads.py b/telethon/client/uploads.py index 54e13dfe..dfec45a3 100644 --- a/telethon/client/uploads.py +++ b/telethon/client/uploads.py @@ -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 diff --git a/telethon/tl/custom/inlineresult.py b/telethon/tl/custom/inlineresult.py index f9444e75..d56b2fe2 100644 --- a/telethon/tl/custom/inlineresult.py +++ b/telethon/tl/custom/inlineresult.py @@ -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)