lavacord / Lavacord

A easy to use Lavalink client that can be used with any discord api wrapper
Apache License 2.0
79 stars 21 forks source link

Idea: Have a region property on LavalinkNode for sorting. #21

Closed Gaeta closed 4 years ago

Gaeta commented 4 years ago

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?

MrJacz commented 4 years ago

I'll think about it

Gaeta commented 4 years ago

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

MrJacz commented 4 years ago

@Dream-cake could you elaborate?

Gaeta commented 4 years ago

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 4 years ago

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

MrJacz commented 4 years ago

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

pedrofracassi commented 4 years ago

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

Skye-31 commented 4 years ago

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

MrJacz commented 4 years ago

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

Skye-31 commented 4 years ago

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.

MrJacz commented 4 years ago

@BennyDiscord Feel free to pr it,

Skye-31 commented 4 years ago

This is now available in #52