-
Run
npm install
oryarn
to install packages -
Set webhook path in bottender.config.js
module.exports = { channels: { line: { enabled: true, path: 'xxxxxxx', accessToken: process.env.LINE_ACCESS_TOKEN, channelSecret: process.env.LINE_CHANNEL_SECRET, }, }, };
-
Set Access Token & Channel Secret in .env file
LINE_ACCESS_TOKEN='xxxxx' LINE_CHANNEL_SECRET='xxxxx'
-
Run
npm run dev
oryarn dev
to start server, also automatically run up a Ngrok client, you can copy webhook url to LINE@ account's settings pageline webhook url: https://xxxxx.ngrok.io/webhooks/line
- 請到 https://manager.line.biz/ 確保有開啟「回應設定」的 回應模式為「聊天機器人」,以及啟用 webhook