feat(GuildChannel): support conversion between text and news (#5022)

* feat(GuildChannel): support conversion between text and news

* fix(Typings): add type to ChannelData

* fix(GuildChannel): use ChannelUpdate action handler to change class type

* Update src/structures/TextChannel.js

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>

* fix(Typings): re-use ChannelType from GuildCreateChannelOptions

* fix(Typings): only allow text-news conversion

* fix(Typings): exclude -> pick (vlads suggestion)

* fix(Typings): pick -> exclude in two other spots

Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
This commit is contained in:
monbrey
2021-01-23 04:03:02 +11:00
committed by GitHub
parent 98b1c58218
commit 5ac3b57f9b
3 changed files with 17 additions and 3 deletions

View File

@@ -86,6 +86,16 @@ class TextChannel extends GuildChannel {
return this.edit({ nsfw }, reason);
}
/**
* Sets the type of this channel (only conversion between text and news is supported)
* @param {string} type The new channel type
* @param {string} [reason] Reason for changing the channel's type
* @returns {Promise<GuildChannel>}
*/
setType(type, reason) {
return this.edit({ type }, reason);
}
/**
* Fetches all webhooks for the channel.
* @returns {Promise<Collection<Snowflake, Webhook>>}