[教學] firebase database + ms botframework 的 shell chatbot
2 min readJun 13, 2018
前言:
ms botframework 應該還是目前可以簡單的將設計對話情境實現的 bot 架構。
要求:
- 案裝好 firebase-sdk 等套件
為了這個,小弟我寫了這個套件:
https://www.npmjs.com/package/botbuilder-storage-firebase-database
firebase console setting
- 新增一個firebase專案
- 開啟 database 的權限,這裡先全設true
- 如果之前要上線成FB bot 或 Line bot 等,記得將專案改成 blaze (要cost,但因為 chatbot 需要設定 url 讓 chatbot 可以主動通知)
- 回到本機shell
- mkdir chatbot & cd chatbot
- firebase init
- 選 剛選的 firebase project
- database 跟 function 記得打開
- create
main.js 撰寫
- cd function
- npm install botbuilder -S
- npm install botbuilder-storage-firebase-database -S
- touch main.js