- flask/Python 3.8
- LINE v10.14
- PostgreSQL
You need Github, LINE, Heroku accounts to deploy this bot.
Fill in the following environment variables:
LINE_CHANNEL_ACCESS_TOKEN=
LINE_CHANNEL_SECRET=
DATABASE_URL=postgres://USER:[email protected]:5432/postgres
You need to modify DATABASE_URL as your postgresql settings.
- Got A LINE Bot API developer account Make sure you already registered, if you need use LINE Bot.
- Go to LINE Developer Console
- Close auto-reply setting on "Messaging API" Tab.
- Setup your basic account information. Here is some info you will need to know.
- Callback URL:
https://{YOUR_URL}/webhooks/line
- Verify your webhook.
- Callback URL:
- You will get following info, need fill back to
.env
file.- Channel Secret
- Channel Access Token (You need to issue one here)
-
Run
Scripts/
profiles first, sync official website data to database as crawler. -
first terminal window
cp .env.example .env # Modify variables value
# By docker (choose one)
docker-compose up # and go to DOCKER_IP:4040
# By localized (choose one)
pip install -r requirements.txt --user
python api.py
- Create a provisional Https:
ngrok http 5000
or maybe you have npm environment:
npx ngrok http 5000
- Copy URL to LINE Developer Console
- Enable
clock
button to schedule corn.
- Add
Heroku Postgres
and it would createDATABASE_URL
environment variable automatically.
If you are not sure where are files in, use following up commands:
heroku run bash
heroku logs --tail
MIT License