Skip to content

Conversation

@Jiralite
Copy link
Member

Please describe the changes this PR makes and why it should be merged:
Per #5521, methods and typings that were solely for category channels (and ids) were instead allowing any channel to go through instead of just CategoryChannelResolvable. This pull request should address this and resolve #5521.

Additionally, this pull request changes the type definition for ChannelData. Before, it only could take the parent id (Snowflake) of a potential category channel, but now, it is possible to take a CategoryChannelResolvable instead. This means a rename is in order, so I've changed parentId here to just parent. This also makes it a breaking change, but this also matches nicely now with the GuildChannelCreateOptions type definition!

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 includes breaking changes (methods removed or renamed, parameters moved or removed)

@Jiralite
Copy link
Member Author

I noticed there's a bunch of other places where the typings can be strengthened, so I'm going to add the following and apply them to hopefully everywhere with no missed instances:

  • @typedef {TextChannel|Snowflake} TextChannelResolvable
  • @typedef {VoiceChannel|Snowflake} VoiceChannelResolvable
  • @typedef {VoiceChannel|StageChannel|Snowflake} GuildVoiceChannelResolvable

@Jiralite Jiralite changed the title refactor: Use CategoryChannelResolvable in appropriate places refactor: Strengthen channel typings in appropriate places Jul 30, 2021
@Jiralite Jiralite requested a review from kyranet July 30, 2021 18:15
@iCrawl iCrawl added this to the Version 13 milestone Jul 30, 2021
@iCrawl iCrawl requested review from SpaceEEC and vladfrangu July 30, 2021 21:49
Favouring "disconnect" here instead of "kick" as it is consistent with the documentation in VoiceState#setChannel().
@iCrawl iCrawl merged commit 65ae064 into discordjs:master Jul 31, 2021
@Jiralite Jiralite deleted the categorychannelresolvable branch July 31, 2021 08:57
ironm00n pushed a commit to TanzaniteBot/discord.js that referenced this pull request Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use CategoryChannelResolvable for parent setting

4 participants