Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kiyoshikuncool opened this issue Jan 1, 2022 · 14 comments
Closed
Labels
enhancement New feature or request

Comments

@kiyoshikuncool
Copy link
Contributor

kiyoshikuncool commented Jan 1, 2022

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

@kiyoshikuncool kiyoshikuncool added the enhancement New feature or request label Jan 1, 2022
@kiyoshikuncool
Copy link
Contributor Author

@JackW25 This is for you, my friend :3

@JackW25
Copy link

JackW25 commented Jan 1, 2022

@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!

@kiyoshikuncool
Copy link
Contributor Author

@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

@JackW25
Copy link

JackW25 commented Jan 2, 2022

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

@galnir
Copy link
Owner

galnir commented Jan 2, 2022

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

@JackW25
Copy link

JackW25 commented Jan 2, 2022

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

@galnir
Copy link
Owner

galnir commented Jan 2, 2022

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

@galnir galnir reopened this Jan 2, 2022
@JackW25
Copy link

JackW25 commented Jan 3, 2022

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

@kiyoshikuncool
Copy link
Contributor Author

kiyoshikuncool commented Jan 3, 2022

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

@JackW25
Copy link

JackW25 commented Jan 3, 2022

@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

@kiyoshikuncool
Copy link
Contributor Author

kiyoshikuncool commented Jan 3, 2022

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

@galnir
Copy link
Owner

galnir commented Jan 3, 2022

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

@galnir galnir pinned this issue Jan 3, 2022
@kiyoshikuncool kiyoshikuncool changed the title Another way to host lavalink for hosting bot on Heroku Another way to host lavalink for hosting bot on Heroku (Discord.js v12) Jan 20, 2022
@liloko
Copy link

liloko commented Feb 5, 2022

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

@galnir
Copy link
Owner

galnir commented Feb 5, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants