Compare commits

..

No commits in common. "68742681545aafdc1a0387323800eada4a5cb057" and "bc54abcc973831be9d6e27fb5ecf7c65f3fde14e" have entirely different histories.

2 changed files with 10 additions and 16 deletions
classes
modules/handlers

@ -100,19 +100,17 @@ class HoloUser():
self.locale = holo_user["tg_locale"]
self.username = holo_user["tg_username"]
if isinstance(user, User):
if isinstance(user, User) and ((self.name != user.first_name) and (user.first_name is not None)):
self.set("tg_name", user.first_name)
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)):
self.set("tg_phone", user.phone_number)
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)):
self.set("tg_locale", user.language_code)
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 (self.username != user.username) and hasattr(user, "username") and (user.username is not None):
self.set("tg_username", user.username)
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
@ -391,7 +389,4 @@ class HoloUser():
col_tmp.update_one({"user": {"$eq": self.id}, "type": {"$eq": "application"}}, {"$set": {"application": progress["application"], "stage": progress["stage"]+1}})
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
logWrite(f"User {self.id} completed stage {stage} of application")

@ -50,8 +50,7 @@ async def any_stage(app, msg):
return
if msg.text is not None:
await holo_user.application_next(msg.text, msg=msg)
await holo_user.application_next(msg.text, msg=msg)
# user_stage = configGet("stage", file=str(msg.from_user.id))