A free, open-source JavaScript music bot created with discord.js and discord-player. Complete (45+ commands) with persistent settings, effects, filters, auto-play, DJ-roles, and so much more.
A free, open-source JavaScript music bot created with discord.js
and discord-player
. Complete (45+ commands) with persistent settings, effects, filters, auto-play, DJ-roles, and so much more.
YouTube • Spotify • SoundCloud • Apple Music • Vimeo • ReverbNation • Discord Attachments
This project was created and open-sourced by Mirasaki Development. That means it's publicly available for anyone to grab and use in any way you want (MIT licensed). This project will never be monetized, every feature will always be free. All we need to keep adding new functionality and modules is some GitHub stars. Join the absolute legends below by clicking that Star button in the top-right of your screen, it doesn't cost you anything and means the world to us ❤️
/pause
/skip-to
/swap-songs
Don't take our word for it, though. Instead, you should just see for yourself in our support server.
npm install ffmpeg-static
- this is a last resort and not recommendedThe quickest and easiest way to host/use this bot is by deploying it inside of a Docker container.
A docker compose file is included for your convenience
git clone https://github.com/Mirasaki/mirasaki-music-bot.git
cd mirasaki-music-bot
/.env.example
to .env
and provide your environmental variables
Expected path argument to be of type string
- check out this timestamped video
/config.example.js
to config.js
and provide your bot configurationdocker build --tag mirasaki-music-bot .
docker run -it --env-file .env --name my-mirasaki-music-bot mirasaki-music-bot
You can also clone this repository or download a release, and host the project directly. You will need Node/NodeJS (Be sure to check the box that says "Automatically install the necessary tools" when you're running the installation wizard)
git clone https://github.com/Mirasaki/mirasaki-music-bot.git
and skip to step 4 if you have Git installedzip
or zip.gz
source codenpm install
to install all dependencies/.env.example
to .env
and configure your environmental variables
Expected path argument to be of type string
- check out this timestamped video
/config.example.js
to config.js
and go through your bot configurationnode .
to start the application, or alternatively:
npm run pm2:start
to keep the process alive in the background with PM2, suitable for production environments. (npm i -g pm2
to install)npm run start:dev
if you have nodemon
installed for automatic restarts on changes, suitable for development environmentsAll configuration is done in /config.js
. Multiple Discord servers are supported. The configuration file is created during the installation and usage steps. Below is detailed information on what the settings do.
{
// Note: all the default# properties all configurable by commands
// This is here so that you can configure everything in one go
// without having to figure out different commands,
// if you're not comfortable editing this, use the commands
// Note: default# properties only take affect the first time
// playback is initialized in your server/guild
// Between 0 and 100
// 100 is obnoxiously loud and will f*** your ears
defaultVolume: 5,
// The default repeat mode
// 0 - Off | Don't repeat
// 1 - Track | Repeat current track, always - until skipped
// 2 - Queue | Repeat the entire queue, finished songs get added back at the end of the current queue
// 3 - Autoplay | Autoplay recommended music when queue is empty
//
// 3 = 24/7 autoplay/continuous radio if uninterrupted - only use if you have
// bandwidth for days
defaultRepeatMode: 0,
// Amount of seconds to stay in the voice channel
// when playback is finished
// Default: 2 minutes
defaultLeaveOnEndCooldown: 120,
// Should the bot leave the voice-channel if there's no other members
defaultLeaveOnEmpty: true,
// Time amount of seconds to stay in the voice channel
// when channel is empty/no other members aside from bot
// Only active when leaveOnEmpty is true
// Default: 2 minutes
defaultLeaveOnEmptyCooldown: 120,
// When true, will create a thread when the voice session is first initialized
// and continue to send music/queue events in that thread instead of flooding
// the channel
defaultUseThreadSessions: true,
// When true, and defaultUseThreadSessions is true, will only allow commands involving
// the current session to be used in the created session Thread channel
defaultThreadSessionStrictCommandChannel: true,
// Plugins/Music source extractors
plugins: {
fileAttachments: true,
youtube: true,
soundCloud: true,
appleMusic: true,
vimeo: true,
reverbNation: true,
// To disable Spotify:
// spotify: false,
spotify: {
clientId: process.env.SPOTIFY_CLIENT_ID,
clientSecret: process.env.SPOTIFY_CLIENT_SECRET
},
},
// Bot activity
presence: {
// One of online, idle, invisible, dnd
status: 'online',
activities: [
{
name: '/play',
// One of Playing, Streaming, Listening, Watching
type: 'Listening'
}
]
},
// Permission config
permissions: {
// Bot Owner, highest permission level (5)
ownerId: '290182686365188096',
// Bot developers, second to highest permission level (4)
developers: [ '' ]
},
// The Discord server invite to your Support server
supportServerInviteLink: 'https://discord.gg/mirasaki',
// Additional permissions that are considered required when generating
// the bot invite link with /invite
permissionsBase: [
PermissionsBitField.Flags.ViewChannel,
PermissionsBitField.Flags.SendMessages,
PermissionsBitField.Flags.SendMessagesInThreads
]
}
This is not the permission level required to execute actions or run commands, like User, Moderator or Administrator
Invite the bot to your server by navigating to the following URL (replace YOUR_CLIENT_ID
with DISCORD_CLIENT_ID
from the /.env
file):
https://discord.com/api/oauth2/authorize?client_id=YOUR_CLIENT_ID&permissions=0&scope=bot%20applications.commands
Any command can be used without any Discord permissions, as long as the bot is invited to your server with the bot
and applications.commands
scopes. You can use the template url above, or alternatively, generate an invite link in the Discord Developer Portal (Your App > OAuth2 > URL Generator > scopes: bot + applications.commands
)
For the bot to be able to join your Voice Channel, it will need the View Channel
, Connect
and Speak
permissions.
The bot needs the View Channel
, Send Messages
, and Embed Links
in any channel where playback is initialized to be able to send event notifications to that channel.
These are permission levels that are used internally by the bot to determine the permission level of any given user and determine which commands they can use. Available permissions levels are:
You can modify Moderators, Administrators, Developers and Bot Owners in
/config.js
, this is optional
Kick Members
and Ban Members
is considered a ModeratorAdministrator
is considered an Administrator internally and will have access to powerful commands like /clear-queue
/eval
and /exec
. This permission level can do almost everything, including evaluating arbitrary code on your host machine - use with caution!You can modify required permission levels to execute commands in the command files by setting the permLevel property. Let's take a look at an example /src/commands/
file:
module.exports = new ChatInputCommand({
// Inside of the ChatInputCommand({
// Can be set to User, Moderator, Administrator, Server Owner, Developer, Bot Owner
// Support IntelliSense/auto-complete
permLevel: 'Administrator',
// ... other properties
run: async (client, interaction) => {
// The commands #run/execute function
}
});
Join our support server if you need any further assistance, have feature suggestion or have any other feedback
Contact me personally for legal enquiries at: [email protected]
Open source, self-hosted, and MIT licensed, meaning you're in full control.