Create a linebot. (The theme is Butler BOT) This article is about preparations for development, environment settings, etc. It was difficult to research various articles, so I summarized it as my own memo.
Implementation: https://qiita.com/maihamada/items/009f6b37baf34f9b7c6c
mac os 10.14.6 python 3.8.1
--Search for LINE Developers terms below
https://developers.line.biz/ja/docs/glossary/
First, log in to LINE Developers.
Press the create button on the screen that displays the provider. You can do this by entering the provider name (team name, etc.) and pressing the create button.
Fill in according to the screen for creating a channel. Select "Messaging API" as the channel type.
When you press the create button, channel creation is complete.
Make a note somewhere as you will use it later. -Channel secret: Channel basic setting-> Channel secret -Channel access token: Messaging API settings-> Channel access token (to be issued)
Heroku git is fine, but I used it because I wanted to organize the code on GitHub. Log in to GitHub.
Press new repository. Describe the Repository name and set python to gitignore.
I referred to the following site. https://qiita.com/shizuma/items/2b2f873a0034839e47ce
In the terminal, do the following:
$ cd [Working directory]
$ git clone [Git hub SSH key([email protected]:~)]
Cloning into '[Repository name]'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (3/3), done.
After logging in to HEROKU, select Dashboard on the upper left.
When you press the NEW-> Create new app button, the following screen will appear. Enter the App name and press Create App.
On the Deploy tab, specify GitHub. Specify the branch name and press connect to complete the link.
Just press the button surrounded by red below.
I will put in the library used this time. Do the following in your terminal:
$ pip install flask
$ pip install line-bot-sdk
Check the library with the following command, and if it is written, it's OK.
$ pip freeze
This is the end of preparation. Go into the implementation.
Recommended Posts