timlin0307 / My_Line_Bot_Assist

Develop my own assistant via Line Bot.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

My_Line_Bot_Assist

Table of contents

Introduction

Develop my own assistant via Line Bot. Update irregularly.

Neccesities

Create LINE Bot Channel

  • 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"

Set Up Your Bot

  • 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

Install And Set Up Heroku

  • Download and install The Heroku CLI (it has instructions)
  • Login to Heroku
  • Go to "New" -> "Create New App"
  • Name the app -> "Create App"

PUSH Bot Programme to Heroku

  • 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

Combine Heroku to LINE Bot

  • Go to LINE Developers -> Choose the Bot you'd created
  • Go to "Webhook URL" -> Input the URL below
{HEROKU_APP_NAME}.herokuapp.com/callback

Basic Code

  • 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.

About

Develop my own assistant via Line Bot.


Languages

Language:Python 100.0%