diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 66efd8c2b..a1e8d53a0 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -248,6 +248,7 @@ class GuildChannel extends Channel { * @property {string} [name] The name of the channel * @property {number} [position] The position of the channel * @property {string} [topic] The topic of the text channel + * @property {boolean} [nsfw] Whether the channel is NSFW * @property {number} [bitrate] The bitrate of the voice channel * @property {number} [userLimit] The user limit of the voice channel * @property {Snowflake} [parentID] The parent ID of the channel @@ -290,6 +291,7 @@ class GuildChannel extends Channel { data: { name: (data.name || this.name).trim(), topic: data.topic, + nsfw: data.nsfw, bitrate: data.bitrate || (this.bitrate ? this.bitrate * 1000 : undefined), user_limit: data.userLimit != null ? data.userLimit : this.userLimit, // eslint-disable-line eqeqeq parent_id: data.parentID, diff --git a/src/structures/TextChannel.js b/src/structures/TextChannel.js index 6529f46b9..5679f841a 100644 --- a/src/structures/TextChannel.js +++ b/src/structures/TextChannel.js @@ -38,6 +38,16 @@ class TextChannel extends GuildChannel { if (data.messages) for (const message of data.messages) this.messages.create(message); } + /** + * Sets whether this channel is flagged as NSFW. + * @param {boolean} nsfw Whether the channel should be considered NSFW + * @param {string} [reason] Reason for changing the channel's NSFW flag + * @returns {Promise} + */ + setNSFW(nsfw, reason) { + return this.edit({ nsfw }, reason); + } + /** * Fetches all webhooks for the channel. * @returns {Promise>}