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

fix(PlayCommand): handle when lavalink node not available #57

Merged
merged 2 commits into from
Jan 10, 2022
Merged

fix(PlayCommand): handle when lavalink node not available #57

merged 2 commits into from
Jan 10, 2022

Conversation

sinkaroid
Copy link
Contributor

Better checking first instead just throwing an error

Especially for Free lavalink server always 'on-off' everyday eg: replit.
It's raising Unable to connect after 5 attempts. and just throw error

Copy link
Owner

@KagChi KagChi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why dont just

const node = this.client.erela.leastUsedNodes.first()
if (!node || !node.connected) return /*  Your code here */

more simple if you do this

@KagChi KagChi changed the title perf(PlayCommand): handle no available nodes fix(PlayCommand): handle when lavalink node not available Jan 10, 2022
@sinkaroid
Copy link
Contributor Author

sinkaroid commented Jan 10, 2022 via email

@KagChi
Copy link
Owner

KagChi commented Jan 10, 2022

You mean leastUsedNodes.first() right? a much simpler, but i also want to tell my user when the music server are down / temporary offline. It's should keep to TextChannel#send, but with leastUsedNodes.first()?

On Mon, 10 Jan 2022 at 17:59, KagChi @.> wrote: @.* requested changes on this pull request. why dont just const node = this.client.erela.leastUsedNodes()if (!node || !node.connected) return```more simple if you do this — Reply to this email directly, view it on GitHub <#57 (review)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC6MUAPFT24U74LV7JVQRG3UVK32ZANCNFSM5LS6T3IA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.Message ID: @.***>

yep, thats just an example

@sinkaroid sinkaroid requested a review from KagChi January 10, 2022 12:27
@KagChi KagChi merged commit 89a34eb into KagChi:main Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants