Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
TheExplainthis committed Mar 18, 2023
1 parent 749035a commit 15978fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ def handle_text_message(event):
text = event.message.text
logger.info(f'{user_id}: {text}')
if text.startswith('/註冊'):
_, api_key = text.split(' ')
if ' ' not in text:
api_key = text[3:]
else:
_, api_key = text.split(' ')
model = OpenAIModel(api_key=api_key)
sucessful = model.check_token_valid()
if not sucessful:
Expand Down

0 comments on commit 15978fd

Please sign in to comment.