[教學] firebase database + ms botframework 的 shell chatbot

Photo by rawpixel on Unsplash

前言:
ms botframework 應該還是目前可以簡單的將設計對話情境實現的 bot 架構。

要求:

  1. 案裝好 firebase-sdk 等套件

為了這個,小弟我寫了這個套件:

https://www.npmjs.com/package/botbuilder-storage-firebase-database

firebase console setting

  1. 新增一個firebase專案
  2. 開啟 database 的權限,這裡先全設true
  3. 如果之前要上線成FB bot 或 Line bot 等,記得將專案改成 blaze (要cost,但因為 chatbot 需要設定 url 讓 chatbot 可以主動通知)
  4. 回到本機shell
  5. mkdir chatbot & cd chatbot
  6. firebase init
  7. 選 剛選的 firebase project
  8. database 跟 function 記得打開
  9. create

main.js 撰寫

  1. cd function
  2. npm install botbuilder -S
  3. npm install botbuilder-storage-firebase-database -S
  4. touch main.js

--

--

Wolke@林建宏 A Man Co-work with AI use coding tool

作為一名啟發者而存在。 -致力於分享經驗和知識,幫助開拓、行動、克服。 Badge: - LINE Expert - Google Developer Expert Books: - 應用詠唱釋放程式生產力 ... - 程式輕鬆入門到完整學習 ... Being: - 大學社群論壇