MusicBro is a music bot for Discord, built using discord.js and discord-player.
MusicBro provides the following slash commands:
clear- Clears the entire queue.info- Displays information about the bot's ping.nowplaying- Displays information about the currently playing song with lyrics.lyrics- Fetches and displays the lyrics of the currently playing song or a specified song.play- Searches for a song or playlist based on a link or query and starts playing. Supports optional flags:force(plays immediately),next(inserts as next), andmix(automatically appends ~25 similar mix tracks).remove- Removes a song from the queue.seek- Seeks to a specified time in the current song.skipto- Skips to a specified song in the queue.volume- Adjusts the volume of the playback.
And also the following button commands:
embedClose- Closes embed.loopDisable- Disables looping.loopQueue- Loops the queue.loopTrack- Loops the current song.next- Changes page to the next page of the queue.pause- Pauses the playback.previous- Changes page to the previous page of the queue.refresh- Refreshes the status message.resume- Resumes the playback.shuffle- Shuffles the queue.skip- Skips the current song.stop- Stops the playback and clears the queue.
Additionally, MusicBro provides the following prefix commands:
!!clear- Deletes messages sent by the bot in the current channel.!!avatar_update- Updates the bot's avatar and banner.*
*These commands are only available to the bot's admin.
MusicBro logs events to two separate files:
- log.log - Records all general system events.
- dev.log - Records events in development mode; use the
debugargument to enable more detailed logging, e.g.,npm run dev -- debug.
- Clone this repository to your local machine.
- Install the required dependencies using the following command:
npm install
- Create a
.envfile in the project's root directory and add the following environment variables:
-
TOKEN: Token of the bot. -
CLIENT_ID: Client ID of the bot. -
ADMIN_ID: ID of the admin.Optional:
TOKEN_DEV: Token of the bot for development purposes.CLIENT_ID_DEV: Client ID of the bot for development purposes.
For example:
TOKEN=1234567890
CLIENT_ID=1234567890
- Register your bot's slash commands using the following command:
npm run deploy
- Run the bot using the following command:
npm start
I personally recommend using nodemon to run the bot, as it will automatically restart the bot when you make changes to the code.
To use nodemon, run the following command:
nodemon
The bot should now be online and ready to use in your Discord server.
For development purposes, you can run the bot using the command npm run dev.
MusicBro is released under the MIT License.
MusicBro was created by pingwin02.


