-
Notifications
You must be signed in to change notification settings - Fork 15
00A Setting Up (Local Development)
JCxYIS edited this page Nov 20, 2021
·
5 revisions
- Line
- Heroku: https://www.heroku.com/
- python 3: https://www.python.org/downloads/
- git: https://git-scm.com/downloads
- Heroku CLI: https://devcenter.heroku.com/articles/heroku-cli#download-and-install
-
Go to https://developers.line.biz/ and sign in to your account
-
Choose an existing provider, or create a new one
A provider is an individual developer, company, or organization that provides services. (See Document)
-
Create a new channel
-
Select "Messaging API"
-
Complete the form and press Create
- If you have Github account, you can fork this project and clone
- Otherwise you may just do clone from here or Download zip directly
- Open the terminal (For example,
powershell
in Windows) - Navigate to the project folder (For example, I put the code in
F:\LineBot-IoT
)
cd F:\LineBot-IoT
- Login to your heroku account (You may be prompted "Press any key to continue", then you will be directed to the login site)
heroku login
- Create an app on heroku (You can name the app yourself. In my case, I named it
my-cool-iot-linebot
)
heroku create my-cool-iot-linebot
- Put the API keys in that app: Go to Line Developers, select the bot you created, fill in the commands below with these keys and run it.
heroku config:set LINEBOT_CHANNEL_ACCESS_TOKEN=...
heroku config:set LINEBOT_CHANNEL_SECRET=...
Channel access token is in "Messaging API" section
Channel Secret is in "Basic Settings" section
- Push the code to heroku
git push heroku master
- Go to Line Developers, and key in the url of our bot
- Try send some message to the bot! It should response with "Hello World! ..."
The link to your bot is in "Messaging API" section of Line Developers Console
- If you see message other message appear with that, please check auto-reply setting in Line Developer Console
- Each time you edit the project, you need to deploy it in order to see the change take effects
- Deploy commands are
git add -A
git commit -m "DESCRIBE WHAT DID YOU DO SINCE LAST CHANGE HERE"
git push heroku