Code Monkey home page Code Monkey logo

bb-line-bot's Introduction

Line 聊天機器人

查詢各縣市 PM 2.5 濃度der聊天機器人

image

申請Line Messaging API (aka Line Bot)

https://developers.line.biz/en/

Login 之後點選 Create new provider, 輸入 Provider Name 然後送出 image image

Provider 建完之後,點選 Messaging API 下面的 Create API image

輸入Bot 的資料,這裡輸入的名字就是Line聊天時顯示的名字,Privacy Policy URL 跟 Terms of use URL 可以先空著,然後送出、確認、送出就完成申請啦 image image image

完成之後點進你的Bot,看到Using LINE@ features, 點擊右邊的 Set message , 將 Auto-reply messages 以及 Greeting messages 關掉,順便把 Webhooks 打開 image image

在 webhook URL 貼上架在heroku上的server,然後點擊驗證。 最後記得點擊 Channel access token 右邊的 Issue 取得 token。 image image

這裡比較重要的東西有 "Channel ID", "Channel secret", "Channel access token",在 server.js 裡會用到。

安裝 node

sudo apt-get install nodejs -y

npm init

npm install cheerio request linebot

heroku

git init

heroku create bb-line-bot image

create 完之後記得加上 heroku git:remote -a bb-line-bot

git add .

git commit -m 'init'

git push heroku master

到這裡就算完成 webhook 的設定啦

bb-line-bot's People

Contributors

kh555069 avatar

Stargazers

Gary Chung avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.