Skip to main content
Version: v2.1.x

Installation on Linux / Windows

Prerequisites

Create a Discord Application

  • go to the Discord Developer portal
  • create a new application + bot
  • create a bot invite link using it's client id here
  • save the bot token for later
  • Set the Privileged gateway intent to allow MESSAGE CONTENT INTENT
discord_invite_permissions imagediscord_gateway_intents image

Install Node.js

Installation

Clone repository

You can clone the latest version of the source code using this command:

git clone -b v2.1.1 https://github.com/hmes98318/Music-Disc.git

or click here to download

Install the dependencies

Use this command to install all dependencies:

npm install

Configure node

Edit the nodelist.json file to add a Lavalink node.

You can refer to this document for detailed information.

[
{
"id": "Node 1",
"hostname": "localhost",
"port": 2333,
"password": "youshallnotpass"
}
]
note

This bot requires Lavalink nodes with version 3.7.x to run properly.

Configure environment variables

Edit the .env file.

# Discord Bot Token
BOT_TOKEN = "your_token"

# Admin of the bot (User ID)
# OAUTH2 mode requires setting BOT_ADMIN, BOT_CLIENT_SECRET value
BOT_ADMIN = ""
BOT_CLIENT_SECRET = ""

# Bot settings
BOT_NAME = "Music Disc"
BOT_PREFIX = "+"
BOT_STATUS = "online"
BOT_PLAYING = "+help | music"
BOT_EMBEDS_COLOR = "#FFFFFF"


# Volume settings
DEFAULT_VOLUME = 50
MAX_VOLUME = 100

# Auto leave channel settings
AUTO_LEAVE = true
AUTO_LEAVE_COOLDOWN = 5000

# Show voice channel updates
DISPLAY_VOICE_STATE = true


# Web dashboard settings
ENABLE_SITE = true
SITE_PORT = 33333
SITE_LOGIN_TYPE = "USER" # "USER" | "OAUTH2"

# USER mode settings
SITE_USERNAME = "admin"
SITE_PASSWORD = "000"

# OAUTH2 mode settings
SITE_OAUTH2_LINK = "" # Your OAuth2 authentication link
SITE_OAUTH2_REDIRECT_URI = "http://localhost:33333/login" # Redirect link after OAuth2 authentication is complete


# Local Lavalink node
ENABLE_LOCAL_NODE = false
LOCAL_NODE_AUTO_RESTART = true
# LOCAL_NODE_DOWNLOAD_LINK = ""

Start the Bot

Running the script

npm run start

Running with pm2

If you are using the PM2 process manager to run this bot, please compile the source code using this command first.

npm run build

After compiling, use this command to start the bot.

pm2 start ./dist/src/index.js --name "Music-Disc"