Skip to content

Commit

Permalink
Add Key Error
Browse files Browse the repository at this point in the history
  • Loading branch information
TheExplainthis committed Mar 22, 2023
1 parent 9c33d89 commit 9fa2ae9
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ def handle_text_message(event):

except ValueError:
msg = TextSendMessage(text='Token 無效,請重新註冊,格式為 /註冊 sk-xxxxx')
except KeyError:
msg = TextSendMessage(text='請先註冊 Token,格式為 /註冊 sk-xxxxx')
except Exception as e:
memory.remove(user_id)
if str(e).startswith('Incorrect API key provided'):
Expand Down
Binary file added src/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added src/__pycache__/logger.cpython-39.pyc
Binary file not shown.
Binary file added src/__pycache__/memory.cpython-39.pyc
Binary file not shown.
Binary file added src/__pycache__/models.cpython-39.pyc
Binary file not shown.
Binary file added src/__pycache__/mongodb.cpython-39.pyc
Binary file not shown.
Binary file added src/__pycache__/storage.cpython-39.pyc
Binary file not shown.

0 comments on commit 9fa2ae9

Please sign in to comment.