A free, open source Telegram Bot for keeping up to date on the Coronavirus with the latest news and statistics.
You can get use the bot here: The CVD Bot
You can also choose to run it yourself or you can contribute to this project.
- Microsoft Azure Account
- Telegram Account
- VS Code for Production Deployment and Local Development
- Azure Functions VS Code Extension for Local Development
- ngrok for Local Development
- Node.js LTS Version
- Setup your own bot on Telegram with The Botfather.
- Grab your API Key from The Botfather.
- Clone this repo and install dependencies.
git clone https://github.com/joemccann/the-cvd-bot.git
cd the-cvd-bot
npm i
- Create a
local.settings.json
file in the root of the repo and copy/paste the following:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "node",
"TELEGRAM_BOT_TOKEN": "YOUR-BOT-TOKEN",
"WEBHOOK_ADDRESS_LOCAL": "https://YOUR-NGROK-SUBDOMAIN.ngrok.io/api/bot",
"WEBHOOK_ADDRESS": "https://YOUR-AZURE-FUNCTION-NAME.azurewebsites.net/api/bot"
}
}
- In a terminal, launch
ngrok
with the following command to set up a local proxy:
ngrok http 7071 -host-header=the-cvd-bot
- Now copy/paste the
ngrok
URL into yourlocal.settings.json
file and append/api/bot
to the URL. This serves as a proxy to your webhook when developing locally.
For a production deployment, this repo targets Azure. You'll need an Azure account that has its payment active as you'll need to publish this Azure Function to obtain your production Webhook API (i.e. your-unique-name.azurewebsites.net).
Upon a successful first deployment, you'll need to add some production environment variables.
In the Azure portal, navigate to the application settings within the Azure Function Configuration page for your CVD Bot Azure Function:
You'll need to add (+) a new application setting for each of the following names and their values:
PRODUCITON: true
TELEGRAM_BOT_TOKEN: YOUR-TELEGRAM-BOT-TOKEN
WEBHOOK_ADDRESS: YOUR-AZURE-WEBSITES-PRODUCTION-URL
Save these setting and confirm a restart of your Azure Function.
Navigate to your bot and test out the commands.
npm i -D
npm test
- Stats provided by https://corona.lmao.ninja/all
- News articles scraped from https://jerrybrito.com/coronafeed/
The general guidelines for contributing are:
- Does it fix a bug?
- Does it break anything?
- Does it stick to the original goal of The CVD Bot (an informational Telegram bot to keep up withg the CVD-19 virus)
- Does it reduce the build size?
- Is it necessary?
MIT