A modern, fully customizable Discord bot with a robust leveling system, voice XP, giveaways, interactive leaderboards, and role rewards. Built with py-cord.
- Leveling System: Earn XP by sending messages, being active in voice, and reacting to messages.
- Fancy Level Card:
/levelnow returns an image-based rank card. - Voice XP: Gain XP for time spent in voice channels.
- Giveaways: Run and manage server giveaways with flexible durations like
1d 2m 5min. - Leaderboards: Interactive leaderboards for level, messages, and voice activity.
- Role Rewards: Automatically assign roles at certain levels.
- XP Boosts: Grant XP multipliers to users with specific roles.
- Reaction XP: Earn XP for adding reactions (with cooldown).
- Temp Roles: Grant temporary roles and auto-revoke them after the selected duration.
- Web Dashboard: Username + passcode dashboard with permission levels (
viewer,admin,dev), logs, and restart controls.
- Clone the repository:
git clone https://github.com/yourname/NemoBot.git cd NemoBot - Install dependencies:
pip install -r requirements.txt
- Configure
.env:-
Create a
.envfile in the root directory and set the following values:Variable Description TokenRequired. Your Discord bot token. |
LEVEL_CARD_BACKGROUND=assets/level_card_bg.png
-
- Run the bot:
python bot.py
Dashboard access uses usernames with matching passcodes from .env:
DASHBOARD_HOST=0.0.0.0
DASHBOARD_PORT=8080
DASHBOARD_VIEW_TOKEN=change-this-view-token
DASHBOARD_ADMIN_TOKEN=change-this-admin-token
DASHBOARD_DEV_TOKEN=change-this-dev-token
LEVEL_CARD_BACKGROUND=assets/level_card_bg.pngThe dashboard cog loads automatically when you run the bot (because every .py file in cogs/ is loaded).
Quick access in Discord:
- Enable debug mode with
/debug, then use%dashboard. - The bot replies in channel with a short confirmation and sends the dashboard link via DM.
- The DM states "Only you can see this" and does not post passcodes publicly.
- Start the bot:
python bot.py
- Open the dashboard in your browser:
- Local machine:
http://127.0.0.1:8080/ - Remote/VPS host:
http://<server-ip>:8080/
- Local machine:
Login credentials:
- Username:
viewerand passcode: value ofDASHBOARD_VIEW_TOKEN - Username:
adminand passcode: value ofDASHBOARD_ADMIN_TOKEN - Username:
devand passcode: value ofDASHBOARD_DEV_TOKEN
If only one of view/admin is set, it is mirrored to keep both roles available. If no tokens are set, defaults are change-me (viewer/admin) and change-me-dev (dev). Change these immediately in production.
Dashboard home shows spoiler blocks with credentials for your own permission level and lower levels.
/Home/leaderboardLeaderboard view/level-formulaFormula preview, admin updates, and full recalculation action/automodAutomod settings per guild/settingsPresence settings and dev-only restart action/logsDev-only dashboard logs/consoleLegacy route that redirects to/logs
- Login keeps failing: verify username (
viewer,admin,dev) and the matching token in.env 403 Admin permission required: you opened an admin action while logged in asviewer403 Dev permission required: restart/log pages requiredev- Dashboard not reachable: check
DASHBOARD_HOST/DASHBOARD_PORT, firewall rules, and that the bot process is running - Port already in use: change
DASHBOARD_PORTto another free port
Security note: never share your dashboard passcodes publicly.
-
XP Boost Roles:
- File:
cogs/level.py, variable:XP_BOOST_ROLES(top of class) - Example:
XP_BOOST_ROLES = { 111111111111111111: 1.50, # 1.50x boost 222222222222222222: 1.75, # 1.75x boost 333333333333333333: 2.00, # 2.00x boost 444444444444444444: 1.25, # 1.25x boost }
- Replace the placeholder IDs with your server's role IDs.
- File:
-
Reaction XP:
- File:
cogs/level.py, method:on_reaction_add - Users earn 0.1 XP per reaction, with a 1-hour cooldown per user.
- File:
-
Level Role Rewards:
- File:
cogs/level.py, variable:level_roles - Assign role IDs to levels for automatic rewards.
- File:
- Use the
/leaderboardcommand to view the interactive leaderboard. - Toggle between Level, Message, and Voice leaderboards with buttons (see code for details).
/giveaway_start- Duration now supports mixed units:
30min,2h,1d 2m 5min mis interpreted as month,minas minutes
- Duration now supports mixed units:
/temprole_add- Give a role with duration and auto-revoke
/temprole_remove- Remove temporary role immediately
MIT — see LICENSE