lavacord/Lavacord

Idea: Have a region property on LavalinkNode for sorting.

Gaeta opened this issue · 12 comments

Gaeta commented

What about a function where we can we enter a region like "eu" and it will pick the best eu feature.

Or just a variable we can put on the node like "eu" or "us" so we can do a filter?

I'll think about it

Gaeta commented

what about a extra pram with {} in it so we can leave extra data inside like shuffle etc without it getting deleted?

@dream-cake could you elaborate?

Gaeta commented

Example the state variable in player but instead have an extra one named extra where the user can store extra dataa.

{
...
state: {volume: 0, ...},
extra: {}
}
Gaeta commented

also this extra could be used for nodes to store extra data about them like region etc

The state idea wont happen, thats not what state is used for. its actually something lavalink sends over and I just add the volume to it, As i needed somewhere to set it

I'm pretty sure he isn't talking about modifying state, but adding an extra on the same level instead, so we can store metadata about the node

I agree, a state implies something temporary, which a region wouldn't fit into.

May I suggest using the id property?
if there is a good reason why that doesn't work, I'll add a region property.

I could see a use case in large bots where nodes are dynamically created and destroyed by a load balancer when required, and an ID could just be a numerical value, or something random, and so that could not be relied on, the region however, would be the same.

I think in general, having a property that allows us to set extra information would be useful.

@BennyDiscord Feel free to pr it,

This is now available in #52