mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
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:
@@ -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>>}
|
||||
|
||||
Reference in New Issue
Block a user