Добавлено в User @property full_name

This commit is contained in:
Денис Семёнов 2025-07-27 02:11:04 +03:00
parent 7ed540683c
commit 7925087ac7

View File

@ -36,6 +36,13 @@ class User(BaseModel):
full_avatar_url: Optional[str] = None full_avatar_url: Optional[str] = None
commands: Optional[List[BotCommand]] = None commands: Optional[List[BotCommand]] = None
@property
def full_name(self):
if self.last_name is None:
return self.first_name
return f'{self.first_name} {self.last_name}'
class Config: class Config:
json_encoders = { json_encoders = {
datetime: lambda v: int(v.timestamp() * 1000) datetime: lambda v: int(v.timestamp() * 1000)