File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
hydrogram/types/user_and_chats Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ class Chat(Object):
6969 last_name (``str``, *optional*):
7070 Last name of the other party in a private chat, for private chats.
7171
72+ full_name (``str``, *property*):
73+ Full name of the other party in a private chat, for private chats and bots.
74+
7275 photo (:obj:`~hydrogram.types.ChatPhoto`, *optional*):
7376 Chat photo. Suitable for downloads only.
7477
@@ -199,6 +202,10 @@ def __init__(
199202 self .send_as_chat = send_as_chat
200203 self .available_reactions = available_reactions
201204
205+ @property
206+ def full_name (self ) -> str :
207+ return " " .join (filter (None , [self .first_name , self .last_name ])) or None
208+
202209 @staticmethod
203210 def _parse_user_chat (client , user : raw .types .User ) -> "Chat" :
204211 peer_id = user .id
Original file line number Diff line number Diff line change @@ -101,6 +101,9 @@ class User(Object, Update):
101101 last_name (``str``, *optional*):
102102 User's or bot's last name.
103103
104+ full_name (``str``, *property*):
105+ Full name of the other party in a private chat.
106+
104107 status (:obj:`~hydrogram.enums.UserStatus`, *optional*):
105108 User's last seen & online status. ``None``, for bots.
106109
@@ -198,6 +201,10 @@ def __init__(
198201 self .photo = photo
199202 self .restrictions = restrictions
200203
204+ @property
205+ def full_name (self ) -> str :
206+ return " " .join (filter (None , [self .first_name , self .last_name ])) or None
207+
201208 @property
202209 def mention (self ):
203210 return Link (
You can’t perform that action at this time.
0 commit comments