Code Monkey home page Code Monkey logo

lavalink-music-bot's Introduction

Lavalink Music Bot

I made this bot because, well, groovy was taken down, so I made my own clone.

It's written in TypeScript and Discord.js V13, uses Lavalink for stable audio playback and erela.js as It's wrapper, it also uses the Sapphire Framework for Discord bots. (Note that this is a personal project, don't expect this code to be perfect and maybe it isn't a good idea to run it in a production environment)

Requirements

  1. Node.js 16.6.x
  2. Java version 13 or higher (For Lavalink).
  3. Lavalink (Get it from here)
  4. Spotify API Client ID, and Client Secret. (Get them from here)
  5. A Discord bot token

Self-hosting guide

This bot is pretty easy to set up, here's the guide:

  1. Clone this repo:
git clone https://github.com/iliveinsideyourwalls/lavalink-music-bot.git
  1. cd into de directory.
  2. Install dependencies:
npm install
  1. Change the name of the src/.env.example file to .env.

  2. Populate your .env file:

# Bot essentials
DISCORD_TOKEN=<Bot token>
OWNERS=<Your Discord ID>
PREFIX=<Some prefix>

# Default lavalink cradentials
LAVALINK_HOST=localhost
LAVALINK_PORT=2333
LAVALINK_PASSWD=youshallnotpass

# For spotify support
SPOTIFY_CLIENT_ID=<Your app-s client id>
SPOTIFY_CLIENT_SECRET=<Your app's client secret>

# You can put whatever in these
CLIENT_NAME=<Some name>
CLIENT_VERSION=<Some version>

# The default player's volume
DEFAULT_VOLUME=<Some value (I do not recommend more than 15)>
  1. Now you have to set-up a Lavalink node, Get lavalink from here.

  2. Make a folder called lavalink_server wherever you want (I recommend that you put it in the same folder as where you cloned the repo)

  3. Put the Lavalink executable in the folder you just made along with a application.yml file.

  4. Run lavalink (Note that you must run the command in the same folder as the application.yml file):

java -jar <path/to/lavalink>/Lavalink.jar
  1. Now build the bot:
npm run build
  1. Run the bot:
node dist/index.js

If you see something like this then the bot is ready to go, now all there's left is inviting your bot to your server.

lavalink-music-bot's People

Contributors

groovygab avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.