Darren
Darren's IoT corner

Follow

Darren's IoT corner

Follow
How to setup lavalink on repl.it

How to setup lavalink on repl.it

It’s really simple!

Darren's photo
Darren
·Nov 10, 2021·

1 min read

What are we doing today

In this tutorial we will be setting up lavalink server on repl.it

Source Code github.com/DarrenOfficial/lavalink-replit

  • Create a .replit file
language = "bash"
run =  "bash start.sh"
  • Then create a start.sh file, fill it in with
## install jabba and sht
echo Downloading Java 16...
curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash -s -- --skip-rc && . ~/.jabba/jabba.sh
## get java 16
jabba install zulu@1.16.0
echo Java is installed.
java -version
npm i
echo Donwloading lavalink jar...
node index

This will download java 16 and run index.js file

  • Next and final steps is to create the index.js it self
const { default: { stream } } = require("got");
const { createWriteStream } = require("fs"); 
const { execSync } = require("child_process");
const url = "https://cdn.darrennathanael.com/jars/Lavalink.jar"; // This is a custom version of lavalink maintained by me, if you want the original version just replace it with https://github.com/freyacodes/Lavalink/releases/
const start = () => {
    const download = stream(url).pipe(createWriteStream('Lavalink.jar'));
    download.on("finish", () => {
        execSync("java -jar Lavalink.jar", { stdio: "inherit" });
    });
};

start();

and thats it! press run and you should be good to go. If you want one click install check out

Source Code github.com/DarrenOfficial/lavalink-replit

Thank you for reading.

 
Share this