Skip to content

Simple telegram bot to retrieve data of coronavirus affecteds in Spain

Notifications You must be signed in to change notification settings

Chillaso/Covid-Telegram-Serverless

Repository files navigation

COVID SPAIN TELEGRAM BOT

Hello everybody, this is my own telegram bot to know how many people are infected by day in Spain. There are many improvements in my mind but right not we only have available one command implemented, you can check it here.

Contribute

I hope you can give me more ideas, or make this project better, there are a lot of data we can show and a lot of improvements you can give to us! Just fork and PR to the project, every commit will be well received.

Create Telegram bot

First at all you've to create a telegram bot, to do this just follow this steps and copy your telegram token, we'll use later.

How to deploy your own telegram bot backend

We are using Nodejs and Serverless Framework in order to deploy our backend. If you want download the project and try yourself just type the next lines:

First, install node if you don't have it. I like nvm to do this.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

and then, install node stable version

nvm install node stable

then, install serverless globally

npm install -g serverless
npm install serverless-offline --save-dev

now, clone repo and install modules

git clone https://github.com/Chillaso/covid-increment-spain.git
npm i

export your telegram token (without <>)

export TELEGRAM_TOKEN=<your_telegram_token>

make sure you have your AWS credentials configured, if you don't know anything about this, check this guide.

and now, its time to deploy

sls deploy

Attach your backend to your bot

Open a terminal and enter this, replacing your endpoint that you get it in sls deploy output.

curl --request POST --url https://api.telegram.org/bot$TELEGRAM_TOKEN/setWebhook --header 'content-type: application/json' --data '{"url": "<your_api_endpoint>"}'

TODO LIST

  • Get data by day
  • Get data by countries
  • Better command view in telegram bot
  • Cloudwatch event every day sending message with coronavirus news or updating data
  • Death and healed information
  • ...

About

Simple telegram bot to retrieve data of coronavirus affecteds in Spain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published