mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Add full_name property to Contact and corresponding tests (#1758)
* Add full_name property to Contact and corresponding tests * Add brief description of changes
This commit is contained in:
parent
f2459fbcf2
commit
1708980ceb
3 changed files with 27 additions and 0 deletions
|
|
@ -49,3 +49,9 @@ class Contact(TelegramObject):
|
|||
vcard=vcard,
|
||||
**__pydantic_kwargs,
|
||||
)
|
||||
|
||||
@property
|
||||
def full_name(self) -> str:
|
||||
if self.last_name:
|
||||
return f"{self.first_name} {self.last_name}"
|
||||
return self.first_name
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue