Skip to content

hardy1234554321/shockuccu-linebot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

首先到 LINE Developers 建立一個新的 Channel

Channel 的類別選擇 Messaging API,填完基本資料

基本資料設定

  1. Channel icon (optional)
  2. Channel name
  3. Channel description
  4. Privacy policy URL (optional)
  5. Terms of use URL (optional)

檢查 Channel 是否新增成功

參考官方提供的SDK LINE Messaging API SDK for PHP 可以很簡單的建立聊天機器人, 透過 composer 安裝 LINE Messaging API SDK

composer require linecorp/line-bot-sdk

目錄結構

  1. index.php:此 webhook URL 為聊天機器人 server 的 endpoint,由此發出 webhook payload
  2. api/LINEBot/EchoBot.php:主要處理接收訊息、回覆訊息
  3. api/LINEBot/Setting.php:設定LINEBOT_CHANNEL_TOKEN、LINEBOT_CHANNEL_SECRET

把專案部署到 Heroku 完成後,回到 LINE Developers 介面找到 Webhook settings:

  1. Webhook URL 輸入剛剛部署完成的 URL
  2. 啟用 webhook

按下 Verify 出現 Success

有了基本的回覆資訊之後,就可以進一步研究機器人的互動囉!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages