mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Added from_id property to Message (#899)
This commit is contained in:
parent
1ced320a19
commit
c289da35c3
1 changed files with 9 additions and 0 deletions
|
|
@ -270,6 +270,15 @@ class Message(base.TelegramObject):
|
|||
|
||||
return text_decorator.unparse(text, entities)
|
||||
|
||||
@property
|
||||
def from_id(self) -> int:
|
||||
"""
|
||||
User id if sent by user or chat/channel id if sent on behalf of a channel or chat
|
||||
|
||||
:return: int
|
||||
"""
|
||||
return self.sender_chat.id if self.sender_chat else self.from_user.id
|
||||
|
||||
@property
|
||||
def md_text(self) -> str:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue