diff --git a/bot/bot.py b/bot/bot.py index a85a0e5..ed485ad 100644 --- a/bot/bot.py +++ b/bot/bot.py @@ -43,6 +43,10 @@ async def register_user_if_not_exists(update: Update, context: CallbackContext, first_name=user.first_name, last_name= user.last_name ) + db.start_new_dialog(user.id) + + if db.get_user_attribute(user.id, "current_dialog_id") is None: + db.start_new_dialog(user.id) async def start_handle(update: Update, context: CallbackContext): diff --git a/bot/database.py b/bot/database.py index 71482e8..80aa3f6 100644 --- a/bot/database.py +++ b/bot/database.py @@ -51,8 +51,6 @@ class Database: if not self.check_if_user_exists(user_id): self.user_collection.insert_one(user_dict) - - # TODO: maybe start a new dialog here? def start_new_dialog(self, user_id: int): self.check_if_user_exists(user_id, raise_exception=True)