galnir / Master-Bot

A Discord music bot and dashboard with slash commands, playlist support, Spotify, music quiz, saved playlists, lyrics, gifs and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Another way to host lavalink for hosting bot on Heroku (Discord.js v12)

kiyoshikuncool opened this issue · comments

Hi everyone, I've found another way to host the lavalink by using repl.it

Install automatically
Host lavalink on Repl.it

Instruction for lavalink

  • Clicking the button above, signing up or logging in and waiting for repl.it creates your lavalink project
  • Once everything is done, click the "Run" button and keep waiting for it until you see the link on the right corner like mine

Screenshot
Notes: Your lavalink repl.it's link will like this: https://lavalink-replit."yourusername".repl.co

Setting bot

  • The default port to connect is 443 and the default password is maybeiwasboring
  • Open your bot project folder, click on config.json:

At "lava_host", copy your link on repl.it and you need to remove https:// for bot working
At "lava_pass", copy the default password maybeiwasboring

➤ It should be like this:
Screenshot

  • Next, click on ExtendedClient.js in utils folder. Looking at line number 22 and adjusting like me:
    Screenshot

Notes

  • You can’t change the lavalink port! It will default to 443 due to how replit work.
  • Replit is using https so we need to add secure: true to make the bot work.
  • Make sure you run the lavalink before you run the bot!!

Youtube tutorial

↪ Link: https://www.youtube.com/watch?v=bznq-P0Ovzk
Say thanks to kakarot for making it! 😍

How to keep the replit on with freshping

Go to freshping, and set HTTP request to your discord bot I.e. https://lavalink-replit."yourusername".repl.co/metrics and it should show that it's online.
freshpingisbetterthanuptimerobot


It's all done. Thanks for reading my instruction ☺☺
Instruct by KiyoshiKunCool⭐ from Vietnam with love❤
#KiyoshiKunCool

@JackW25 This is for you, my friend :3

@JackW25 This is for you, my friend :3

Thank you so much! I got everything working okay except I get this error with lavalink:

ERROR 328 --- [ XNIO-1 task-1] l.server.io.HandshakeInterceptorImpl : Authentication failed from /172.18.0.1:57894

Was wondering if you know anything about that,
aside from that issue though, everything is working as it should, thank you again!

@JackW25 You need to run the bot and it'll connect to lavalink on replit. If you connect successful, the replit console should show the handle of your discord bot (I use /play to play my favourite song :3)

Screenshot

Note: It'll show Authentication failed from... per an hour because of the freshping mechanism. So, feel free to use it, my friend ^^
#KiyoshiKunCool

I still seem to get the error

Error: Error: connect ETIMEDOUT 35.186.245.55:433
at Connection._onerror (C:\Users\user\Documents\GitHub\Rainure\node_modules\lavaclient\dist\lib\node\Connection.js:127:33)
at WebSocket.onError (C:\Users\user\Documents\GitHub\Rainure\node_modules\ws\lib\event-target.js:220:18)

Aside from that everything seems to be as it should in replit console, I'm not sure if its possible i have something wrong in the application.yml

Thanks again for your help mate, I really do appreciate it

commented

I still seem to get the error

Error: Error: connect ETIMEDOUT 35.186.245.55:433 at Connection._onerror (C:\Users\user\Documents\GitHub\Rainure\node_modules\lavaclient\dist\lib\node\Connection.js:127:33) at WebSocket.onError (C:\Users\user\Documents\GitHub\Rainure\node_modules\ws\lib\event-target.js:220:18)

Aside from that everything seems to be as it should in replit console, I'm not sure if its possible i have something wrong in the application.yml

Thanks again for your help mate, I really do appreciate it

Make sure you run the Lavalink server before running the bot

I still seem to get the error
Error: Error: connect ETIMEDOUT 35.186.245.55:433 at Connection._onerror (C:\Users\user\Documents\GitHub\Rainure\node_modules\lavaclient\dist\lib\node\Connection.js:127:33) at WebSocket.onError (C:\Users\user\Documents\GitHub\Rainure\node_modules\ws\lib\event-target.js:220:18)
Aside from that everything seems to be as it should in replit console, I'm not sure if its possible i have something wrong in the application.yml
Thanks again for your help mate, I really do appreciate it

Make sure you run the Lavalink server before running the bot

Hey there, seems to work all good, if it's possible to run this by you quickly, I seem to get this error whenever I try and start the bot,

/app/node_modules/lavaclient/dist/lib/cluster/Cluster.js:23
this.userId ??= user && (0, Utils_1.getId)(user);
^^^
SyntaxError: Unexpected token '??='
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object. (/app/node_modules/lavaclient/dist/index.js:15:14)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

Thanks again, and sorry for the bother

commented

I still seem to get the error
Error: Error: connect ETIMEDOUT 35.186.245.55:433 at Connection._onerror (C:\Users\user\Documents\GitHub\Rainure\node_modules\lavaclient\dist\lib\node\Connection.js:127:33) at WebSocket.onError (C:\Users\user\Documents\GitHub\Rainure\node_modules\ws\lib\event-target.js:220:18)
Aside from that everything seems to be as it should in replit console, I'm not sure if its possible i have something wrong in the application.yml
Thanks again for your help mate, I really do appreciate it

Make sure you run the Lavalink server before running the bot

Hey there, seems to work all good, if it's possible to run this by you quickly, I seem to get this error whenever I try and start the bot,

/app/node_modules/lavaclient/dist/lib/cluster/Cluster.js:23 this.userId ??= user && (0, Utils_1.getId)(user); ^^^ SyntaxError: Unexpected token '??=' at wrapSafe (internal/modules/cjs/loader.js:1001:16) at Module._compile (internal/modules/cjs/loader.js:1049:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:93:18) at Object. (/app/node_modules/lavaclient/dist/index.js:15:14) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)

Thanks again, and sorry for the bother

What Node version are you running?
node -v

I still seem to get the error
Error: Error: connect ETIMEDOUT 35.186.245.55:433 at Connection._onerror (C:\Users\user\Documents\GitHub\Rainure\node_modules\lavaclient\dist\lib\node\Connection.js:127:33) at WebSocket.onError (C:\Users\user\Documents\GitHub\Rainure\node_modules\ws\lib\event-target.js:220:18)
Aside from that everything seems to be as it should in replit console, I'm not sure if its possible i have something wrong in the application.yml
Thanks again for your help mate, I really do appreciate it

Make sure you run the Lavalink server before running the bot

Hey there, seems to work all good, if it's possible to run this by you quickly, I seem to get this error whenever I try and start the bot,
/app/node_modules/lavaclient/dist/lib/cluster/Cluster.js:23 this.userId ??= user && (0, Utils_1.getId)(user); ^^^ SyntaxError: Unexpected token '??=' at wrapSafe (internal/modules/cjs/loader.js:1001:16) at Module._compile (internal/modules/cjs/loader.js:1049:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:93:18) at Object. (/app/node_modules/lavaclient/dist/index.js:15:14) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
Thanks again, and sorry for the bother

What Node version are you running? node -v

v16.13.0

@JackW25 Did you add node into package.json (if you're host the bot on heroku) like this?
Screenshot

@JackW25 Did you add node into package.json (if you're host the bot on heroku) like this? Screenshot

That managed to fix the issue, thank you!

Thank you @galnir and @kiyoshikuncool for your help, I know you guys are probably tired of all the issues I've been having lol, but thank you all for the help, the new Lavalink update is awesome and I am excited to see what more this project will have.

I now feel happy that my issue is solved, you may reclose the issue if you wish.

Thanks again,
Jack

Glad to help you, @JackW25 :3 ☺
#KiyoshiKunCool

commented

@kiyoshikuncool Thanks for taking the time to write this helpful guide!
I'm pinning this issue so more people can benefit from it :)

when i start the bot, i see this error: Error: Error: connect ECONNREFUSED 35.186.245.55:2333
Снимок экрана от 2022-02-05 04-36-52

commented

@liloko Make sure the Lavalink server runs before you attempt to run the bot