Music Bot is a site/discord bot set up to provide soundtrack-like support for discord servers. Information about the tools and even how to run your own bot can be found below. This Music bot provides you self-hosted capabilities similar to what Groovy and Rythm did (before YouTube shut them down). This project will slowly build items over time and accept pull request to update the code or add new features.
To Run the music bot, you can run the docker image deployed to this repository with the following command:
docker run -d \
--name music-bot \
-e BOT_TOKEN=<YOUR BOT TOKEN> \
-v </path/to/configs>:/app/resources/configs/ \
-p 8080:8080
ghcr.io/ddellspe/music-bot Without the configs folder mapped, the bot will not start up, you must take the
music_config.json.example, move it to music_config.json in
the same folder and update the guildId, chatChannelId and prefix as necessary.
If you plan to host multiple discords in a single file, the config supports an array of configuration objects.
The current configuration of the config file is:
[
{
"guildId": 123456789,
"chatChannelId": 234567891,
"prefix": "<DESIRED_PREFIX>"
}
]You can get the ids in Discord by enabling "developer" mode in settings => Advanced => Developer Mode.
Once developer mode is enabled, right-clicking on channels and discord servers (guilds) will provide a "Copy ID" option.
IDs should be the numeric value, the prefix must be a string.
Your prefix may be any string, but suggestions would be "!", ">", or something like "bot ".
This prefix will have to prefix all commands (below) via chat message.
Below is the listing for all commands, examples will be presented using the "!" prefix as an example.
All text-based commands must be sent from the channel aligning with the chatChannelId in the configuration.
If the message comes from any other message channel (chat channel) it will be ignored.
| Command |
|---|
!ping |
This is a command to test that the bot is up or alive, and that it's present in your Discord server.
When you request !ping the bot will respond in the channel with Pong.
| Command |
|---|
!end |
This commands stops the audio portion of the bot.
To initiate this command, in the specified chat channel, send the message !end.
Upon calling of this command, the bot (if running) will stop all audio, clear the queue, and then shut down.
When shutting down, the bot will leave the voice channel that it is connected to.
If the music bot isn't already running, nothing will happen.
| Command |
|---|
!silence |
This command stops the audio playback for the bot.
To initiate this command, in the specific chat channel send the message !silence.
Upon calling of this command, the bot (if running) will stop all audio, and clear the queue.
This does not end the bot's presence in the voice channel.
Any call to add new songs will immediately start their playing.
| Command |
|---|
!play <audio url> |
This command adds a song to the internal bot playlist and begins playback. If a playlist URL is supplied, only the targeted or first track of the playlist will be added (with a notice mentioning how to add the entire playlist instead). If there is no audio currently playing, playback will begin as soon as song resolution takes place. If there is audio currently playing, the song will be added to the end of the internal playlist (indicating its queue position). There is currently no support for generic searching via keyboard at this point, so you must provide a full url. When the bot finds the appropriate track to go along with the url, it will respond that it's been added to the queue. There will also be track information (Title, Artist, Duration, and Queue Position) available in the response from the command. If the track isn't accessible or not found, the bot will provide an error response indicating such.
| Command |
|---|
!playall <playlist url> |
This command adds all songs from a full playlist to the end of the internal bot playlist and begins playback.
If there is no audio currently playing, playback of the first song will begin immediately, and subsequent songs will be queued.
If there is audio currently playing, all tracks of the playlist will be queued at the end of the queue.
The bot will respond with a playlist summary showing the queue position range (e.g. 50 - 99) and a preview of the first 5 tracks numbered from their actual queue positions.
If the track isn't accessible or not found, the bot will provide an error response indicating such.
| Command |
|---|
!fplay <audio url> |
This command adds a single song to be played immediately. If a playlist URL is supplied, only the targeted or first track will be played. Any existing playlist items are queued immediately after the forced track. If there is no audio currently playing, playback will begin as soon as song resolution takes place. If there is audio currently playing, the song will begin playing immediately. There is currently no support for generic searching via keyboard at this point, so you must provide a full url. When the bot finds the appropriate track to go along with the url, it will respond that it's playing. There will also be track information (Title, Artist, Duration) available in the response from the command. If the track isn't accessible or not found, the bot will provide an error response indicating such.
| Command |
|---|
!fplayall <playlist url> |
This command forces the first track of a playlist to play immediately, and queues all subsequent tracks of the playlist at the front of the queue. The bot will respond with a playlist summary and a preview of the first 5 tracks. If the track isn't accessible or not found, the bot will provide an error response indicating such.
| Command |
|---|
!interrupt <audio url> |
This command adds a single song to be played immediately with the currently playing song being re-queued. If a playlist URL is supplied, only the targeted or first track will be played. If there is no audio currently playing, playback will begin as soon as song resolution takes place. If there is audio currently playing, the song will begin as soon as song resolution takes place. The currently playing song will be re-queued after the interrupted song. There is currently no support for generic searching via keyboard at this point, so you must provide a full url. When the bot finds the appropriate track to go along with the url, it will respond that it's playing. There will also be track information (Title, Artist, Duration) available in the response from the command. If the track isn't accessible or not found, the bot will provide an error response indicating such.
| Command |
|---|
!skip |
This command ends the current song, if there is another song in the queue and moves to the next song.
To initiate this command, in the specific chat channel send the message !skip.
Upon calling of this command, the bot (if running) will skip to the next track.
If there is no next track in the queue, it will send a message indicating that there is no track to skip to.
If there is a next track, the bot will skip to the next track and the information for that track will be shown.
| Command |
|---|
!list [limit] |
This command displays the upcoming tracks in the playlist queue.
The currently playing track is always shown first, marked with a ▶ symbol and a (Currently Playing) label, but is not assigned a queue number.
Queued tracks are numbered starting from 1.
If a custom limit is not provided, the command defaults to showing up to 5 tracks.
To request a custom number of tracks, you can append a limit (e.g. !list 10).
Each track in the list displays its Title, Artist, Duration, and a clickable Markdown hyperlink to the video/audio source.
If there are more tracks in the queue than the displayed limit, the footer will summarize how many additional tracks are queued.
If the queue and player are empty, the bot will respond with an embed indicating the playlist is empty.