mirror of
https://github.com/father-bot/chatgpt_telegram_bot.git
synced 2026-06-13 03:54:57 +03:00
Finally fixed bug:'NoneType' object is not subscriptable
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user