LINE BOT on AWS Lambda + API Gateway using Chalice.
Command | Image |
---|---|
Greeting | |
Choice | |
Shuffle | |
Weather | |
News | |
Echo |
Because of AWS Lambda's restrictions, Supported python version is 2.7 only.
- beautifulsoup4
- chalice
- line-bot-sdk
- feedparser
$ virtualenv -p python2.7 venv
$ source venv/bin/activate
$ pip install -r requirements.txt -r requirements-dev.txt -c constraints.txt
$ python -m unittest tests
Create .chalice/config.json
:
$ cat .chalice/config.json
{
"app_name": "linebot",
"stage": "dev"
}
Set environment variables on your AWS console.
export LINE_BOT_CHANNEL_ACCESS_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
export LINE_BOT_CHANNEL_ACCESS_SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Deploying by chalice cli:
$ chalice deploy
Open your line bot setting's page and Set WebHook url.
https://hoge.execute-api.ap-northeast-1.amazonaws.com/dev/callback
Success! 🎉
MIT. See LICENSE