-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Improve documentation and comments #18
Comments
And variables like “player.position” should only be readonly. |
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. |
I cannot agree with it, As |
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.
/**
/
declare class SlashCommandBuilder {
/*
/
readonly name: string;
/*
/
readonly name_localizations?: LocalizationMap;
/*
/
readonly description: string;
/*
/
readonly description_localizations?: LocalizationMap;
/*
*/
Other context
No response
The text was updated successfully, but these errors were encountered: