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(GuildChannel): support conversion between text and news #5022

Merged
merged 9 commits into from
Jan 22, 2021

Conversation

monbrey
Copy link
Member

@monbrey monbrey commented Nov 18, 2020

Discord.js did not support providing type in the GuildChannel#edit payload, this adds support for that and a setType helper method on TextChannel and NewsChannel.

The API will throw an error if attempting to convert to anything other than Text or News.

Status

  • 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

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

@monbrey monbrey changed the title Convert channel type feat(GuildChannel): support conversion between text and news Nov 18, 2020
src/structures/TextChannel.js Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
typings/index.d.ts Outdated 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.

Can you check the types (that they're right), and update it in TextChannel and ChannelData?

@monbrey
Copy link
Member Author

monbrey commented Dec 17, 2020

Can you check the types (that they're right), and update it in TextChannel and ChannelData?

My bad missing the other two places, is there a reason you think the Pick<typeof ChannelType, 'text' | 'news'> isn't right though? Just want to make sure I'm not missing something here.

@iCrawl iCrawl merged commit 5ac3b57 into discordjs:master Jan 22, 2021
@monbrey monbrey deleted the convert-channel-type branch May 2, 2021 21:47
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 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.

None yet

8 participants