KagChi / noteblock

A open-source music bot based on lavalink.
GNU General Public License v3.0
115 stars 110 forks source link

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

Closed sinkaroid closed 2 years ago

sinkaroid commented 2 years ago

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

sinkaroid commented 2 years ago

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 https://github.com/KagChi/noteblock/pull/57#pullrequestreview-847660669, 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: @.***>

KagChi commented 2 years ago

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