A Node.js Discord bot designed to manage teams and players for the Elo Heroes League, supporting 800+ players with persistent MongoDB storage. The bot includes comprehensive team management features, player verification, and automated role management.
- Team Management: Create, delete, and manage teams with captains and managers
- Player Operations: Add/remove players and coaches with approval workflows
- Role Management: Automated Discord role assignment and removal
- Player Verification: Check player stats and rank using Tracker.gg integration
- Voting System: Approval-based player addition/removal with Discord buttons
- MongoDB Integration: Persistent data storage for teams, players, and coaches
- Proxy Support: Web scraping with proxy authentication for player stats
- OpenAI Integration: AI-powered player analysis and smurf detection
- Comprehensive Logging: Winston-based logging system
-
Clone the repository:
git clone https://github.com/jSydorowicz21/eh-overlord.git cd eh-overlord -
Install dependencies:
npm install
-
Create a
.envfile in the root directory and add your environment variables (see Configuration). -
Start the bot:
node bot.js
Create a .env file in the root directory with the following environment variables:
# Discord Configuration
DISCORD_BOT_TOKEN=your-discord-bot-token
APPLICATION_ID=your-application-id
GUILD_ID=your-guild-id
# Database
MONGODB_URI=your-mongodb-connection-string
# API Keys
OPENAI_API_KEY=your-openai-api-key
VALORANT_API_KEY=your-valorant-api-key
VALORANT_API_BASE_URL=valorant-api-base-url
# Web Scraping
PROXY_URL=your-proxy-url
PROXY_USERNAME=your-proxy-username
PROXY_PASSWORD=your-proxy-password
TRACKER_BASE_URL=https://tracker.gg/valorant/profile/riot/
# Roles
SEASON_ROLE=your-season-role-id
COACH_ROLE=your-coach-role-id
CAPTAIN_ROLE=your-captain-role-id
# OpenAI Configuration
OPENAPI_PROMPT=your-custom-prompt-for-player-analysisThe bot automatically connects to MongoDB and registers slash commands on startup. It supports both general user commands and staff-level administrative commands.
-
/check- Check if a player is likely a smurfriot_id(STRING): The Riot ID of the player (e.g., username#tagline)
-
/add_player- Request to add a player to your teamriot_id(STRING): The Riot ID of the playerdiscord_id(USER): The Discord user to add
-
/remove_player- Request to remove a player from your teamdiscord_id(USER): The Discord user to remove
-
/add_coach- Add a coach to your teamriot_id(STRING): The Riot ID of the coachdiscord_id(USER): The Discord user to add as coach
-
/remove_coach- Remove a coach from your teamdiscord_id(USER): The Discord user to remove as coach
-
/team- Display team informationplayer_discord_id(USER): The Discord user to check
-
/request_sub- Request a substitute playerriot_id(STRING): The Riot ID of the substitutediscord_id(USER): The Discord user to add as substitute
-
/staff create_team- Create a new teamteam_name(STRING): The name of the teamcaptain_discord_id(USER): The Discord ID of the team captainteam_channel(CHANNEL): The channel to set for the teamteam_role(ROLE): The role to assign to the team
-
/staff delete_team- Delete a teamcaptain_discord_id(USER): The Discord ID of the team captain
-
/staff set_team_channel- Set the channel for the teamteam_name(STRING): The name of the teamchannel_id(CHANNEL): The channel to set for the team
-
/staff set_captain- Set a new captain for the teamcaptain_discord_id(USER): The Discord ID of the new team captainteam_name(STRING): The name of the team
-
/staff set_manager- Set a new manager for the teammanager_discord_id(USER): The Discord ID of the new managerteam_name(STRING): The name of the team
-
/staff override_add- Bypass approval to add a playerriot_id(STRING): The Riot ID of the playerdiscord_id(USER): The Discord ID of the playercaptain_discord_id(USER): The Discord ID of the team captain
-
/staff override_remove- Bypass approval to remove a playerplayer_discord_id(USER): The Discord ID of the playercaptain_discord_id(USER): The Discord ID of the team captain
-
/staff update_team_info- Update team informationteam_name(STRING): The current name of the teamnew_team_name(STRING): The new name for the teamnew_captain_discord_id(USER): The Discord ID of the new team captain
-
/staff set_team_role- Assign a role to the teamteam_name(STRING): The name of the teamrole_id(ROLE): The role to assign to the team
-
/staff set_riot_id- Set the Riot ID for a playerdiscord_id(USER): The Discord ID of the playernew_riot_id(STRING): The new Riot ID of the player
bot.js- Main bot file with Discord client setup and command registrationsrc/handlers/- Core business logic handlersinteractionHandler.js- Discord interaction processingmongoHandler.js- Database operations and modelsplayerHandler.js- Player operations and web scraping
src/commands/- Slash command definitionsgeneralCommands.js- User-level commandsstaffCommands.js- Administrative commandspredictionCommands.js- Prediction and point management
src/models/- MongoDB schemas and modelsPlayer.js- Player data modelTeam.js- Team data modelCoach.js- Coach data modelPrediction.js- Prediction trackingPoint.js- Point system
src/utils/- Utility functions and helperslogger.js- Winston logging configurationerrorNoticeHelper.js- Error handling utilitiesopenAiHelper.js- OpenAI API integrationhelperFunctions.js- Common helper functions
- Voting System: Player additions/removals require staff approval through Discord buttons
- Role Automation: Automatic Discord role management based on team membership
- Player Verification: Integration with Tracker.gg and Valorant API for player validation
- Proxy Support: Supports proxy authentication for Tracker.gg scraping
- AI Analysis: OpenAI integration for player behavior analysis
- Discord.js v14 - Modern Discord bot framework
- MongoDB/Mongoose - Database and ODM
- Puppeteer - Used to scrape player stats from Tracker.gg
- OpenAI API - AI-powered player analysis
- Winston - Comprehensive logging
- Jest - Testing framework
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
For questions or support, contact Devil920 on Discord.
This project is licensed under the ISC License. See the LICENSE file for details.
EH Overlord - Powering the Elo Heroes League with automated team management and player verification.