Skip to content

lhandal/corona-bot

Repository files navigation

Contributors Forks Python Badge MIT License LinkedIn


CORONAVIRUS BOLIVIA 🇧🇴 WHATSAPP BOT

Whatsapp bot that gives information about statistics, procedures and news regarding the COVID-19 pandemic in Bolivia.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents

About The Project

I appologize in advance because some of the code and the screenshots provided are in spanish, since the project is intended for a Bolivian public and spanish is the main spoken language. I do plan to bring this bot to a larger global audience in the future.


This project started with the motivation of learning how to build a chatbot with Flask and Python. After succesfully creating a bot that could:

  • Reply to basic commands
  • Send images and links
  • Send static hardcoded information

I decided to add a scraper script that could get updated data every time from the official Bolivian government website, as well as making calls to external APIs. All the code is hosted in Heroku for ease of use and resilience.

This bot is intended to help inform the population of my country about safety measures, official statements and current statistics. As well as providing contact resources in case of an emergency.

Built With

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

  • Environment running python 3.6
  • Twilio account with WhatsApp sandbox
  • Heroku account

Installation

  1. Clone the repo
$ git clone https://github.com/lhandal/corona-bot.git
  1. Install required packages
$ pip install -r requirements.txt
  1. Create a blank app in Heroku

  2. Deploy the app in Heroku

$ heruko login #login
$ git init
$ heroku git:remote -a {heroku-project-name}
$ git add .
$ git commit -m "Final Commit Deploying to Heroku"
$ git push heroku master

In my case I used GitHub CI/CD offered by heroku to redeploy the app with every commit to my repo. You can configure this inside the app preferences!

  1. Copy your Heroku app URL into Twilio's sandbox

  1. Go to the kaffeine heroku app and paste the name of your app in there. If you don't know, after 30 minutes of inactivity, Heroku puts your app to sleep (idle) if you are using their free tier. Most of the times that is perfectly fine, since a request or ping will wake it up. Since I'm using another script to send scheduled updates, I need the app to be constantly running. Kaffeine pings your app every 25 minutes to avoid idleness.

Usage

WhatsApp Me URL

To use this bot click on this LINK

Manual Way

Simply send a WhatsApp message to +1 (415) 523-8886 with code join religious-steady. It will show a message saying connected to sandbox. Now start talking by saying Hi | Hola | Hello | Menu and it will display the followup chat options.

Features

The implemented commands are:

  • Statistics of COVID-19 cases in each Bolivian city as well as the whole country
  • Possible symptoms and recommendations
  • Perform a self-evaluation of symptoms to see if you have the virus.
  • Donation options for fundraisers against Coronavirus in Bolivia.
  • Latest official government statements.
  • Latest worldwide COVID-19 news (in a very satiric way).

Roadmap

See the open issues for a list of proposed features (and known issues).

TODOs

  • Implement a NLP model to be able to hold conversations better.
  • Implement other countries and worldwide statistics.
  • Increase the number of input options for more robustness.
  • Add an automatic daily stats sender to everyone who is subscribed.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Leandro Handal

Project Link: https://https://github.com/lhandal/corona-bot

About

Whatsapp bot that sends daily information about COVID-19 in Bolivia.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages