Stop checking fwd_from or not out in message.edit

This commit is contained in:
Lonami Exo 2021-09-18 13:34:21 +02:00
parent af81899bdc
commit 8114fb6c9b
2 changed files with 11 additions and 6 deletions

View File

@ -362,6 +362,17 @@ perform a separate request with no filter to fetch the total without filter (thi
library used to do). library used to do).
Using message.edit will now raise an error if the message cannot be edited
--------------------------------------------------------------------------
Before, calling ``message.edit()`` would completely ignore your attempt to edit a message if the
message had a forward header or was not outgoing. This is no longer the case. It is now the user's
responsibility to check for this.
However, most likely, you were already doing the right thing (or else you would've experienced a
"why is this not being edited", which you would most likely consider a bug rather than a feature).
The TelegramClient is no longer made out of mixins The TelegramClient is no longer made out of mixins
-------------------------------------------------- --------------------------------------------------

View File

@ -762,9 +762,6 @@ class Message(ChatGetter, SenderGetter):
`telethon.client.messages.MessageMethods.edit_message` `telethon.client.messages.MessageMethods.edit_message`
with both ``entity`` and ``message`` already set. with both ``entity`` and ``message`` already set.
Returns `None` if the message was incoming,
or the edited `Message` otherwise.
.. note:: .. note::
This is different from `client.edit_message This is different from `client.edit_message
@ -777,9 +774,6 @@ class Message(ChatGetter, SenderGetter):
This is generally the most desired and convenient behaviour, This is generally the most desired and convenient behaviour,
and will work for link previews and message buttons. and will work for link previews and message buttons.
""" """
if self.fwd_from or not self.out or not self._client:
return None # We assume self.out was patched for our chat
if 'link_preview' not in kwargs: if 'link_preview' not in kwargs:
kwargs['link_preview'] = bool(self.web_preview) kwargs['link_preview'] = bool(self.web_preview)