HoloUser will now update some attributes
This commit is contained in:
parent
3b71cb3d85
commit
8bb7c58c2a
@ -100,6 +100,18 @@ class HoloUser():
|
|||||||
self.locale = holo_user["tg_locale"]
|
self.locale = holo_user["tg_locale"]
|
||||||
self.username = holo_user["tg_username"]
|
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:
|
def set(self, key: str, value: Any) -> None:
|
||||||
"""Set attribute data and save it into database
|
"""Set attribute data and save it into database
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user