iT邦幫忙

0

Line Bot 鸚鵡機器人不能回復的問題

  • 分享至 

  • xImage

大家好 我是剛學Python的新手 最近買了一本Line Bot 機器人的書自己在學按照書所教的一步一步的操作 但是就是不會自動回 試了很多次 也找不出問題點 有哪位神人大大能幫我嗎
錯誤訊息:
[2021-05-25 22:43:19,596] ERROR in app: Exception on /callback [POST]
Traceback (most recent call last):
File "C:\programdata\anaconda3\lib\site-packages\flask\app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "C:\programdata\anaconda3\lib\site-packages\flask\app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\programdata\anaconda3\lib\site-packages\flask\app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\programdata\anaconda3\lib\site-packages\flask_compat.py", line 39, in reraise
raise value
File "C:\programdata\anaconda3\lib\site-packages\flask\app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "C:\programdata\anaconda3\lib\site-packages\flask\app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "c:/Users/ASUS/linebot/linebotTest.py", line 17, in callback
handler.handle(body, signature)
File "C:\programdata\anaconda3\lib\site-packages\linebot\webhook.py", line 230, in handle
func(event)
File "c:/Users/ASUS/linebot/linebotTest.py", line 24, in handle_message
line_bot_api.reply_message(event.reply_token,TextSendMessage(text=event.message.text))
File "C:\programdata\anaconda3\lib\site-packages\linebot\api.py", line 94, in reply_message
self._post(
File "C:\programdata\anaconda3\lib\site-packages\linebot\api.py", line 561, in _post
self.__check_error(response)
File "C:\programdata\anaconda3\lib\site-packages\linebot\api.py", line 584, in __check_error
raise LineBotApiError(response.status_code, error)
linebot.exceptions.LineBotApiError: LineBotApiError: status_code=401, error_response={"details": [], "message": "Authentication failed. Confirm that the access token in the authorization header is valid."}
127.0.0.1 - - [25/May/2021 22:43:19] "POST /callback HTTP/1.1" 500 -

haward79 iT邦研究生 1 級 ‧ 2021-05-27 13:20:41 檢舉
(1) 程式碼建議直接貼,不要用截圖會比較方便。
(2) 有試過用 postman 之類的軟體先測試 API 嗎?
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

我要發表回答

立即登入回答