# [LINE Bot] ChatGPT API 串接: 建立 LINE 官方帳號 :::info :bulb: 利用 Python 框架 fastAPI 在本機環境下搭配 ngrok 建立串接 OpenAI API 的 LINE 官方帳號 ::: ## :book:Information #### :small_blue_diamond: Python (本篇使用3.9版本) #### :small_blue_diamond: [fastAPI](https://fastapi.tiangolo.com/) #### :small_blue_diamond: [ngrok](https://ngrok.com/) #### :small_blue_diamond: [LINE Messaging API](https://developers.line.biz/en/reference/messaging-api/) #### :small_blue_diamond: [OpenAI API](https://platform.openai.com/docs/introduction) ## :pencil:建立 LINE Bot :::warning 使用 LINE Bot 官方服務前請先申請 [LINE Developers](https://developers.line.biz/en/) 帳號 ::: ### 建立 Providers  建立完成後會在下方 Provider 列表中出現剛剛所創建的名稱,請點選進入 Provider 新增 Channel。 ### 建立 Channel 點擊 "Create a new chennal"。  選擇 "Messaging API" 將後續資訊輸入後創建。  新增成功將會出現在 Channels 列表中。  ## :pencil:LINE Bot 設定 ### Channel 設定 進入 Channel 如下圖所示,本篇只有使用 "Basic settings" 及 "Messaging API" 功能。  ### Basic settings Channel secret 顯示於 "Basic settings" 中,於串接 API 使用。  ### Messaging API settings :::warning LINE Bot 串接 API 重點設定在這個部分 ::: #### Bot information * Bot basic ID: 使用此 ID 加入 #### Webhook settings * Webhook URL: 後續將程式部署後將所產生的網址貼在這裡,此功能必須開啟 #### LINE Official Account features * Allow bot to join group chats: 開啟後可以將此機器人加入群組 * Auto-reply messages: 關閉自動回應訊息功能 * Greeting messages: 關閉加入好友歡迎訊息功能  #### Channel access token * Channel access token: 串接 API 時使用,點擊 "issue" 產生  --- ###### tags: `LINE Bot` `Python` `fastAPI` `ngrok` `OpenAI` `ChatGPT`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up