Built on the shoulder of giants, especially https://github.com/hidehiro98/
- This covers the Line configuration, step by step.
- Slides Link
DO NOT INCLUDE 'line' in the name of provider and channel. If you do so, you cannnot create the provider nor the channel.
If you don't have brew, do this first
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then do,
brew install heroku/brew/heroku
Alternative option: install by dowloading the Heroku Installer.
Download Git here and install it
sudo snap install --classic heroku
apt-get install git
Download the Heroku Installer and install it.
Download Git here and install it
Open a terminal (search for "Terminal" (Mac, Ubuntu) or "Command Prompt" (Windows) in your OS search bar).
ANYTHING INSIDE OF [ ] NEEDS TO BE CHANGED
We will dowload the bot code from Github, then we will push it to Heroku:
git clone https://github.com/lewagonjapan/bob-the-bot.git [CHANGE_THIS_TO_YOUR_BOT_NAME]
cd [CHANGE_THIS_TO_YOUR_BOT_NAME]
heroku login
heroku create [CHANGE_THIS_TO_YOUR_BOT_NAME]
git push heroku master
We will configure the keys to access the LINE API service:
Replace [CHANGE_THIS_TO_YOUR_LINE_CHANNEL_SECRET]
and [CHANGE_THIS_TO_YOUR_LINE_ACCESS_TOKEN]
with your own keys.
heroku config:set LINE_CHANNEL_SECRET=[CHANGE_THIS_TO_YOUR_LINE_CHANNEL_SECRET]
heroku config:set LINE_ACCESS_TOKEN=[CHANGE_THIS_TO_YOUR_LINE_ACCESS_TOKEN]
Example (do not copy/paste in your terminal):
heroku config:set LINE_CHANNEL_SECRET=f73d5df3fagu3g301856e1dc4cfcf3e1
heroku config:set LINE_ACCESS_TOKEN=FbKBF7cB1HReh9lIc6M3bDz8Rd6D+0f1kvBaJF93QadC7SsGpHP9K1EOOYkbwRThXHdVSSupJ4TgKMEtE/LbnE2heif2GZci+ntGdP89cGfrbLiofFFBlrFygi58f/B5UsvqkvlfNM7BHddRZhhV2RgdB04t89/1O/w1cDnyilFU=
Optional: we will set the key for weather forecast and image recognition:
Register and get the keys:
- Weather forecast: https://home.openweathermap.org/api_keys
- Image recognition: https://imagga.com/profile/dashboard
heroku config:set WEATHER_API=[CHANGE_THIS_TO_YOUR_WEATHER_API_KEY]
heroku config:set IMAGGA_KEY=[CHANGE_THIS_TO_YOUR_IMAGGA_API_KEY]
heroku config:set IMAGGA_SECRET=[CHANGE_THIS_TO_YOUR_IMAGGA_API_SECRET]
- Make your changes in your text editor
- You can download Sublime Text or VS code if you don't have one.
- Commit your changes and send them to Heroku:
git add .
git commit -m "DESCRIBE WHAT CHANGES YOU MADE"
git push heroku master
- When it's finished pushing, message you bot to test it out!
- In Terminal, you can run
heroku logs
- This will give you the server log. Big challenge to find that bug! 🐛