line_echobot
line_echobot copied to clipboard
A django implementation of Line Bot
trafficstars
django linebot example
A django implementation of new Line Message API using line-bot-sdk-python
There is also sanic and flask implementation of this project on other branch.
Setup
Secret Data
You MUST setup the following variables.
- SECRET_KEY
- django secret key. You can generate using Django secret key generator
- LINE_CHANNEL_SECRET
- LINE_CHANNEL_ACCESS_TOKEN
There are two way to set these variables
- Set these variables in
line_echobot/line_echobot/settings_secret.py(Exactly the same name) - Add these variables to environment variables. (
settings_secret.pyis loaded first)
HTTPS Server
You'll need a https server.
Heroku can serve this for you.
All the needed settings for heroku are set in this repo.
Otherwise, you can also build your own https server.
Set Webhook URL
Set webhook url on your LINE Developers page to https://"your domain name"/echobot/callback/
Tutorial
The following articles describe how to construct this bot in detail.
- [Bot] Introduction to Chatbot
- [Bot] Apply Line Messaging API
- [Bot] Line Echo Bot on Django
- [Bot] Deploy LineBot on Heroku
- [Bot] More About Line Messaging API - Template Messages
- [Bot] More than Just Echo Bot
There is also a slide version.
Authors
License
MIT