kenken999 commited on
Commit
3981bfe
1 Parent(s): a5f1115
Files changed (2) hide show
  1. requirements.txt +1 -0
  2. routers/webhook.py +7 -0
requirements.txt CHANGED
@@ -62,4 +62,5 @@ google-auth
62
  google-auth-oauthlib
63
  google-auth-httplib2
64
  google-api-python-client
 
65
 
 
62
  google-auth-oauthlib
63
  google-auth-httplib2
64
  google-api-python-client
65
+ line-bot-sdk
66
 
routers/webhook.py CHANGED
@@ -24,6 +24,9 @@ from command.n8n import post_data,post_data_line
24
  import time
25
  import traceback
26
  from pathlib import Path
 
 
 
27
 
28
  logger = logging.getLogger(__name__)
29
  ##
@@ -151,6 +154,10 @@ async def webhook(request: Request):
151
  #########################################################################
152
  first_line = text.split('\n')[0]
153
  #test_prompt
 
 
 
 
154
  if not line_signature:
155
  raise HTTPException(status_code=400, detail="X-Line-Signature header is missing.")
156
 
 
24
  import time
25
  import traceback
26
  from pathlib import Path
27
+ from linebot import LineBotApi, WebhookHandler
28
+ from linebot.exceptions import InvalidSignatureError
29
+ from linebot.models import MessageEvent, TextMessage, TextSendMessage
30
 
31
  logger = logging.getLogger(__name__)
32
  ##
 
154
  #########################################################################
155
  first_line = text.split('\n')[0]
156
  #test_prompt
157
+ line_bot_api.reply_message(
158
+ reply_token,
159
+ TextSendMessage(text="line replay test")
160
+ )
161
  if not line_signature:
162
  raise HTTPException(status_code=400, detail="X-Line-Signature header is missing.")
163