File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 19
19
20
20
from fastapi import Request , FastAPI , HTTPException
21
21
22
-
23
22
from linebot import (
24
23
AsyncLineBotApi , WebhookParser
25
24
)
41
40
print ('Specify LINE_CHANNEL_ACCESS_TOKEN as environment variable.' )
42
41
sys .exit (1 )
43
42
44
-
45
43
app = FastAPI ()
46
44
session = aiohttp .ClientSession ()
47
45
async_http_client = AiohttpAsyncHttpClient (session )
48
46
line_bot_api = AsyncLineBotApi (channel_access_token , async_http_client )
49
47
parser = WebhookParser (channel_secret )
50
48
49
+
51
50
@app .post ("/callback" )
52
51
async def handle_callback (request : Request ):
53
52
signature = request .headers ['X-Line-Signature' ]
@@ -71,5 +70,5 @@ async def handle_callback(request: Request):
71
70
event .reply_token ,
72
71
TextSendMessage (text = event .message .text )
73
72
)
74
-
73
+
75
74
return 'OK'
You can’t perform that action at this time.
0 commit comments