Skip to content

AhmedMohamedAbdelaty/Codeforces-Discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Codeforces Bot for Discord

Project status

This project is a Discord bot designed to interact with the Codeforces API, providing users with information about contests, user standings, and more directly through Discord commands.

Features

  • User Information: Retrieve and display information about a Codeforces user.
  • Contest Information: Get details about upcoming and finished contests.
  • User Contest Standings: Check the standing of a user in a specific contest.
  • Health Check: A simple HTTP server for health checks.

How to Use

  1. Invite the Bot:
    • Click here to invite the bot to your server.
    • The bot is currently hosted on a free Koyeb instance, so it may not be available all the time.
  2. Commands:
    • /userinfo username:<username>: Get information about a Codeforces user.
    • /upcoming-contests: List upcoming Codeforces contests.
    • /finished-contests: List recently finished Codeforces contests.
    • /standing username:<username> contest_id:<contestId>: Get a user's standing in a specific contest.
    • /random-problem ratingSart:<ratingStart> ratingEnd:<ratingEnd> [tags:<tag1,tag2,...>]: Get a random problem from Codeforces, given rating and tags.
    • /rating-history username:<username>: Get the rating history graph of a user.

Screenshots

  1. Random Problem:
1.mp4
  1. User Information:
2.mp4
  1. Rating History:
3.mp4
  1. Upcoming and Finished Contests:
4.mp4
  1. User Contest Standings:
5.mp4

Setup

  1. Clone the Repository:
git clone https://github.com/AhmedMohamedAbdelaty/Codeforces-Discord-bot.git
  1. Build the Project (requires Maven):
mvn clean install
  1. Run the Docker Container:
docker build -t codeforces-bot .
docker run -d -p 8000:8000 codeforces-bot -t <your_bot_token>

Contributing

Contributions are welcome! Please feel free to submit a pull request.

TODO

  • Return upcoming contests
  • Return finished contests
  • Return user info
  • Return standing of a contest for a user
  • Return random problem
    • Rating range (required)
    • Tags (optional)
  • Return rating history graph of a user
  • Return submissions of a contest for a user
  • last Submissions of a user
  • Given some usernames, return a contest that none of them participated in
    • Contest type as optional (Div3, so on)
    • Gym as optional