check-in-machine's People
check-in-machine's Issues
How to create a messenger bot, Step by Step
1. 建立粉絲專頁
詳見官方文件
2. 新增一個 facebook 應用程式
-
進入 Facebook developer console,點選右上角,我的應用程式,新增應用程式
-
從左邊「產品」-> 「Messenger」可以進到設定頁。這邊是綁定這個 app 到粉絲專頁,產生權杖 (AccessToken)。
-
webhook 要放 bot server 的 url,以及驗證權杖 (verifyToken)。這邊的驗證權杖跟 accessToken 無關,可以自己取,可以亂數產生一個放進去。這個驗證權杖的目的是讓你的 bot server 不要隨便收到 request 就回應,而是看到這個 token 才回。
下放註冊的事件中,請至少選取messages
&messages_postback
。
-
設定應用程式測試員
左邊的「角色」點下去後,右邊可以設定不同角色,方便團隊夥伴做測試。在 App 還沒通過審查&設定公開之前,只有這些人可以測試你的 app 。
操作完以上的步驟後,你會拿到四個值,分別是:
appId
:應用程式編號appSecret
:應用程式密鑰accessToken
:綁定粉專的權杖verifyToken
:bot server 驗證權杖
這四個值是建立 bot server 必須的,請務必保密,不要隨意放在不安全的地方。
3. 伺服器設置
- clone repository
git clone [email protected]:barry800414/check-in-machine.git
若使用 heroku server
-
如果你要使用 heroku server ,先把這個 Tutorial 玩一玩,你就會知道如何 deploy 你的 app 上去
-
使用 heroku mlab 的 add-on,就會有個 500 mb 的 mongodb 可以用
-
進 https://dashboard.heroku.com/apps/:app-id/settings 頁面,把上述四個必要的值設定進去
4. 設定臉書粉絲專頁
先進到臉書粉絲專頁的「設定」頁面,左邊有個 Messenger 平台
選由機器人自動回覆,下面則是把你的 facebook app 綁定成 primary receiver
如果粉專要對外公開,記得在「一般」設定的地方,把臉書專頁設成公開!
5. 送審核
facebook 在通過審核之前,都只有測試人員可以使用,所以記得送審核,才能對外發布。
進到 facebook developer console,進到你的 facebook app
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.