Skip to content

💬 Telegram bot for tracking live COVID-19 statistics in Norway

License

Notifications You must be signed in to change notification settings

frefrik/covid19norge-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COVID-19 Norge - Telegram Bot

COVID-19 Norge
(Preview)

Description

Telegram bot for tracking live COVID-19 statistics in Norway.

The bot autoposts live COVID-19 updates to a group/channel/user of your choosing:

bot:
  token: BOT_TOKEN
  autopost:
    chatid: CHAT_ID

Bot is live in this channel: COVID-19 Norge

Screenshots

Live Updates

c19_stats c19_live

Graphs

c19_graphs-1 c19_graphs-2

RSS

c19_rss

Features

Autopost:

  • Live updates/events
    • Tested
    • Confirmed cases
    • Deaths
    • Admissions
    • Respiratory
    • Vaccine doses
    • Smittestopp
  • Graphs
    • Tested
    • Confirmed
    • Dead
    • Hospitalized
    • Vaccine doses
    • Smittestopp
  • RSS
    • News from FHI (Folkehelseinstituttet)
    • News from the goverment (Regjeringen)

Available functions:

  • /help - Show commands
  • /stats - COVID-19 statistikk Norge
  • /tested - Graf over testede i Norge
  • /confirmed - Graf over smittede i Norge
  • /dead - Graf over dødsfall i Norge
  • /hospitalized - Graf over sykehusinnleggelser i Norge
  • /vaccine - Graf over antall personer vaksinert i Norge
  • /smittestopp - Graf over data fra Smittestopp

Installation

Docker

Create a file named docker-compose.yml and add the following:
version: '3.4'

services:
  bot:
    container_name: covid19norge-telegram-bot
    image: frefrik/covid19norge-telegram-bot
    restart: unless-stopped
    environment:
      - TZ=Europe/Oslo
    volumes:
      - ./config:/app/bot/config
      - ./data:/app/bot/data
Download and edit bot configuration
$ mkdir -p config \
  && wget https://raw.githubusercontent.com/frefrik/covid19norge-telegram-bot/master/config/config.dist.yml -O config/config.yml
Start bot
$ docker-compose up -d

git + Docker

Clone the repository
$ git clone https://github.com/frefrik/covid19norge-telegram-bot.git
$ cd covid19norge-telegram-bot/
Copy config.dist.yml to config.yml and edit configuration
$ cd config/
$ cp config.dist.yml config.yml
Start bot
$ docker-compose up -d

Docker Notes

Editing config

If config.yaml is updated while bot is running, the container must be restarted to use the updated config.

$ docker restart covid19norge-telegram-bot
Bot logs

Use docker logs -f covid19norge-telegram-bot to show informational logs.


Command line

Install dependencies
$ pip install -r requirements.txt
Copy config.dist.yml to config.yml and edit configuration
$ cp config/config.dist.yml config/onfig.yml
Start bot
$ screen -dmS covid19norge python bot.py
Attaching to the screen
$ screen -r covid19norge

Datasource