-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
docs(TextChannel): warning about setRateLimitPerUser NewsChannel #5403
Conversation
This fixes an issue with the docs where the rateLimitPerUser property and the setRateLimitPerUser method would show up for NewsChannel despite them not existing in it
Copy-pasting the entire text channel just to remove one property doesn't seem like the ideal solution for this at all.. If anything, the docs should explain that NewsChannels lack the property through some way |
From what I understood the docs take everything from the code itself so, if NewsChannel extends TextChannel, every property will have the exact same description. I know copy-pasting is not good practice but I think it's necessary in this case due to the already existent inconsistencies in the NewsChannel typings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Copy-pasting the entire text channel just to remove one property doesn't seem like the ideal solution for this at all.. If anything, the docs should explain that NewsChannels lack the property through some way"
this is not the best way of doing it, as such it shouldn't be merged.. i would say that its best if this PR were to get closed, and then maybe you or someone else can comeback with a better solution.
Do you know what solution would be better? I'd be glad to do that if there was one, I just couldn't find any other way to completely remove a property from a class in the docs without doing this :/ |
ill have to read though the code more and try and figure it out but the following was on to something.
I think updating the docs would go a long way to make this more clear, but I would encourage you to ask in the discord too. they might be able to help you out better or come up with a solution. |
I initially asked a support agent there and this is the solution he gave me so I'm not really sure who else to ask :/ |
@almostSouji do you think this would be possible? You seem to be the one that contributed to the guide most recently, so I'm assuming you would have a say in something like this. As for @ImRodry if the docs won't get updated, I would suggest closing this PR and opening a new issue instead. |
Sure thing, I'll wait for that guy's reply and if the docs can't be updated I'll do that, thank you for the feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it seems you're waiting for the team's consensus, after internal discussions, we decided that Vlad's approach at #5403 (comment) is desirable.
@kyranet how should we do that though? |
The issue is about the docs not explaining the lack of the property, so instead of duplicating a lot of code for documentation purposes, you can add some documentation to explain why the property is missing, and that'll solve the issue you described in this PR. |
Well ideally we would remove the property entirely but a warning can also work. Would it be possible to update the docs to somehow detect that a property was removed from a class? |
@kyranet tried a different and simpler approach, let me know what you think! |
Along with that, I also noticed that this warning is currently ineffective as it must be placed on GuildChannel instead but I won't add it to this PR as it's not related (unless you want me to) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem with the docs as they're written right now is that we get an out-of-scope warning: the behaviour affects NewsChannel
exclusively, but is present in TextChannel
.
Yeah but if we added that to a JSDoc on NewsChannel it would be overwritten by the one on TextChannel. You can see this on the line I linked above |
Please describe the changes this PR makes and why it should be merged:
This adds a warning to the docs denoting that setRateLimitPerUser is not available on NewsChannels
Status and versioning classification: