|
1 | | -# collaborative-algo-training-discord-bot |
2 | | -A Discord bot for automatizing collaborative algo training |
| 1 | +<p align="center"> |
| 2 | + <img width="100px" src="https://github.com/likespro.png" align="center" alt="Competitive Template" /> |
| 3 | + <h2 align="center">Competitive Programming Statistics Bot</h2> |
| 4 | + <p align="center">A Discord bot to track users on competitive programming platforms</p> |
| 5 | +</p> |
| 6 | +<p align="center"> |
| 7 | + <a href="https://github.com/anuraghazra/github-readme-stats/actions"> |
| 8 | + <img alt="Build Passing" src="https://github.com/likespro/cp-programming-stats-bot/workflows/Main Branch Workflow/badge.svg" /> |
| 9 | + </a> |
| 10 | + <a href="https://github.com/likespro/cp-programming-stats-bot/graphs/contributors"> |
| 11 | + <img alt="GitHub Contributors" src="https://img.shields.io/github/contributors/likespro/cp-programming-stats-bot" /> |
| 12 | + </a> |
| 13 | + <a href="https://github.com/likespro/cp-programming-stats-bot/issues"> |
| 14 | + <img alt="Issues" src="https://img.shields.io/github/issues/likespro/cp-programming-stats-bot?color=0088ff" /> |
| 15 | + </a> |
| 16 | + <a href="https://github.com/likespro/cp-programming-stats-bot/pulls"> |
| 17 | + <img alt="GitHub pull requests" src="https://img.shields.io/github/issues-pr/likespro/cp-programming-stats-bot?color=0088ff" /> |
| 18 | + </a> |
| 19 | + </p> |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +## Overview |
| 26 | +The goal of this Discord bot is to bring users' statistics from different competitive programming platforms right to Discord. |
| 27 | +## How to use |
| 28 | +Track new user: just execute `/track <platform> <username> <track_this_user_just_for_fun_or_not?>` in Discord Guild where the bot was installed |
| 29 | + |
| 30 | +**Currently supported platforms:** |
| 31 | +* CodeForces |
| 32 | +## Requirements |
| 33 | +* Running MongoDB server - you can download it on www.mongodb.com or use free cluster from MongoDB Atlas - https://cloud.mongodb.com |
| 34 | +* Discord bot token - you can create it on https://discord.com/developers/applications. The bot need to be installed to your Guild and need to have scopes `applications.commands`, `bot` and permissions `Manage Channels`, `Send Messages`. You can set they in your dashboard before bot installation to Guild. |
| 35 | +## How to install (traditional) |
| 36 | +* Build jars with `./gradlew build` or download already built fat jar artifact from the last successful action on https://github.com/likespro/cp-programming-stats-bot/actions |
| 37 | +* Ensure you have set all needed environment variables (see the list below) |
| 38 | +* Run fat jar with Java 21+: `java -jar cp-programming-stats-bot-fat-<version>.jar`. If you built jars manually, they will be located in `build/libs/` |
| 39 | +## How to install (docker) |
| 40 | +* Pull image: `docker image pull ghcr.io/likespro/cp-programming-stats-bot:main` |
| 41 | +* Run the image with `docker run ghcr.io/likespro/cp-programming-stats-bot:main`. You can set environment variables by `-e <VARIABLE>=<VALUE>`, for example: `docker run -e MONGODB_URL="mongodb+srv://example.com" -e MONGODB_DATABASE="stats-database" ghcr.io/likespro/cp-programming-stats-bot:main` |
| 42 | +## How to install (helm) |
| 43 | +* Add repository with `helm repo add cp-programming-stats-bot https://likespro.github.io/cp-programming-stats-bot` or update it (if you already added it earlier) with `helm repo update cp-programming-stats-bot` |
| 44 | +* Deploy Helm Chart: `helm install cp-programming-stats-bot/cp-programming-stats-bot`. You can set environment variables by `--set env.<VARIABLE>=<VALUE>`, for example: `helm install cp-programming-stats-bot/cp-programming-stats-bot --set env.MONGODB_URL="mongodb+srv://example.com" --set env.MONGODB_DATABASE="stats-database"` |
| 45 | +## Environment variables |
| 46 | +* Set `MONGODB_URL` environment variable to valid URL of your MongoDB server, for example: `mongodb+srv://[username:password@]host[/[defaultauthdb][?options]]` |
| 47 | +* [ Optional ] Set `MONGODB_DATABASE` environment variable to valid MongoDB database name. If not specified, `cp-programming-stats-bot` will be used as name |
| 48 | +* [ Optional ] Set `DISCORD_BOT_TOKEN` environment variable to valid Discord bot token. If not specified, you will need to set `<database>/misc/config/discordBotToken` field manually after the first launch |
| 49 | +* [ Optional ] Set `DISCORD_GUILD_ID` environment variable to valid Discord Guild ID. You can get ID of any guild by enabling Developer mode in `Discord/Settings/Advanced` and then right-click on the Guild you want to use and copy its ID. If not specified, you will need to set `<database>/misc/config/discordGuildId` field manually after the first launch |
| 50 | +* [ Optional ] Set `DISCORD_GLOBAL_STATISTICS_CHANNEL_ID` environment variable to valid ID of Discord text channel where to publish global statistics. You can get ID of any text channel by enabling Developer mode in `Discord/Settings/Advanced` and then right-click on the text channel you want to use and copy its ID. If not specified, bot will try to automatically find a text channel with name "statistics". If no such channels were found, bot will create a new text channel with this name |
| 51 | +* [ Optional ] Set `DISCORD_CONTESTS_STATISTICS_CHANNEL_ID` environment variable to valid ID of Discord text channel where to publish contests statistics. You can get ID of any text channel by enabling Developer mode in `Discord/Settings/Advanced` and then right-click on the text channel you want to use and copy its ID. If not specified, bot will try to automatically find a text channel with name "contests-statistics". If no such channels were found, bot will create a new text channel with this name |
| 52 | +## Screenshots |
| 53 | +Global Statistics |
| 54 | + |
| 55 | +Contest Statistics |
| 56 | + |
0 commit comments