Skip to content

Yuimusic discord bot

Last updated: June 7, 2023 | at 02:10 AM

๐Ÿšฆ Hosted

Run on Repl.it Remix on Glitch Run on Hop.io

๐Ÿš€ Yui`s Music

Yui`s is a Discord music bot that uses Discord.js, Shoukaku, Prisma Client (ORM) database (MongoDB), and TypeScript.

Invite Yui`s Music ยท Report Bug & Request Feature

๐Ÿ”ฅ Unique Features

  • Developed using Typescript and Discord.js v14
  • Advanced Music System
  • Customizable Prefix
  • Powerful Search Engine
  • 12 + Music Filters
  • Hybrid Command Handling (Slash and Normal Commands)
  • Highly Configurable
  • User-friendly and Easy to Use
  • 24/7 Music Playback
  • Playlist commands
  • Setup music channel

๐ŸŽถ Support Sources

๐Ÿ” Default Sources:

  • YouTube
  • SoundCloud
  • Twitch
  • Bandcamp
  • Vimeo
  • http

๐Ÿ”Œ Plugin Sources: (Require: LavaLink v3.6.x)

Note: You need to install the plugins to use these sources

Need Help with plugins? Join our Discord Server and ask in the #support channel

๐Ÿ“š Commands

Name: prefix | Description: Shows the bot's prefix.

Name: help | Description: Shows the help menu.

Options: command: The command you want to get info on.

Name: info | Description: Shows information about the bot.

Name: invite | Description: Sends the bot's invite link.

Name: ping | Description: Shows the bot's ping.

Name: clearqueue | Description: Clears the queue.

Name: join | Description: Joins the voice channel.

Name: leave | Description: Leaves the voice channel.

Name: nowplaying | Description: Shows the currently playing song.

Name: play | Description: Plays a song from YouTube or Spotify.

Options: song: The song you want to play.

Name: pause | Description: Pauses the current song.

Name: queue | Description: Shows the current queue.

Name: remove | Description: Removes a song from the queue.

Options: song: The song number.

Name: resume | Description: Resumes the current song.

Name: seek | Description: Seeks to a certain time in the song.

Name: shuffle | Description: Shuffles the queue.

Name: skip | Description: Skips the current song.

Name: skipto | Description: Skips to a specific song in the queue.

Name: stop | Description: Stops the music and clears the queue.

Name: volume | Description: Sets the volume of the player.

Options: number: The volume you want to set.

๐Ÿ”ง Requirements

Before starting with the installation, you need to have the following:

๐Ÿš€ Installation from source

  1. Clone the Lavamusic repository:

bash git clone https://github.com/lrmn7/yuimusic-bot-discord.git

  1. change the directory to Yuimusic
cd yuimusic
  1. Install the required packages:
npm install
  1. Set up your environment variables:

Create a .env file in the root directory of your project with the following variables:

TOKEN="." # Your bot token
PREFIX="!" # Your prefix
OWNER_IDS="742457036914294855" # Your ID
CLIENT_ID="1088032923443277824" # Your bot client ID
GUILD_ID="1088032923443277824" # Your server ID (if you want to use it for a single server)
PRODUCTION="true" # "true" for production
DATABASE_URL="mongodb+srv://Lrmn:xxxxxxxxxxxx" # Your MongoDB URL
LAVALINK_URL="yuimusic.hop.sh:443" # Your lavalink url
LAVALINK_AUTH="madewithstress" # Your lavalink password
LAVALINK_NAME="Yuimusic" # Your lavalink name
LAVALINK_SECURE= "true" # true for secure lavalink
  1. Generate the Prisma client:

If you using replit than read this:

go to prisma/schema.prisma and add engine type like this or remove // behind the engineType

generator client {
  provider = "prisma-client-js"
  engineType = "binary"
}

and then run this command

bash npx prisma generate

  1. Run the bot:

bash npm run start or npm start

  1. Invite the bot to your server:

Generate an invite link for your bot and invite it to your server using the Discord Developer Portal or using permissions calculator: https://discordapi.com/permissions.html

๐Ÿš€ Installation using docker-compose

This section assumes you have docker and docker-compose installed and is running correctly.

Download the Docker-Compose file in a seperate folder like lavamusic.

Edit the Docker-Compose file and make sure to edit the following variables:

TOKEN="." # Your bot token and remember, don't show everyone your bot token
PREFIX="!" # Your prefix
OWNER_IDS="742457036914294855" # Your ID
CLIENT_ID="1088032923443277824" # Your bot client ID
GUILD_ID="1088032923443277824" # 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 varialabes 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 your doing.

After saving your changes you can open a terminal and go to the same location as the docker-compose file. Then type 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!

  • Node.js Node.js
  • Discord.js Discord.js
  • Prisma Prisma
  • Lavalink Lavalink
  • MongoDB MongoDB
  • Docker Docker
  • Docker-Compose Docker-Compose

  • Fork the repository and create a new branch for your feature or bug fix.

  • Write clean and concise code that follows the established coding style.
  • Create detailed and thorough documentation for any new features or changes.
  • Write and run tests for your code.
  • Submit a pull request with your changes.

๐Ÿ” License

Distributed under the Apache-2.0 license License. See LICENSE for more information.