Skip to content

er-sunny-4/nexus-discord-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽต Nexus - Discord All-in-One Bot

Discord Python License Status

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


โœจ Features

๐ŸŽต Music System

  • ๐ŸŽถ 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

๐Ÿค– AI-Powered Chat

  • ๐Ÿ’ฌ Responds to mentions with intelligent AI responses
  • ๐Ÿง  Powered by Groq API (Llama3 model)
  • ๐Ÿ“š Maintains conversation context per user
  • โšก Fast and natural responses

๐Ÿ“Š Leveling System

  • ๐Ÿ† Track user activity and award levels
  • ๐Ÿ“ˆ XP-based progression (levelยฒ ร— 100 formula)
  • ๐Ÿ… Server leaderboards
  • ๐Ÿ“ข Customizable level-up notifications
  • ๐Ÿ’พ Persistent data storage

๐Ÿ›ก๏ธ Anti-Spam Protection

  • ๐Ÿšซ Advanced spam detection
  • ๐Ÿ”— Link spam prevention
  • โฑ๏ธ Rate limiting and duplicate detection
  • ๐ŸŽฏ Aggressive punishment system (kick on spam)
  • โš™๏ธ Configurable thresholds and whitelist

๐Ÿ‘‹ Welcome System

  • ๐ŸŽ‰ AI-generated personalized welcome messages
  • ๐ŸŽจ Custom welcome messages with placeholders
  • ๐ŸŽญ Auto-role assignment for new members
  • ๐Ÿ–ผ๏ธ Animated welcome banners

๐ŸŽ™๏ธ Voice Master

  • ๐Ÿšช Automatic personal voice channel creation
  • ๐Ÿท๏ธ Custom channel naming
  • ๐Ÿ—‘๏ธ Auto-deletion when empty
  • ๐Ÿ‘ฅ User-controlled permissions

๐ŸŽซ Ticket System

  • ๐Ÿ“ฉ Interactive ticket creation with buttons
  • ๐Ÿ—‚๏ธ Organized with categories
  • ๐Ÿ“„ Transcript generation on close
  • โœ… Confirmation dialogs
  • ๐Ÿ” Private channel permissions

๐Ÿ”’ Security Features

  • ๐Ÿ›ก๏ธ Additional security and moderation tools
  • ๐Ÿ‘ฎ Permission-based command access
  • ๐Ÿ“ Comprehensive logging

๐Ÿ“‹ Prerequisites

Before you begin, ensure you have the following:


๐Ÿš€ Installation

1. Clone the Repository

git clone https://github.com/er-sunny-4/nexus-discord-bot.git
cd nexus-discord-bot

2. Install Dependencies

pip install -r requirements.txt

3. Configure Environment Variables

Create 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                  # Optional

4. Enable Discord Bot Intents

Go to Discord Developer Portal:

  1. Select your bot application
  2. Go to Bot section
  3. Enable these Privileged Gateway Intents:
    • โœ… Server Members Intent
    • โœ… Message Content Intent
    • โœ… Presence Intent (optional)

5. Run the Bot

# Using Python module
python -m bot.main

# Or using the startup scripts
# Windows:
scripts\start_bot.bat

# PowerShell:
scripts\start_bot.ps1

โš™๏ธ Configuration

Discord Bot Permissions

Your 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)

API Keys Setup

Discord Bot Token (Required)

  1. Go to https://discord.com/developers/applications
  2. Create/select your application
  3. Go to "Bot" section
  4. Copy the token

Spotify API (Optional)

  1. Go to https://developer.spotify.com/dashboard/
  2. Create/select your app
  3. Copy Client ID and Client Secret

Groq API (Optional - for AI chat)

  1. Go to https://console.groq.com/
  2. Sign up and create an API key
  3. Copy the key

๐ŸŽฎ Commands

๐ŸŽต Music Commands

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

๐Ÿ‘‹ Welcome Commands

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

๐Ÿ“Š Level System Commands

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

๐Ÿ›ก๏ธ Anti-Spam Commands

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

๐ŸŽ™๏ธ Voice Master Commands

Command Description
/setvoicemaster <channel> Set voice master channel
/clearvoicemaster <channel> Remove voice master status
/listvoicemaster List all voice master channels

๐ŸŽซ Ticket System Commands

Command Description
/setticket <channel> <category> Set up ticket system
/removeticket Remove ticket system

๐Ÿ“š Documentation

Detailed documentation available in the docs/ folder:


๐Ÿ—๏ธ Project Structure

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

๐Ÿงช Testing

Run the test suite:

# Run all tests
python -m pytest tests/

# Run specific test
python -m pytest tests/test_music_bot.py

๐Ÿค Contributing

Contributions are welcome! Here's how you can help:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contribution Guidelines

  • 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

๐Ÿ› Bug Reports

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)

๐Ÿ’ก Feature Requests

Have an idea? Open an issue with:

  • Feature description
  • Use case (why is this needed?)
  • Proposed solution (if you have one)

๐Ÿ› ๏ธ Tech Stack

  • 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

๐Ÿ“Š Statistics

  • ๐Ÿ“ ~4,100 lines of Python code
  • ๐ŸŽจ 8 core features/extensions
  • ๐Ÿ“š 11 documentation files
  • ๐Ÿงช 14 test files
  • โญ Production-ready quality

โš ๏ธ Disclaimer

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 .env file to git
  • Regenerate tokens if exposed
  • Follow Discord's Terms of Service
  • Respect API rate limits

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ™ Acknowledgments


๐Ÿ“ฌ Support


โญ Star History

If you find this project useful, please consider giving it a star! โญ


Made with โค๏ธ for the Discord community

โฌ† Back to Top

About

Nexus - A feature-rich Discord bot with music playback, AI chat, leveling, anti-spam, and more!

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages