Skip to content

It's a LineBot combined StateMachine. You can use it to control the user state and your workflow.

Notifications You must be signed in to change notification settings

Jessiemkh/lineBot-Xstate

Repository files navigation

Description

It's a LineBot combined StateMachine. You can use it to control the user state and your workflow.

How To Dev

  1. Add your LINE_CHANNEL_ACCESS_TOKEN="access token" and LINE_CHANNEL_SECRET="secret" to .env (both docker-compose and code base)
  2. And Set redis current state as .env add your REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_USERNAME, YOUR_API_DOMAIN to .env (redis Host: port:6379)

env details

LINE_CHANNEL_ACCESS_TOKEN=your_access_token LINE_CHANNEL_SECRET=your_secret REDIS_HOST=client_bot_redis REDIS_PORT=6379 REDIS_PASSWORD=your_redis_password REDIS_USERNAME=your_redis_username YOUR_API_DOMAIN=''

  1. build application 安裝依賴 yarn install

  2. load .env and build packages by docker-compose 加載環境變數並使用 Docker Compose 構建packages set -a source .env docker-compose -f cicd/docker-compose/docker-compose.dev.yml up -d

  3. Use ngrok as Dev mode

  • use ngrok service and set ngrok as http 3000
  • go to LineDeveloper and set the path { your ngrok url }/bot/webhook to LineDeveloper webhook URL
  1. Stop or restart Docker-Compose service 停止和重啟 Docker Compose 服務 docker-compose -f cicd/docker-compose/docker-compose.dev.yml down docker-compose -f cicd/docker-compose/docker-compose.dev.yml up -d

  2. adjust 自行調整

  • you can adjust Line response in ./infra/response. 在此修改Line的回覆內容
  • you can adjust your interact with your backend api in ./domain/register and ./app/command/register.handler. 可以在此修改和後端api的交互
  • you can adjust StateMachine content at ./app/command/register.machine 可以在此修改狀態機內容

About

It's a LineBot combined StateMachine. You can use it to control the user state and your workflow.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published