lavalink music bot base in shoukaku and discord.js v14
Lavamusic is a Discord music bot that uses Discord.js, Shoukaku, and TypeScript.
Invite Lavamusic
ยท
Report Bug & Request Feature
(Require: LavaLink v4.1.x)
Note: You need to install the plugins to use these sources
To Setup a Lavalink server on Windows, Linux, or Replit, Click Here.
#support
channel.Before starting with the installation, you need to have the following:
git clone https://github.com/appujet/lavamusic.git
cd lavamusic
npm i
TOKEN = "" # Your bot token.
CLIENT_ID = "" # Your bot's client ID (If this value is left blank, bots cannot be invited using /invite or /about commands.).
PREFIX = "!" # Your prefix.
OWNER_IDS = ["",""] # Your discord id (You can add multiple ids.).
GUILD_ID = "" # Your server ID (If you want to use the for single server).
PRODUCTION = "true" # true for production.
BOT_STATUS = "online" # Your bot status (online, dnd, idle, invisible or offline).
BOT_ACTIVITY_TYPE = 0 # Activity type is a number from 0 to 5. See more here: https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
BOT_ACTIVITY = "Lavamusic" # Your bot activity
DATABASE_URL = "" # Your database url (If you want to use sqlite, then you can leave it blank.).
AUTO_NODE = "false" # true for auto node. It is gave from lavainfo-api (https://lavainfo-api.deno.dev).
LAVALINK_URL = "localhost:2333" # Your Lavalink url (If auto node is true, then you can leave it blank)
LAVALINK_AUTH = "youshallnotpass" # Your Lavalink password (If auto node is true, then you can leave it blank.).
LAVALINK_NAME = "Lavamusic" # Your Lavalink name (If auto node is true, then you can leave it blank.).
LAVALINK_SECURE = "false" # true for secure Lavalink (If auto node is true, then you can leave it blank.).
SEARCH_ENGINE = "ytsearch" # ytsearch (YouTube Search), spsearch (Spotify Search), scsearch (SoundCloud Search) or ytmsearch (YouTube Music Search).
MAX_PLAYLIST_SIZE = "100" # Max playlist size.
MAX_QUEUE_SIZE = "100" # Max queue size.
KEEP_ALIVE = "false" # true for keep alive in https://replit.com
LOG_CHANNEL_ID = "" # If you enter this, you will be able to receive the status of Lavalink nodes and guild join/leave logs through the corresponding channel.
npm run db:push
npm run db:migrate
If you are using Windows, click run.bat on Windows explorer.
npm start
Generate an invite link for your bot and invite it to your server using the Discord Developer Portal or using Permissions Calculator.
This section assumes you have Docker and Docker Compose installed and running correctly. Download the docker-compose.yml file in a separate folder like lavamusic. Edit docker-compose.yml and make sure to set the following variables: Your .env file should look like this or you can use the .env.example file.
TOKEN="." # Your bot token and remember, don't show everyone your bot token
PREFIX="!" # Your prefix
OWNER_IDS=["859640640640640640","859640640640640640"] # Your discord id, you can add multiple ids
GUILD_ID="859640640640640640" # Your server ID (if you want to use it for a single server)
PRODUCTION="true" # "true" for production
For more information how to fill all the variables go to this page. You do not need to edit anything like the LAVA_LINK_URL, LAVA_LINK_AUTH, LAVA_LINK_NAME, LAVA_LINK_SECURE, DATABASE_URL, and the ports unless you know what you're doing. After saving your changes you can open a terminal and go to the same location as the docker-compose.yml file. Then run the following:
docker-compose up -d
The above command will start all your services and your bot should be up and running! To update, you only have to type the following:
docker-compose up --force-recreate --build -d
image prune -f
You can automate this by using Watchtower. The following should be sufficient:
docker run --detach \
--name watchtower \
--volume /var/run/docker.sock:/var/run/docker.sock \
--restart on-failure \
containrrr/watchtower --cleanup
Do note that the bot will restart itself to update to the latest!
A tutorial has been uploaded on YouTube. Watch it by clicking here.
Thank you for your interest in contributing to Lavamusic! Here are some guidelines to follow when contributing:
Distributed under the GPL-3.0 license. See for more information.
Do you like this project? Support it by donating!