Coder Social home page Coder Social logo

bottender-order-example's Introduction

bottender-order-example

Deploy to now Deploy to heroku

Bottender 實作的團購揪團 LINE Bot 範例,輕鬆揪團不求人!在 LINE 上打造屬於你的 Chatbot 揪團小幫手的範例程式碼。

支援的指令

開團

開始一個團體訂單

開團

截止

結束一個團體訂單

截止

統計

輸出目前訂單內容

統計

下訂單

點自己想要的內容,一人限點一次

我要<訂單內容>
我也要<訂單內容>

範例:

我要紅茶拿鐵
我也要鮮奶茶

取消訂單

取消自己的訂單

取消

目錄結構

整個目錄結構大概是這樣:

bottender-order-example/
  actions/
  node_modules/
  index.js
  bottender.config.js
  handler.js
  package.json
  README.md
  yarn.lock
  .env

檔案大致的職責分配:

  • index.js - 程式進入點、Bot 初始化相關、Server 相關的程式碼。
  • handler.js - 用 Builder 建立的主邏輯。
  • actions/*.js - 在 handler.js 裡面引入的各單一動作。
  • bottender.config.js - 所有 Bottender 相關的設定放置位置。
  • .env - 放置環境變數,包括 ACCESS_TOKENCHANNEL_SECRET 以及 USE_CONSOLE

Setup

yarn
cp .env.sample .env

然後必須在 .env 中編輯 ACCESS_TOKEN 以及 CHANNEL_SECRET。或是不使用 .env 而在執行 server 的時候直接設定環境變數。 如果想要使用 ConsoleBot 模式,在 .env 中把 USE_CONSOLE 設為 true

NPM Scripts

有兩個預先寫好的指令:

npm run dev

nodemon 執行 Bot,會監控修改進行重啟,適合開發使用。

npm start

執行 Bot。

License

MIT © 吳東曄 Wu, Dung-Ie

bottender-order-example's People

Contributors

tw0517tw avatar

Watchers

James Cloos 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.