1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

New property full_name

This commit is contained in:
David256
2021-04-01 14:56:08 -05:00
parent 4024490249
commit 6c90da793e
2 changed files with 9 additions and 1 deletions

View File

@ -179,6 +179,13 @@ class User(JsonDeserializable, Dictionaryable, JsonSerializable):
self.can_read_all_group_messages = can_read_all_group_messages
self.supports_inline_queries = supports_inline_queries
@property
def full_name(self):
full_name = self.first_name
if self.last_name:
full_name += f' {self.last_name}'
return full_name
def to_json(self):
return json.dumps(self.to_dict())