GithubHelp home page GithubHelp logo

gys-dev / chatbot-ws Goto Github PK

View Code? Open in Web Editor NEW

This project forked from uetchatbot/chatbot-ws

0.0 0.0 0.0 16 KB

Ứng dụng chat với người lạ trên nền tảng Facebook Messenger 🎇✨

JavaScript 100.00%

chatbot-ws's Introduction

API for UETChatbot

Yêu cầu

  • VPS cài sẵn MySQL server, NodeJS
  • Chứng thư số SSL cho địa chỉ IP của VPS. Lưu ý: Có thể dùng SSL cho tên miền riêng, và cần trỏ tên miền về địa chỉ IP VPS
  • Facebook Page (nơi đặt trụ sở Chatbot :P)

Cấu hình phía Facebook

Làm theo các bước như ở đây

Lưu ý: Bước Setup a Webhook sẽ được thực hiện sau khi cấu hình và chạy App trên server

Cấu hình phía Server

  1. Tạo database mới trong MySQL
  2. Cấu hình database, webhook token, Facebook Page token trong .env
    • DB_NAME tên database đã tạo
    • DB_USER người dùng được cấp toàn quyền trên database
    • DB_PASSWORD mật khẩu người dùng
    • WEBHOOK_TOKEN webhook token của bạn (để Facebook xác nhận webhook)
    • PAGE_ACCESS_TOKEN page token bạn lấy được ở bước Cấu hình Facebook
  3. Chạy npm run database để tạo metadata cho database
  4. Chạy npm start để khởi động App Chatbot

Cấu hình Facebook Webhook

Thực hiện bước Setup a Webhook còn dở ở trên

  • Callback URL là url tới webhook của bạn
  • Verify Token là webhook token bạn đã cấu hình ở Server
  • Subscription Fields tích chọn messages

Done! We have a Chatbot!

Giờ bạn đã có thể public Chatbot để mọi người cùng tham gia thả thính!

Chúc may mắn và hi vọng bạn sẽ xây dựng được một Chatbot của riêng trường mình^^!

Lưu ý: Khi muốn public Chatbot, bạn cần xin phép Facebook để họ review và public Chatbot cho bạn. Lúc đó thì những người khác mới sử dụng Chatbot được. Xem hướng dẫn ở đây

chatbot-ws's People

Contributors

bqcuong avatar m-inh 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.