CPC Bot Icon

Competitive Programming Bot

CP Platform for the MUST CPC Community

Active & In Use

Project Overview

A comprehensive Discord bot designed to automate training, manage contests, and foster engagement within competitive programming communities.

The platform was engineered to solve key organizational challenges within university CPC communities, such as tracking member progress and hosting regular training contests. First developed for the MUST University community, it serves as a centralized hub by integrating directly with the Codeforces API to fetch problems, track submissions, manage user profiles, and create peer-to-peer challenges, all entirely within Discord.

Project Stats

Stars6
Members60+
DurationJul 2025 - Aug 2025

Key Features

  • Fetches live problems, user stats, and submissions from Codeforces.
  • Creates and manages custom contests with an interactive builder.
  • Tracks performance with dynamic daily, weekly, and all-time leaderboards.
  • Links Discord accounts to Codeforces for persistent stat tracking.
  • Enables members to compete in head-to-head programming challenges.
  • Handles concurrent commands efficiently with an asynchronous design.
  • Manages server permissions using role-based access control.
  • Sets up key channels and roles with simple slash commands.

Technologies Used

Python
discord.py
SQLite / Database
Codeforces API
Linux VPS (Hosting)
Git & GitHub

Technical Implementation

My technical contributions to this project include (but may not be limited to):

  • Architected a modular system using discord.py Cogs to separate concerns (Auth, Challenges, Contests), enabling hot-reloading and maintainability.
  • Implemented non-blocking database operations with aiosqlite, designing normalized tables for users, challenges, and contests to support complex leaderboard queries.
  • Integrated the Codeforces API via aiohttp with robust error handling and caching to fetch real-time problem data and verify submissions while respecting rate limits.
  • Engineered a custom Contest Engine that manages state, calculates scores based on difficulty/time, and uses randomization algorithms for fair problem selection.