A feature-rich Discord music bot built with TypeScript and Discord.js v14, offering high-quality music streaming with an intuitive command system and modern UI controls.
- 🎶 High-Quality Music Streaming - Powered by Lavalink
- 🎛️ Interactive Music Controls - Skip, pause, resume, and volume controls
- 📝 Queue Management - View and manage your music queue
- 🔄 Loop Modes - Track and queue loop options
- 🎚️ Audio Filters - Enhance your listening experience
- 🎯 Slash Commands Support - Modern Discord command interface
- 🎨 Rich Embeds - Beautiful and informative message displays
- 📱 Responsive UI - Interactive buttons and components
- Node.js (v16.9.0 or higher)
- Discord Application with bot token
- Lavalink Server (for music streaming)
-
Clone the repository
git clone https://github.com/BackStacked/Music-Bot.git cd Music-Bot -
Install dependencies
npm install
-
Environment Setup Create a
.envfile in the root directory:DISCORD_TOKEN=your_bot_token_here LAVALINK_HOST=localhost LAVALINK_PORT=2333 LAVALINK_PASSWORD=youshallnotpass
-
Build the project
npm run build
-
Start the bot
npm start
For development with auto-restart:
npm run devsrc/
├── index.ts # Bot entry point
├── commands/ # Command implementations
│ ├── HelpCommand.ts # Help command
│ └── Music/ # Music-related commands
│ ├── FilterCommand.ts
│ ├── LoopCommand.ts
│ ├── PauseCommand.ts
│ ├── PlayCommand.ts
│ ├── PlayerController.ts
│ ├── QueueCommand.ts
│ ├── SkipCommand.ts
│ ├── StopCommand.ts
│ └── VolumeCommand.ts
├── config/ # Configuration files
│ └── lavalink.ts # Lavalink configuration
├── core/ # Core bot functionality
│ ├── Bot.ts # Main bot class
│ ├── Command.ts # Base command class
│ ├── Embed.ts # Custom embed builder
│ └── MusicManager.ts # Music management system
├── events/ # Discord event handlers
│ ├── MessageCreate.ts # Message handling
│ └── Ready.ts # Bot ready event
├── UI/ # User interface components
│ └── MusicController.ts # Music control interface
└── utils/ # Utility functions
├── EmbedFactory.ts # Embed creation utilities
└── Formatter.ts # Text formatting utilities
!play <song>- Play a song or add to queue!pause- Pause the current track!skip- Skip to the next track!stop- Stop playback and clear queue!queue- Display the current queue!volume <1-100>- Adjust playback volume!loop [off/track/queue]- Set loop mode!filter <filter>- Apply audio filters
!help- Display available commands
- Download Lavalink from the official repository
- Configure your
application.ymlfile - Start the Lavalink server before running the bot
Ensure your bot has the following permissions:
- Send Messages
- Use Slash Commands
- Connect to Voice Channels
- Speak in Voice Channels
- Use Voice Activity
- Discord.js v14.21.0 - Discord API wrapper
- Blue.ts - Command framework
- TypeScript - Type-safe JavaScript
- Lavalink - Audio streaming
discord.js- Discord API libraryblue.ts- Discord bot frameworkdotenv- Environment variable managementmodule-alias- Module path aliasing
typescript- TypeScript compilerts-node- TypeScript executionnodemon- Development auto-restarttsc-alias- TypeScript path aliasingtsconfig-paths- TypeScript path resolution
- Follow the installation steps above
- Configure your
.envfile - Run
npm run build && npm start
- Set up a VPS or cloud service
- Install Node.js and PM2
- Clone and configure the bot
- Use PM2 for process management:
pm2 start dist/index.js --name "music-bot"
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or need help:
- Check the Issues page
- Create a new issue with detailed information
- Join our Discord server for community support
- [✔️] Spotify playlist support
- Web dashboard
- Custom playlists
- Music recommendations
- Multi-language support
- Discord.js community for excellent documentation
- Lavalink developers for the audio streaming solution
- Contributors who helped improve this project
⭐ Star this repository if you found it helpful!