Open AlexInCube opened 1 month ago
And variables like “player.position” should only be readonly.
it seems that milliseconds are used, but it is not written anywhere about it. For example in player.seek() method, the docs just say args is a "number".
It's assumed as Riffy has the same properties Lavalink Gives, And I expect User must have seen the Lavalink docs at least once. And usually position like this Have in ms as it's easier to convert later.
And variables like “player.position” should only be readonly.
I cannot agree with it, As player.position
needs to be updated everytime it changes and read-only is like constant in JS (cannot be updated again atleast for Number)
And variables like “player.position” should only be readonly.
I cannot agree with it, As
player.position
needs to be updated everytime it changes and read-only is like constant in JS (cannot be updated again atleast for Number)
okay, you can make player.position private, but user can player.get_position()
okay, you can make player.position private, but user can player.get_position()
If we do that, We'll also need a setter as well. So currently it serves both purposes.
Feature
I often don't understand what different methods or variables in a library do. I have to read the Riffy source code or use the debugger in the IDE to learn something.
Ideal solution or implementation
I suggest adding comments in the code to methods and variables.
For example: /* Represent in milliseconds current timeline position. / public position: number;
And by the way, everywhere where time is specified, it seems that milliseconds are used, but it is not written anywhere about it. For example in player.seek() method, the docs just say args is a "number".
Alternative solutions or implementations
This is example from Discord.js library, every property have description. So I don't even need to go to the documentation, the IDE can show me what the variable means.
/**
Other context
No response