Skip to content

AhmedMohamedAbdelaty/Codeforces-Discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An unofficial Discord bot that provides info about contests, user standings, and more.

Features

  • User Info: Get details about a Codeforces user.
  • Contest Info: Check out upcoming and finished contests.
  • User Standings: See how a user did in a specific contest.
  • Compare Problem Ratings: Compare the problem-solving stats of one or two users.
  • Contest Tournament: Suggest a random contest for users. The bot will announce the winners when the contest is over.

Redis Caching

We use Redis to cache API responses. This makes things faster and reduces unnecessary API calls.

How to Use

  1. Invite the Bot:

    • Click here to invite the bot to your server.
    • Note: The bot is hosted on a free Koyeb instance, so it might not always be available.
  2. Commands:

    • /userinfo username:<username>: Get info about a Codeforces user.
    • /upcoming-contests: List upcoming Codeforces contests.
    • /finished-contests: List recently finished Codeforces contests.
    • /standing username:<username> contest_id:<contestId>: See a user's standing in a specific contest.
    • /random-problem ratingStart:<ratingStart> ratingEnd:<ratingEnd> [tags:<tag1,tag2,...>]: Get a random problem from Codeforces based on rating and tags.
    • /rating-history username:<username>: Get the rating history graph of a user.
    • /problem-ratings username:<username>: Get the rating stats of solved problems for a user.
    • /compare-problem-ratings username1:<username1> username2:<username2>: Compare the rating stats of solved problems between two users.
    • /random-contest usernames:<username1>,<username2>,... contest_type:<contestType> [start_time:<startTime>]: Suggest a random contest for a virtual tournament. The bot will announce the winners when the contest is over.

Screenshots

  1. Random Problem:

    1.mp4
  2. User Information:

    2.mp4
  3. Rating History:

    3.mp4
  4. Upcoming and Finished Contests:

    4.mp4
  5. User Contest Standings:

    5.mp4
  6. Problem Rating Statistics:

    1. User problem rating statistics: User Problem Rating Statistics User Problem Rating Statistics

    2. Comparison between two users: Comparison Between Two Users Comparison Between Two Users

  7. Contest Tournament: After the virtual contest ends, the bot will send the participants' ranks along with details like:

    • Number of solved problems
    • Number of wrong answers during the contest

    The bot can handle multiple time zones. The user can also confirm or cancel the command using buttons.

    Contest Tournament Contest Tournament Contest Tournament

Setup

  1. Clone the Repository:

    git clone https://github.com/AhmedMohamedAbdelaty/Codeforces-Discord-bot.git
    
  2. Build the Project (requires Maven):

    mvn clean install
    
  3. Run the Docker Container: The docker image will run the bot and a Redis server. You need to provide the bot token to run the bot.

    docker build -t codeforces-bot .
    docker run -p 8000:8000 -p 6379:6379 codeforces-bot -t <your_bot_token>
    

Contributing

We'd love your help! Feel free to submit a pull request.