mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-14 05:26:36 +03:00
Fix editing inline messages of type InputBotInlineMessageID64 (#4082)
This commit is contained in:
parent
5b1135734b
commit
ced36adb03
|
@ -51,6 +51,8 @@ Bug fixes
|
||||||
you can actually have a chance to handle them.
|
you can actually have a chance to handle them.
|
||||||
* Update handling should be more resilient.
|
* Update handling should be more resilient.
|
||||||
* ``PhoneCodeExpiredError`` will correctly clear the stored hash if it occurs in ``sign_in``.
|
* ``PhoneCodeExpiredError`` will correctly clear the stored hash if it occurs in ``sign_in``.
|
||||||
|
* In patch ``v1.28.2``, :tl:`InputBotInlineMessageID64` can now be used
|
||||||
|
to edit inline messages.
|
||||||
|
|
||||||
|
|
||||||
.. _issue 4050: https://github.com/LonamiWebs/Telethon/issues/4050
|
.. _issue 4050: https://github.com/LonamiWebs/Telethon/issues/4050
|
||||||
|
|
|
@ -1064,7 +1064,7 @@ class MessageMethods:
|
||||||
from it, so the next parameter will be assumed to be the
|
from it, so the next parameter will be assumed to be the
|
||||||
message text.
|
message text.
|
||||||
|
|
||||||
You may also pass a :tl:`InputBotInlineMessageID`,
|
You may also pass a :tl:`InputBotInlineMessageID` or :tl:`InputBotInlineMessageID64`,
|
||||||
which is the only way to edit messages that were sent
|
which is the only way to edit messages that were sent
|
||||||
after the user selects an inline query result.
|
after the user selects an inline query result.
|
||||||
|
|
||||||
|
@ -1136,7 +1136,7 @@ class MessageMethods:
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
The edited `Message <telethon.tl.custom.message.Message>`,
|
The edited `Message <telethon.tl.custom.message.Message>`,
|
||||||
unless `entity` was a :tl:`InputBotInlineMessageID` in which
|
unless `entity` was a :tl:`InputBotInlineMessageID` or :tl:`InputBotInlineMessageID64` in which
|
||||||
case this method returns a boolean.
|
case this method returns a boolean.
|
||||||
|
|
||||||
Raises
|
Raises
|
||||||
|
@ -1162,7 +1162,7 @@ class MessageMethods:
|
||||||
# or
|
# or
|
||||||
await client.edit_message(message, 'hello!!!')
|
await client.edit_message(message, 'hello!!!')
|
||||||
"""
|
"""
|
||||||
if isinstance(entity, types.InputBotInlineMessageID):
|
if isinstance(entity, (types.InputBotInlineMessageID, types.InputBotInlineMessageID64)):
|
||||||
text = text or message
|
text = text or message
|
||||||
message = entity
|
message = entity
|
||||||
elif isinstance(entity, types.Message):
|
elif isinstance(entity, types.Message):
|
||||||
|
@ -1178,7 +1178,7 @@ class MessageMethods:
|
||||||
attributes=attributes,
|
attributes=attributes,
|
||||||
force_document=force_document)
|
force_document=force_document)
|
||||||
|
|
||||||
if isinstance(entity, types.InputBotInlineMessageID):
|
if isinstance(entity, (types.InputBotInlineMessageID, types.InputBotInlineMessageID64)):
|
||||||
request = functions.messages.EditInlineBotMessageRequest(
|
request = functions.messages.EditInlineBotMessageRequest(
|
||||||
id=entity,
|
id=entity,
|
||||||
message=text,
|
message=text,
|
||||||
|
|
|
@ -300,7 +300,7 @@ class CallbackQuery(EventBuilder):
|
||||||
"""
|
"""
|
||||||
Edits the message. Shorthand for
|
Edits the message. Shorthand for
|
||||||
`telethon.client.messages.MessageMethods.edit_message` with
|
`telethon.client.messages.MessageMethods.edit_message` with
|
||||||
the ``entity`` set to the correct :tl:`InputBotInlineMessageID`.
|
the ``entity`` set to the correct :tl:`InputBotInlineMessageID` or :tl:`InputBotInlineMessageID64`.
|
||||||
|
|
||||||
Returns `True` if the edit was successful.
|
Returns `True` if the edit was successful.
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ class CallbackQuery(EventBuilder):
|
||||||
since the message object is normally not present.
|
since the message object is normally not present.
|
||||||
"""
|
"""
|
||||||
self._client.loop.create_task(self.answer())
|
self._client.loop.create_task(self.answer())
|
||||||
if isinstance(self.query.msg_id, types.InputBotInlineMessageID):
|
if isinstance(self.query.msg_id, (types.InputBotInlineMessageID, types.InputBotInlineMessageID64)):
|
||||||
return await self._client.edit_message(
|
return await self._client.edit_message(
|
||||||
self.query.msg_id, *args, **kwargs
|
self.query.msg_id, *args, **kwargs
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
# Versions should comply with PEP440.
|
# Versions should comply with PEP440.
|
||||||
# This line is parsed in setup.py:
|
# This line is parsed in setup.py:
|
||||||
__version__ = '1.28.1'
|
__version__ = '1.28.2'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user