GithubHelp home page GithubHelp logo

phils-hub / support-me-bot Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 0.0 15 KB

A Telegram bot for helping people in need by connecting them to institutions that specialize in their particular plight

License: MIT License

JavaScript 100.00%

support-me-bot's Introduction

README

Overview

The bot asks a series of multiple choice questions. Depending on the answers given, the bot then picks the geographically closest organization that suits the user's particular needs, and sends the contact details to the user.

Structure

  • db.json
    • Mappings of the questions, their answers, and translations thereof
  • orgs.json
    • List of registered organizations
    • Organizations are categorized with an n-to-n relationship between organization and category
    • Longitude and latitude are required for distance calculation
  • support-me-bot.js
    • Entry point for the bot
  • state-machine.js
    • Controls conversation flow
  • conversations.js
    • Tracks answers
  • org-selector.js
    • Selects the most suitable organization by category and physical vicinity
    • Converts zip codes entered by the user to coordinates
  • storage.js
    • Provides access to the questions and answers
    • Contains helper functions for user input validation
  • telegram-api.js
    • Helper functions to simplify communication with the Telegram API

Setup

  1. Register a bot in Telegram
  2. Create a .env file in the project directory
  3. Set the following environment variables:
TELEGRAM_WEBHOOK_URL=abc  // optional
TELEGRAM_TOKEN_BOT=1234  // example
  1. Run npm install from the project directory
  2. Start the bot using npm start
  3. Go to Telegram and message the bot (or type /help)

AWS Elastic Beanstalk

  • Tested on AWS EBS
  • Run npm run-script zip to create an archive under /dist that can be uploaded to AWS EBS
  • Note that the port is passed by EBS to the application

Todo

  • Language specific feedback for
    • Rejected responses
    • Errors
  • Handle invalid zip codes properly
  • Handle not finding any candidate organizations
  • There is a bug somewhere... :)

support-me-bot's People

Contributors

phils-hub avatar

Stargazers

Sam Cotten 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.