Coder Social home page Coder Social logo

covid-telegram-serverless's Introduction

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
  • ...

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.