A feature-rich Discord bot for tracking player performance, managing leaderboards, and recording match statistics with AI-powered scoreboard recognition.
- Dynamic Leaderboards - Automatically updated leaderboards with real-time player rankings
- Multiple Sort Options - Sort by Points, K/D Ratio, Total Kills, Objective Time, Assists, or MVP count
- Animated GIFs - Toggle between static images and animated GIFs with glowing avatar effects
- Tier System - Organize players into custom tiers based on point thresholds
- Pagination - Navigate through large leaderboards with easy-to-use controls
- AI-Powered OCR - Automatic scoreboard recognition using Tesseract or Google Cloud Vision
- Manual Tagging - Tag players manually when automatic recognition needs assistance
- Match History - Complete history of all matches with detailed statistics
- Point System - Customizable points allocation based on performance
- Glowing Avatars - Top 3 players get animated glowing effects in GIF mode
- ๐ฅ Gold glow for 1st place
- ๐ฅ Silver glow for 2nd place
- ๐ฅ Bronze glow for 3rd place
- Profile Cards - Beautiful player profile cards with stats and achievements
- Custom Backgrounds - Support for default, URL, or uploaded leaderboard backgrounds
- IGN Linking - Link Discord accounts to in-game names
- Auto-Detection - Automatically match Discord users to game statistics
- Profile Commands - View detailed player statistics and rankings
- Channel Configuration - Set results and log channels via commands
- Tier Role Management - Automatic Discord role assignment based on performance
- OCR Provider Selection - Choose between Tesseract and Google Cloud Vision
- Auto-Record Toggle - Enable/disable automatic match recording
- Node.js 18+
- Discord Bot Token (Create one here)
- (Optional) Google Cloud Vision API credentials for enhanced OCR
-
Clone the repository
git clone <repository-url> cd ptbp
-
Install dependencies
npm install
-
Configure environment variables
cp .env.example .env
Edit
.envand add your credentials:DISCORD_TOKEN=your_discord_bot_token BOT_CLIENT_ID=your_bot_client_id
-
Start the bot
npm start
| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN |
โ | Your Discord bot token |
BOT_CLIENT_ID |
โ | Your bot's client ID |
LOG_CHANNEL_ID |
โ | Channel for logging invalid scoreboards |
RESULTS_CHANNEL_ID |
โ | Channel for posting results |
GOOGLE_APPLICATION_CREDENTIALS |
โ | Path to Google Cloud credentials |
GROQ_API_KEY |
โ | Groq API key for AI features |
UPDATE_INTERVAL_SECONDS |
โ | Leaderboard update interval (default: 60) |
/leaderboard [sort_by]- View the current leaderboard/setign <ign>- Link your Discord account to an in-game name/profile [@user]- View player profile and statistics
/setresults <channel>- Set the results channel/setlog <channel>- Set the log channel/setmanager <role>- Set the manager role/settierroles- Configure tier roles and point requirements/setocr <provider>- Choose OCR provider (tesseract/google)/toggleanimation <mode>- Toggle between static/animated leaderboards/toggleautorecord- Enable/disable auto-recording
- Scoreboard Upload - Users post game scoreboard screenshots in the designated channel
- AI Recognition - The bot uses OCR to extract player names and statistics
- Point Allocation - Points are automatically calculated and distributed
- Leaderboard Update - Rankings update in real-time
- Role Assignment - Players automatically receive tier roles based on performance
Clean, crisp PNG images with:
- Player avatars with rank-colored frames
- Tier group headers
- Detailed statistics
- Pagination controls
Engaging GIF animations featuring:
- โจ Pulsing glow effects on top 3 avatars
- ๐จ Color-coded glows (Gold, Silver, Bronze)
- ๐ Smooth animation loop
- All features from static mode
Configure up to 5 tiers with custom:
- Role assignments
- Point thresholds
- Custom colors for visual grouping
Players automatically receive roles and are grouped in the leaderboard based on their points.
npm run build
npm run start:prodThe bot includes a health endpoint for monitoring services like UptimeRobot:
https://your-domain.com/health
web: npm run start:prod
- Runtime: Node.js with TypeScript
- Framework: NestJS
- Discord Library: discord.js v14
- OCR: Tesseract.js / Google Cloud Vision
- Image Processing: node-canvas
- Animation: gifencoder
- AI: Groq SDK (optional)
- Points - Total points earned
- Kills - Total eliminations
- Deaths - Times eliminated
- K/D Ratio - Kill/Death ratio
- Assists - Team assists
- Objective Time - Time on objective
- MVP - MVP awards count
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
For issues, questions, or suggestions:
- Check the documentation
- Review existing issues
- Create a new issue with detailed information
Built with โค๏ธ for gaming communities who want professional leaderboard tracking.
Made with NestJS and Discord.js | Powered by AI | Built for Gamers