https://github.com/mohyware/streak-punisher-bot
Streak Punisher is a Discord bot designed to help users maintain their problem-solving streaks.
https://github.com/mohyware/streak-punisher-bot
discord-bot discord-js nodejs problem-solving streak
Last synced: 2 months ago
JSON representation
Streak Punisher is a Discord bot designed to help users maintain their problem-solving streaks.
- Host: GitHub
- URL: https://github.com/mohyware/streak-punisher-bot
- Owner: mohyware
- Created: 2025-01-19T21:05:04.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-18T18:45:15.000Z (3 months ago)
- Last Synced: 2025-02-18T19:42:03.658Z (3 months ago)
- Topics: discord-bot, discord-js, nodejs, problem-solving, streak
- Language: JavaScript
- Homepage:
- Size: 998 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Streak Punisher Bot
### Overview
Streak Punisher is a Discord bot designed to help users maintain their problem-solving streaks. It automatically fetches problems from LeetCode and Codeforces, while also offering the option to manually add problems from other platforms.### Features
- **Automated Problem Fetching:** The bot automatically fetches problems from LeetCode and Codeforces.
- **Manual Problem Addition:** For platforms not directly supported, Streak Punisher allows you to manually add problems, ensuring you can keep your streak alive no matter where you practice.
- **Progress Tracking:** With MongoDB for data persistence, Streak Punisher keeps a detailed record of your solved problems, streaks, and overall progress, helping you visualize your growth over time.
---
### Bot Commands
#### User Commands:- `!join `
Adds a new user to the system.- `!getuser `
Retrieves the details of the specified user.- `rename `
Updates the leetcode or codeforces username of an existing user.- `!escape `
Removes the specified user from the system.**Example:**
`!join mohy null mohyware`
Adds a user with only a Codeforces username.#### Problem Commands:
- `!addproblem `
For problems that are not on Codeforces or LeetCode, add them manually.- `!deleteproblem `
Deletes the specified problem from the system.#### Statistics Commands (Admin Only):
- `!dailystreak`
Retrieves the daily streak statistics for all users.- `!updatestreak`
Updates the daily streak for all users.- `!setstreak <@username> `
Manually sets the daily streak for a specific user.---
### Prerequisites
Ensure you have the following:
- **Node.js** (v16 or later recommended)
- **MongoDB** instance (local or cloud-hosted)
- **Discord Bot Token** (obtained from the [Discord Developer Portal](https://discord.com/developers/applications))---
### Installation
1. Clone the repository:
```bash
git clone https://github.com/mohyware/streak-punisher-bot.git
cd streak-punisher-bot
2. Install dependencies:
```bash
npm install
```
3. Rename .env.example to .env and add your configurations:
```bash
# DB
MONGO_URI=mongodb+srv://name:[email protected]/databasename
# Server Port (8000 Koyeb deployment health check)
PORT=8000
# Platforms
CODEFORCES_KEY=your-codeforces-key
CODEFORCES_SECRET=your-codeforces-secret
LEETCODE_COOKIE='csrftoken=your-leetcode-cookie'
# Discord
DISCORD_TOKEN=your-bot-token
OWNER_ID=your-discord-id # for admin commands
ALLOWED_CHANNEL_ID_1=
ALLOWED_CHANNEL_ID_2=
ALLOWED_CHANNEL_ID_3=
```
4. Use one of the following commands to start the bot:
```bash
npm run dev
```
```bash
npm run start
```
---### Usage
1. Invite the bot to your Discord server using the OAuth2 URL.2. Use the commands listed above to interact with the bot.
---### Contributing
Feel free to fork the repository and submit pull requests.