@ernest05/lavalink-js

1.0.1 • Public • Published

Lavalink.js

Lavalink.js is a JavaScript wrapper wich you can use with your Discord.js bot. It uses the Lavalink technology to broadcast music, so you need Java SE 11 installed in your machine.

First of all, I would to thank Matthieu#2050, a friend and a hobbyist developer wich helped me for implementing the websocket and for fixing some bugs. To thanks them, you can visit his website: Matthieu Dev :D

Wrapper installation:

First of all you have to install this module on your projet if you want to use it:

# Using Yarn:
yarn add lavalink.js

# Or using NPM:
npm install lavalink.js

Java JDK installation:

Let's take care about the Java part currently! The Java JRE 11 or higher shoud be installed on your machine. If you have an old version of the Java JRE od JDK please uninstall it and reboot your machine. Then open your internet browser and paste this URL to the address bar: Java SE downloads. You should then arrive on this webpage: Java SE downloads webpage Scroll down to find download versions, and choose the Java SE 11 (LTS) version for stable, and Java SE 13 version for current. Next click on JDK download. Then download the adapted setup for your machine, and install it by following indicated instructions, or by reading docs for Linux/Unix systems.

Note that is you're using Windows operating system you have to add the Java JDK to path to use it directly from any terminal. For it please read this: How to set JAVA_HOME in Windows 10.

Lavalink server installation:

Create on your project root directory a folder named 'lavalink'. Next download the Lavalink server into it. Then you have to create a file in your code editor, always in the same directory, and named 'application.yml'. This file allow the Lavalink server configuration, by providing broadcasting settings and by providing server host, port and password. Complete this file by pasting this configuration example. Save the file then.

Lavalink server launching:

To launch the Lavalink server please ensure you are in it's directory.Before to launch your application, if it needs Lavalink to work, launch the Lavalink server by following the instructions bellow.

# Locally:
java -jar Lavalink.jar

# With PM2:
pm2 start java --name="Lavalink" -- -jar Lavalink.jar

Use the wrapper for your Discord.js bot:

To use lavalink.js and Lavalink on your Discord bot, you have a provided example on the repository, at example/discord.js/client.js. The example bot include all wrapper features for the moment, and will be updated when the wrapper will be.

An opensource music bot using lavalink.js is planned soon ^^ In the meantime, please wait and the bot will arrive :D

Need help?

If you need help, you can join the support server and ask for it, somebody will answer if they can help, don't worry 😉

An issue, a bug?

If you encounter an issue, a bug, either you can join the support server (the link is above), or you can open an issue on GitHub. Thanks for contributing to the module!

Readme

Keywords

none

Package Sidebar

Install

npm i @ernest05/lavalink-js

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

35 kB

Total Files

9

Last publish

Collaborators

  • ernest05