A Discord bot for tracking and analyzing Squad game statistics in real-time.
This project provides a comprehensive statistics tracking system for Squad gameplay, using WebSocket connections to collect real-time data from Squad servers. The bot processes and stores this data, allowing players and server administrators to monitor performance and progress through Discord commands.
- Real-time data collection via WebSocket connections
- Multiple server support with automatic reconnection
- Discord slash commands for data access
- Database storage for historical analysis
- Comprehensive logging and error handling
- Clone the repository
- Copy
src/config/servers.example.jstosrc/config/servers.jsand configure your servers - Copy
src/config/roles.example.jstosrc/config/roles.jsand configure your Discord roles - Create a
.envfile with required environment variables - Install dependencies:
npm install - Start the bot:
npm start
The bot uses a hierarchical role system for command permissions. To set up roles:
- Copy
src/config/roles.example.jstosrc/config/roles.js - Replace the placeholder role IDs with your actual Discord role IDs
- Customize the role hierarchy and command permissions as needed
Role Hierarchy:
staff(level 1) - Basic admin commandsadmin(level 2) - Server management commandssenior_admin(level 3) - Database management commandshead_admin(level 4) - Bot configuration commands
Higher-level roles automatically get access to lower-level commands.
More detailed setup and configuration instructions will be added as the project develops.
This project is licensed under the MIT License - see the LICENSE file for details.
If you need to reset your MariaDB database and ensure it uses full Unicode support, you can use the following command:
mysql -u root -p -e "DROP DATABASE squad_stats; CREATE DATABASE squad_stats CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"After recreating the database, run your migrations to set up the tables:
npm run migrate