DISCORD LEVELING BOT

LEGION EXP
BOT

Legion Exp Bot is a Discord leveling bot that grants XP for messages and voice activity, displays ranks, leaderboards, level progress, and rewards users with roles for reaching selected levels.

5

slash commands

2

XP types: text and voice

JSON

persistent levels and cooldown database

Auto

reward roles and level-up messages

FEATURES

Key Features

Based on the code, the bot handles separate text and voice levels, leaderboards, reward roles, XP management, and automatic progress tracking.

💬

Message XP

The bot grants a random amount of XP for text messages in allowed channels with a built-in cooldown system.

🎤

Voice chat XP

The bot grants XP for voice channel activity on a timed interval, with options to ignore solo users, muted users, and deafened users.

📈

Levels and progress system

Levels are calculated from XP, and the rank command shows a progress bar, level, and current user progress.

🏆

Text and voice leaderboards

The top command shows both text and voice leaderboards, including XP, levels, and the user's ranking position.

🎖️

Reward roles for levels

The bot can automatically assign roles for selected text or voice levels and remove lower reward roles.

🛠️

Admin management commands

An administrator can manually set a user's XP or level separately for text and voice progress.

OVERVIEW

What exactly the bot includes

The main features derived directly from the configuration and code.

• Tracks separate text and voice levels The bot stores separate text_xp and voice_xp values, allowing users to progress in two different activity types.
• Grants random XP for messages For each eligible message, the user receives a random XP value from the configured range, for example 15 to 25.
• Grants XP for voice presence The bot grants voice XP every minute if the user meets the activity conditions in a voice channel.
• Ignores solo, muted, and deafened voice users The configuration can exclude users who are alone in voice, muted, or self-deafened.
• Shows rank and progress bar The rank command shows level, XP amount, and a progress bar for both text and voice in one embed.
• Displays server leaderboards The top command builds TOP 5 rankings for text and voice and also shows the author's position if they are outside the top five.
• Gives roles for reached levels The bot automatically checks reward settings and assigns a role when the user reaches the required text or voice level.
• Sends level-up notifications After reaching a new level, the bot can send a message in a selected channel and optionally a DM to the user.
• Lets admins set XP and level manually The setxp and setlevel commands allow administrators to quickly adjust stats without editing files manually.
• Stores data in JSON User levels and cooldowns are saved in the levels.json file, so the data stays persistent after bot restarts.

COMMANDS

Command List

User and admin commands for the leveling system.

User commands

/rankShows the user's rank, text level, voice level, and progress bars.
/topShows text and voice leaderboards on the server.
/help-levelDisplays the list of leveling-related commands.

Administrative commands

/setxpSets a specific XP amount for a user for either text or voice type.
/setlevelSets a specific level for a user for either text or voice type.

CONFIGURATION

How the configuration works

The bot uses config.json to control XP channels, reward roles, XP amounts, and voice system behavior.

XP settings

  • textXp.min / max sets the XP range for each message
  • textXp.cooldownMs sets the cooldown for text XP gain
  • voiceXp.perMinute defines how much XP is earned from voice activity
  • voiceXp.intervalMs sets the XP gain interval

Channels and rewards

  • xpChannels defines the list of channels where XP is enabled
  • noXpChannels excludes channels from XP gain
  • noXpRoles blocks XP gain for selected roles
  • rewards assigns roles for textLevel or voiceLevel

ABOUT BOT

How the bot works

This is not just a simple XP counter — the bot includes separate text and voice systems, persistent storage, rewards, leaderboards, and admin commands.

Technical base

  • discord.js with slash command support
  • JSON database for levels and cooldowns
  • voiceStateUpdate for voice activity tracking
  • automatic saving to levels.json
  • text-based progress bar inside embeds

Behavior system

  • separate text and voice leveling
  • anti-spam message cooldown
  • channel and role filtering for no-XP zones
  • auto reward roles after reaching levels
  • level-up notifications