- Introduction
- Requirements
- Create LINE Bot Channel
- Set Up Your Bot
- Install And Set Up Heroku
- PUSH Bot Programme to Heroku
- Combine Heroku to LINE Bot
- Basic Code
Develop my own assistant via Line Bot. Update irregularly.
- Login to LINE Developers Messaging API
- "Create New Provider" -> Give provider name -> "Comfirm" -> "Create"
- "Create Channel" -> Fill in the information of your bot -> "Comfirm" -> Agree Terms -> "Create"
- Go to LINE Developers -> Choose the Bot you'd created
- Check "Use webhook" -> "Edit" -> "Enable" -> "Update"
- "Disable" auto-reply and greeting messages (it depends on you)
- "Issue" a Channel Access Token and a Channel Secret, keep them
- Download and install The Heroku CLI (it has instructions)
- Login to Heroku
- Go to "New" -> "Create New App"
- Name the app -> "Create App"
- Open cmd on your computer (cd to the folder you put the programme)
- Login to your Heroku account
heroku login
- Initialize git
git config --global user.name {"NAME"}
git config --global user.email {E-MAIL}
git init
- Connect your folder to Heroku
heroku git:remote -a {HEROKU_APP_NAME}
- PUSH your programme (every PUSH need to do this)
git add .
git commit -m "Add code"
git push -f heroku master
- Go to LINE Developers -> Choose the Bot you'd created
- Go to "Webhook URL" -> Input the URL below
{HEROKU_APP_NAME}.herokuapp.com/callback
- Check basic_LineBot.py above
- Check requirements.txt above for Heroku app, it has libraries needed for the code. If you want to import more libraries into your Bot, you can add them manually.
- Check runtime.txt above, it's the python edition used for your Bot code.