-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
fix(GuildChannel): regression on default channel type #5251
Conversation
Shouldn't we still use I was thinking about this: type: ChannelTypes[(data.type || this.type).toUpperCase()], |
Not required, has no benefit: https://discord.com/developers/docs/resources/channel#modify-channel
Aka: you just need to pass what you actually want to edit, meaning undefined (which this will otherwise result in) is valid |
Alright, thanks 👍 |
You mentioned this pull request instead of the #5273 issue in the pull request description |
it would be better if instead of using uppercased channel type name to use instead an integer that discord uses to represent a type https://discord.com/developers/docs/resources/channel#channel-object-channel-types this how it looks for my own quick fix but off course for the library it would be better to map each type to an integer note: I only use the function to mass change permissions when a server owner changes the verify channel for my verification bot |
This is out of scope of this regression fix - we might do so going forward, as mentioned by vlad above:
|
Please describe the changes this PR makes and why it should be merged:
The merge of #5022 has caused a regression, which this PR aims to fix.
When no channel is provided in data the PR defaults to
this.type
. This is however not the required numerical for the channel type the API expects resulting inThe other case (type is present in data) chooses to do the defaulting through the ChannelTypes enum and uppercasing the expected text value, which I have accordingly replicated in the defaulting case.Status
Semantic versioning classification: