huchiahsi commited on
Commit
3fc73f7
·
verified ·
1 Parent(s): d7a9a8c

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +10 -10
main.py CHANGED
@@ -125,18 +125,18 @@ def handle_text_message(event):
125
  )
126
  )
127
  else:
128
- with ApiClient(configuration) as api_client:
129
- line_bot_api = MessagingApi(api_client)
130
- response = query(event.message.text)
131
- html_msg = markdown.markdown(response)
132
- soup = BeautifulSoup(html_msg, "html.parser")
133
 
134
- line_bot_api.reply_message_with_http_info(
135
- ReplyMessageRequest(
136
- reply_token=event.reply_token,
137
- messages=[TextMessage(text=soup.get_text())]
 
138
  )
139
- )
140
 
141
  # === 處理圖片訊息 ===
142
  @handler.add(MessageEvent, message=ImageMessageContent)
 
125
  )
126
  )
127
  else:
128
+ with ApiClient(configuration) as api_client:
129
+ line_bot_api = MessagingApi(api_client)
130
+ response = query(event.message.text)
131
+ html_msg = markdown.markdown(response)
132
+ soup = BeautifulSoup(html_msg, "html.parser")
133
 
134
+ line_bot_api.reply_message_with_http_info(
135
+ ReplyMessageRequest(
136
+ reply_token=event.reply_token,
137
+ messages=[TextMessage(text=soup.get_text())]
138
+ )
139
  )
 
140
 
141
  # === 處理圖片訊息 ===
142
  @handler.add(MessageEvent, message=ImageMessageContent)