Skip to content
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

feat(CategoryChannel): add createChannel shortcut method #6614

Merged
merged 3 commits into from Oct 3, 2021

Conversation

ImRodry
Copy link
Contributor

@ImRodry ImRodry commented Sep 8, 2021

Please describe the changes this PR makes and why it should be merged:
This PR adds a method to CategoryChannel called createChannel that creates a channel inside that category. It also fixes a bug in the options interface to disallow GUILD_NEWS_THREAD types on both the GuildChannelCreateOptions and the CategoryCreateChannelOptions interfaces

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR changes the library's interface (methods or parameters added)

src/structures/CategoryChannel.js Show resolved Hide resolved
typings/index.d.ts Show resolved Hide resolved
Copy link
Member

@vladfrangu vladfrangu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smallest nit, but can be merged without it so LGTM

src/structures/CategoryChannel.js Outdated Show resolved Hide resolved
@anandre
Copy link
Contributor

anandre commented Sep 9, 2021

I don't think that this method brings any needed utility to the library. Adding a method that AFAIK is only on managers to separate class seems like it's cluttering up the library for no good reason. All this does is add more to the library for the convenience of setting one value for the user. Recently, the library has been removing extraneous helper/utility methods, and this is going in exactly the opposite direction.

@ImRodry
Copy link
Contributor Author

ImRodry commented Sep 10, 2021

@anandre the methods the library has been recently removing are only ones that were unreliable and caused more hassles than they solved (e.g. typing-related properties and methods, User#presence, etc). This method is indeed a convenience and I recognize that it would be better to have a children manager, however, that cannot be done until v14. If the reviewers prefer we can hold this off and transform CategoryChannel#children into a manager later on, however I don't see why this couldn't be added personally as it is quite convenient (e.g. to be used with a CHANNEL option in a slash command where you'd be able to call the method directly instead of using the channel's ID in the manager's method) and seems to be getting some positive feedback too.

Along with that, methods like this exist all across the library e.g. GuildMember#setX that all call the GuildMember#edit method, and others on other classes too, so I don't see why this shouldn't be added

@iCrawl iCrawl merged commit 3eacf7a into discordjs:main Oct 3, 2021
@ImRodry ImRodry deleted the feat-category-createChannel branch October 3, 2021 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants