Added one more type check for HoloUser init

This commit is contained in:
Profitroll 2022-12-17 23:14:12 +01:00
parent 1d5ebd02fe
commit 41eb6e46ee

View File

@ -100,10 +100,10 @@ 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) and (user.first_name is None)): if isinstance(user, User) and ((self.name != user.first_name) and (user.first_name is not None)):
self.set("tg_name", user.first_name) self.set("tg_name", user.first_name)
if isinstance(user, User) and (self.phone != user.phone_number): if isinstance(user, User) and ((self.phone != user.phone_number) and (user.phone_number is not None)):
self.set("tg_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 is not None)): if isinstance(user, User) and ((self.locale != user.language_code) and (user.language_code is not None)):