|
老師您好,目前做到第六章按鈕樣板,這您的程式碼練習出現以下錯誤訊息:
Internal Server Error: /callback Traceback (most recent call last): File "D:\LineBotProject\TemplateLineBot\module\func.py", line 35, in sendButtonTemplate line_bot_api.reply_message(event.reply_token,message) File "D:\Users\ac263\Anaconda3\lib\site-packages\linebot\api.py", line 94, in reply_message self._post( File "D:\Users\ac263\Anaconda3\lib\site-packages\linebot\api.py", line 561, in _post self.__check_error(response) File "D:\Users\ac263\Anaconda3\lib\site-packages\linebot\api.py", line 584, in __check_error raise LineBotApiError(response.status_code, error) linebot.exceptions.LineBotApiError: LineBotApiError: status_code=400, error_response={"details": [{"message": "must be specified", "property": "template/actions/1/uri"}], "message": "A message (messages[0])\u00a0in the request body is invalid"}
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "D:\Users\ac263\Anaconda3\lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) File "D:\Users\ac263\Anaconda3\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "D:\Users\ac263\Anaconda3\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view return view_func(*args, **kwargs) File "D:\LineBotProject\TemplateLineBot\TemplateApp\views.py", line 37, in callback func.sendButtonTemplate(event) File "D:\LineBotProject\TemplateLineBot\module\func.py", line 37, in sendButtonTemplate line_bot_api.reply_message(event.reply_token,TextSendMessage(text='發生錯誤!')) File "D:\Users\ac263\Anaconda3\lib\site-packages\linebot\api.py", line 94, in reply_message self._post( File "D:\Users\ac263\Anaconda3\lib\site-packages\linebot\api.py", line 561, in _post self.__check_error(response) File "D:\Users\ac263\Anaconda3\lib\site-packages\linebot\api.py", line 584, in __check_error raise LineBotApiError(response.status_code, error) linebot.exceptions.LineBotApiError: LineBotApiError: status_code=400, error_response={"details": [], "message": "Invalid reply token"} [31/Jul/2022 04:32:14] "POST /callback HTTP/1.1" 500 107701
至於我是買電子書如果想要那些範例的程式碼要去哪裡下再參考?
※補充: LINE_CHANNEL_ACCESS_TOKEN和 LINE_CHANNEL_SECRET 皆有更換試過並可以與Webhook URL verify 顯示SCCUESS |