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.
- Website: darrennathanael.com
- Twitter: @darrennathans