Discord bot that generates and shows the latest corona charts for every country.
The Discord bot is developed using a microservice architecture.
RESTful webservice that collects and stores data about COVID-19.
The service uses the disease.sh API to get the latest data about COVID-19. This data is retrieved and stored in a Postgres database and can to be consumed by the service's RESTful interface. It is possible to retrieve this data for any country.
However, the disease.sh API only provides a few key figures. For Denmark, it is possible to get additional data as the service uses the Statistics Denmark Databank API and scrapes the SST website.
This service only collects, scrapes and stores data.
Node.js service using the popular chart.js library to construct and render charts server side. Gets data from corona-data-service.
Responsible for recieving discord commands, forwarding the request to chart-service and finally returning the result to the client (discord guild).
Postgres database for storing corona data.
Running the bot requires a Discord Bot Token. It is recommended to obtain a two tokens (development and production).
Place the tokens in discord-bot/DiscordBot.Commands/Config/appsettings.Production.json
and appsettings.Development.json
respectively. Alternatively set the token as an environment variable.
Logging is performed through Serilog and can be configured in appsettings.json
. However, you can leave this configuration as is.
The easiest way to run the bot is using Docker Compose. A docker-compose.yml
is provided together with a Dockerfile
for all three services.
Clone the project:
git clone https://github.com/roedebaron/discord-corona-bot.git
- cd
discord-corona-bot
- Run
docker-compose up .
to build and run all services
TODO:
- Configure frequency in corona-stats-service
- Confgigure db credentials
- Running from source
TODO:
- Images of command + charts
- Push code to repo
- Migrate to .NET 5
- Consider using another Node version of chart.js. Currently it does not run on Windows.