diff --git a/classes/holo_user.py b/classes/holo_user.py index c0879f0..3de2b1b 100644 --- a/classes/holo_user.py +++ b/classes/holo_user.py @@ -99,6 +99,18 @@ class HoloUser(): self.phone = holo_user["tg_phone"] self.locale = holo_user["tg_locale"] self.username = holo_user["tg_username"] + + if isinstance(user, User) and (self.name != user.first_name): + self.set("tg_name", user.first_name) + + if isinstance(user, User) and (self.phone != user.phone_number): + self.set("tg_phone", user.phone_number) + + if isinstance(user, User) and ((self.locale != user.language_code) and (user.language_code != None)): + self.set("tg_locale", user.language_code) + + if isinstance(user, User) and (self.username != user.username): + self.set("tg_username", user.username) def set(self, key: str, value: Any) -> None: """Set attribute data and save it into database