Finally fixed bug:'NoneType' object is not subscriptable

This commit is contained in:
Karim Iskakov
2023-03-04 11:09:19 -06:00
parent 0779808db3
commit ce29dfd044
2 changed files with 4 additions and 2 deletions
+4
View File
@@ -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):
-2
View File
@@ -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)