/nearby, subscriptions check, geocoding #2

Merged
profitroll merged 30 commits from dev into master 2023-01-02 12:16:38 +02:00
Showing only changes of commit a906c0a1cc - Show all commits

View File

@ -100,16 +100,18 @@ class HoloUser():
self.locale = holo_user["tg_locale"]
self.username = holo_user["tg_username"]
if isinstance(user, User) and ((self.name != user.first_name) and (user.first_name is not None)):
if isinstance(user, User):
if (self.name != user.first_name) and hasattr(user, "first_name") and (user.first_name is not None):
self.set("tg_name", user.first_name)
if isinstance(user, User) and ((self.phone != user.phone_number) and (user.phone_number is not None)):
if (self.phone != user.phone_number) and hasattr(user, "phone_number") and (user.phone_number is not None):
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 (self.locale != user.language_code) and hasattr(user, "language_code") and (user.language_code is not None):
self.set("tg_locale", user.language_code)
if isinstance(user, User) and (self.username != user.username):
if (self.username != user.username) and hasattr(user, "username") and (user.username is not None):
self.set("tg_username", user.username)
def set(self, key: str, value: Any) -> None:
@ -390,3 +392,6 @@ class HoloUser():
await msg.reply_text(locale(f"question{stage+1}", "message", locale=self.locale), reply_markup=ForceReply(placeholder=str(locale(f"question{stage+1}", "force_reply", locale=self.locale))))
logWrite(f"User {self.id} completed stage {stage} of application")
else:
return