Nexus is a feature-rich, all-in-one Discord bot with music playback, AI chat, leveling system, anti-spam, and more!
Features โข Installation โข Configuration โข Commands โข Contributing
- ๐ถ Play music from YouTube and Spotify URLs
- ๐ Search and play from YouTube
- ๐ Queue management with loop modes
- ๐๏ธ Volume control with interactive buttons
- ๐ Animated progress bars and beat visualizers
- โฏ๏ธ Interactive controls (Pause/Resume, Skip, Stop, Loop)
- ๐ Voice channel restrictions
- ๐ฌ Responds to mentions with intelligent AI responses
- ๐ง Powered by Groq API (Llama3 model)
- ๐ Maintains conversation context per user
- โก Fast and natural responses
- ๐ Track user activity and award levels
- ๐ XP-based progression (levelยฒ ร 100 formula)
- ๐ Server leaderboards
- ๐ข Customizable level-up notifications
- ๐พ Persistent data storage
- ๐ซ Advanced spam detection
- ๐ Link spam prevention
- โฑ๏ธ Rate limiting and duplicate detection
- ๐ฏ Aggressive punishment system (kick on spam)
- โ๏ธ Configurable thresholds and whitelist
- ๐ AI-generated personalized welcome messages
- ๐จ Custom welcome messages with placeholders
- ๐ญ Auto-role assignment for new members
- ๐ผ๏ธ Animated welcome banners
- ๐ช Automatic personal voice channel creation
- ๐ท๏ธ Custom channel naming
- ๐๏ธ Auto-deletion when empty
- ๐ฅ User-controlled permissions
- ๐ฉ Interactive ticket creation with buttons
- ๐๏ธ Organized with categories
- ๐ Transcript generation on close
- โ Confirmation dialogs
- ๐ Private channel permissions
- ๐ก๏ธ Additional security and moderation tools
- ๐ฎ Permission-based command access
- ๐ Comprehensive logging
Before you begin, ensure you have the following:
- Python 3.8+ installed
- FFmpeg installed and in your system PATH
- Download from: https://ffmpeg.org/download.html
- Discord Bot Token from Discord Developer Portal
- (Optional) Spotify API credentials
- (Optional) Groq API Key for AI features
git clone https://github.com/er-sunny-4/nexus-discord-bot.git
cd nexus-discord-botpip install -r requirements.txtCreate a .env file in the root directory:
DISCORD_TOKEN=your_discord_bot_token_here
SPOTIFY_CLIENT_ID=your_spotify_client_id # Optional
SPOTIFY_CLIENT_SECRET=your_spotify_client_secret # Optional
GROQ_API_KEY=your_groq_api_key # OptionalGo to Discord Developer Portal:
- Select your bot application
- Go to Bot section
- Enable these Privileged Gateway Intents:
- โ Server Members Intent
- โ Message Content Intent
- โ Presence Intent (optional)
# Using Python module
python -m bot.main
# Or using the startup scripts
# Windows:
scripts\start_bot.bat
# PowerShell:
scripts\start_bot.ps1Your bot needs these permissions:
- Read Messages/View Channels
- Send Messages
- Manage Messages
- Connect (voice)
- Speak (voice)
- Manage Guild
- Manage Channels (for voice master/tickets)
- Manage Roles (for auto-role)
- Moderate Members (for anti-spam)
- Kick Members (for anti-spam)
Permission Integer: 1099511828487 (Administrator recommended for all features)
- Go to https://discord.com/developers/applications
- Create/select your application
- Go to "Bot" section
- Copy the token
- Go to https://developer.spotify.com/dashboard/
- Create/select your app
- Copy Client ID and Client Secret
- Go to https://console.groq.com/
- Sign up and create an API key
- Copy the key
| Command | Description |
|---|---|
/play <url/query> |
Play music from YouTube/Spotify or search |
/join |
Join your voice channel |
/leave |
Leave the voice channel |
/pause |
Pause the current song |
/resume |
Resume the paused song |
/stop |
Stop playback and clear queue |
/skip |
Skip to the next song |
/setvc [channel] |
Restrict bot to specific voice channel |
/clearvc |
Clear voice channel restrictions |
| Command | Description |
|---|---|
/setwelcome [channel] |
Set welcome message channel |
/setwelcomemessage <text> |
Set custom welcome message |
/setautorole <role> |
Auto-assign role to new members |
/testwelcome |
Test welcome message |
/clearwelcome |
Clear welcome channel |
/clearwelcomemessage |
Clear custom message |
/clearautorole |
Clear auto-role |
| Command | Description |
|---|---|
/setlevelchannel <channel> |
Set level-up notification channel |
/setcheckchannel <channel> |
Set level check channel |
/level [user] |
Check user's level |
/leaderboard |
Show server leaderboard |
| Command | Description |
|---|---|
/antispam |
Show current settings |
/antispam enable/disable |
Toggle anti-spam system |
/antispam messagelimit <1-20> |
Set message rate limit |
/antispam timewindow <1-60> |
Set time window (seconds) |
/antispam duplicatelimit <1-10> |
Set duplicate limit |
/antispam linkdetection <on/off> |
Toggle link detection |
/antispam linklimit <1-10> |
Set link spam limit |
/antispam muteduration <1-300> |
Set timeout duration |
/antispam whitelistrole <role> |
Whitelist/remove role |
/antispam whitelistchannel <channel> |
Whitelist/remove channel |
| Command | Description |
|---|---|
/setvoicemaster <channel> |
Set voice master channel |
/clearvoicemaster <channel> |
Remove voice master status |
/listvoicemaster |
List all voice master channels |
| Command | Description |
|---|---|
/setticket <channel> <category> |
Set up ticket system |
/removeticket |
Remove ticket system |
Detailed documentation available in the docs/ folder:
- Quick Setup Guide
- Setup Guide
- Troubleshooting
- Groq API Setup
- Anti-Spam Guide
- Voice Master Guide
- Voice Master Usage
- Voice Master Troubleshooting
nexus-discord-bot/
โโโ bot/ # Main bot package
โ โโโ main.py # Bot entry point
โ โโโ config.py # Configuration loader
โ โโโ extensions/ # Bot features (cogs)
โ โโโ music_bot.py
โ โโโ chat_system.py
โ โโโ level_system.py
โ โโโ anti_spam.py
โ โโโ welcome_bot.py
โ โโโ voice_master.py
โ โโโ ticket_system.py
โ โโโ security_system.py
โโโ config/ # JSON configuration files
โโโ docs/ # Documentation
โโโ scripts/ # Startup scripts
โโโ tests/ # Test suite
โโโ .env # Environment variables (create this)
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
Run the test suite:
# Run all tests
python -m pytest tests/
# Run specific test
python -m pytest tests/test_music_bot.pyContributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow PEP 8 style guidelines
- Add docstrings to all functions/classes
- Include tests for new features
- Update documentation as needed
- Keep commits atomic and well-described
Found a bug? Please open an issue with:
- Description of the bug
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment (OS, Python version, etc.)
- Logs (if applicable)
Have an idea? Open an issue with:
- Feature description
- Use case (why is this needed?)
- Proposed solution (if you have one)
- Python 3.8+
- discord.py - Discord API wrapper
- yt-dlp - YouTube downloader
- spotipy - Spotify API wrapper
- groq - AI chat (Groq API)
- FFmpeg - Audio processing
- python-dotenv - Environment variables
- ๐ ~4,100 lines of Python code
- ๐จ 8 core features/extensions
- ๐ 11 documentation files
- ๐งช 14 test files
- โญ Production-ready quality
This bot is provided "as is" without warranty of any kind. Use at your own risk. Make sure to:
- Keep your API keys secure
- Never commit
.envfile to git - Regenerate tokens if exposed
- Follow Discord's Terms of Service
- Respect API rate limits
This project is licensed under the MIT License - see the LICENSE file for details.
- discord.py - Discord API wrapper
- yt-dlp - YouTube downloader
- Groq - AI inference API
- Spotify Web API - Spotify integration
- ๐ง Email: abhishekk30034@gmail.com
- ๐ฌ Discord: bruce.xe
- ๐ Issues: GitHub Issues
If you find this project useful, please consider giving it a star! โญ
Made with โค๏ธ for the Discord community