Overview
ScoreSaber Reloaded includes a Discord bot that provides administrative commands, monitoring channels, and automated notifications for various events. The bot enables server admins to manage the system and monitor its health in real-time.What the Discord Bot Provides
- Administrative Commands: Slash commands for system management
- Monitoring Channels: Real-time logs for various system events
- Score Feeds: Automated notifications for notable scores
- Status Tracking: Live presence showing tracked score count
- Error Logging: Centralized error reporting
Bot Setup
The Discord bot is initialized during backend startup:backend/src/bot/bot.ts:65-94
Configuration
Required Environment Variables
Channel Configuration
The bot uses dedicated channels for different purposes:backend/src/bot/bot.ts:23-33
Administrative Commands
Refresh Ranked Leaderboards
Force a refresh of all ranked leaderboards:backend/src/bot/command/refresh-ranked-leaderboards.ts:11-27
Usage: /refresh-ranked-leaderboards
Available Commands
The bot includes several admin commands (all require owner permissions):/refresh-ranked-leaderboards- Refresh ranked map data/fetch-missing-player-scores- Fetch scores for tracked players/force-track-player-statistics- Force track player statistics/refresh-medal-scores- Refresh medal score data/update-player-medals- Update player medal counts
backend/src/bot/bot.ts:17-21
Monitoring Channels
Tracked Player Logs
Logs when players are added or removed from tracking:Player Score Refresh Logs
Tracks score refresh operations:Backend Logs
General backend errors and important events:BeatSaver Logs
BeatSaver API interactions and errors:backend/src/bot/bot.ts:23-33
Score Feeds
Number One Feed
Notifies when players achieve rank 1 on leaderboards:Top 50 Scores Feed
Tracks all top 50 global scores:Score Floodgate Feed
High-volume feed for all tracked scores:Medal Scores Feed
Notifies when players earn medal-worthy scores:backend/src/bot/bot.ts:23-33
Sending Messages
Send Embed
Send rich embed messages to channels:backend/src/bot/bot.ts:102-119
Send Text Message
Send plain text messages:backend/src/bot/bot.ts:127-144
Send File
Send file attachments:backend/src/bot/bot.ts:153-178
Bot Presence
The bot’s status displays the total number of tracked scores:backend/src/bot/bot.ts:76-85
Error Handling
The bot includes error handling for interaction failures:backend/src/bot/bot.ts:51-63
Permissions
All administrative commands are protected by permission guards:backend/src/bot/command/refresh-ranked-leaderboards.ts:7-10
Use Cases
System Monitoring
Administrators can monitor system health through dedicated channels:- Track when players are added/removed
- Monitor score refresh operations
- Receive alerts for errors
- Track BeatSaver API issues
Manual Interventions
When needed, admins can manually trigger:- Leaderboard refreshes
- Player score fetches
- Medal updates
- Statistics tracking
Community Engagement
Score feed channels can be used for:- Celebrating top performances
- Tracking rank 1 achievements
- Monitoring medal-worthy scores
Bot Client Configuration
The bot is configured with necessary intents:backend/src/bot/bot.ts:35-43
Ready Event
When the bot connects, it initializes application commands:backend/src/bot/bot.ts:45-49
Best Practices
The bot token should be kept secure and never committed to version control. Use environment variables for configuration.