Evaaaaa06 commited on
Commit
03af1ab
·
verified ·
1 Parent(s): 8ff7523

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -4
main.py CHANGED
@@ -170,7 +170,7 @@ def handle_image_message(event):
170
  chat = model.start_chat(history=[])
171
  chat_sessions[user_id] = chat
172
 
173
- user_text = event.message.text if event.message.type == "text" else None
174
  if user_text and user_text.startswith("請幫我生成圖片"):
175
  prompt = user_text.replace("請幫我生成圖片", "").strip()
176
 
@@ -187,9 +187,7 @@ def handle_image_message(event):
187
  )
188
  else:
189
  line_bot_api.reply_message(event.reply_token, TextSendMessage(text="圖片上傳失敗,請稍後再試~"))
190
- else:
191
- line_bot_api.reply_message(event.reply_token, TextSendMessage(text="圖片生成失敗,請稍後再試~"))
192
-
193
 
194
  # 從 LINE API 獲取圖片數據
195
  image_path = get_image_url(event.message.id)
 
170
  chat = model.start_chat(history=[])
171
  chat_sessions[user_id] = chat
172
 
173
+ user_text = event.message.text if event.message.type == "text"
174
  if user_text and user_text.startswith("請幫我生成圖片"):
175
  prompt = user_text.replace("請幫我生成圖片", "").strip()
176
 
 
187
  )
188
  else:
189
  line_bot_api.reply_message(event.reply_token, TextSendMessage(text="圖片上傳失敗,請稍後再試~"))
190
+
 
 
191
 
192
  # 從 LINE API 獲取圖片數據
193
  image_path = get_image_url(event.message.id)