mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-02-03 21:24:35 +03:00
Add aliases to access new msg fields with old names
This commit is contained in:
parent
522681f463
commit
572229e536
|
@ -597,6 +597,22 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
|
|||
"""
|
||||
return self._via_input_bot
|
||||
|
||||
@property
|
||||
def reply_to_msg_id(self):
|
||||
"""
|
||||
Returns the message ID this message is replying to, if any.
|
||||
This is equivalent to accessing ``.reply_to.reply_to_msg_id``.
|
||||
"""
|
||||
return self.reply_to.reply_to_msg_id if self.reply_to else None
|
||||
|
||||
@property
|
||||
def to_id(self):
|
||||
"""
|
||||
Alias for ``.peer_id``. Telegram renamed the field, and this property
|
||||
exists to avoid breaking code.
|
||||
"""
|
||||
return self.peer_id
|
||||
|
||||
# endregion Public Properties
|
||||
|
||||
# region Public Methods
|
||||
|
|
Loading…
Reference in New Issue
Block a user