Skip to content

This is a messenger chatbot made for BUTEX(Bangladesh University of Textiles) to deliver study materials 24x7

License

Notifications You must be signed in to change notification settings

TriptoAfsin/notebot-engine-v1

Repository files navigation

Backend engine for Notebot 2021

About:

This is a messenger chatbot made for BUTEX(Bangladesh University of Textiles) to deliver study materials 24x7

Moreover, this bot has casual talking abilities and other functionalities

Used Technolgies -

  1. Javascipt
  2. NodeJS(express)
  3. Messenger Platform

How is it made ?

  1. The bot structure was based on the official documentation provided on facebook messenger platform. Official Documentation

  2. The chatbotController.js located in src/controllers/ is the heart of this bot. this file alone handles all the messages and replies accordingly

  3. Keywords are located in the src/controllers/keywords

  4. Flows are located in the src/controllers/flows

  5. The bot matches keywords and sends specific flows

Internal Tools -

1. Word Detection: I've made two function to match keyword -

1. wordIncludes(arrayToMatch, received_message) : finds just match

2. wordIs(arrayToMatch, received_message) : finds exact match

2. Randomizer : randomPicker(arrayToRandomize)

3. Magic Function 😂 : magicFunc(sender_psid, flowToSend) This function was a technical breakthrough

4. Block genrators: Facebook's graphql has specific format to send objects, you can't make error here, the text messages, images, buttons etc whatever the bot sends is an object, so I made generators to genarate block of objects for texts, image, button etc. Few examples -

    1. textBlockGen("Pass texts here")

    2. imgBlockGen("Image URL")

    3. groupedBtnBlockGen(headerText, BtnObjArr)

            - Web URL Buttons: webBtnBlockGen(title, url)
            - Flow Buttons: webBtnBlockGen(title, payload)

Wanna contribute?

Feel free to clone this repo for your own projects or contribute to this project 😃

Contact me at: AfsinTripto@gmail.com

Thanks for your interest ❤

About

This is a messenger chatbot made for BUTEX(Bangladesh University of Textiles) to deliver study materials 24x7

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages