Just simple example of flex message from LINE Messaging API with Redis for caching state. This bot using OpenWeatherMap for data source of weather forecast.
- Node.js >= v8 (https://nodejs.org)
- Redis (https://redis.io)
- 2 chicken burgers from McDonald's with extra cheese
- Create and define
.env
file based on.env.example
- Create LINE Messaging API, get the channel secret and channel access token in Channel settings tab and put that in
.env
- Create account or login in OpenWeatherMap, get the API key and put that in
.env
- Run your Redis server
- Run
npm install
for install all dependencies - Run
npm run serve
for development ornpm start
for production phase - Publish or deploy webhook and update the Webhook URL field in your settings of LINE Messaging API.
NOTE. Just take a look /src/controllers
directory and /src/chatbot.js
module if you want update/add something.
/dist # scripts that have been built
/src
/controllers # all functional commands
/utils # maybe you need this ¯\_(ツ)_/¯
chatbot.js # main module for chatbot
index.js # main routing app
/start
: View all menu in bot/current
: View current weather based on specific location/forecast
: View forecast weather based on specific location
- Create an issue
- Fork this repository to your GitHub account
- Make changes
- Create pull request to this repository