diff --git a/src/client/rest/RESTMethods.js b/src/client/rest/RESTMethods.js index 393f4e2db..7b122897d 100644 --- a/src/client/rest/RESTMethods.js +++ b/src/client/rest/RESTMethods.js @@ -335,6 +335,7 @@ class RESTMethods { const data = {}; data.name = (_data.name || channel.name).trim(); data.topic = typeof _data.topic === 'undefined' ? channel.topic : _data.topic; + data.nsfw = typeof _data.nsfw === 'undefined' ? channel.nsfw : _data.nsfw; data.position = _data.position || channel.position; data.bitrate = _data.bitrate || (channel.bitrate ? channel.bitrate * 1000 : undefined); data.user_limit = typeof _data.userLimit !== 'undefined' ? _data.userLimit : channel.userLimit; diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 6833a5b1c..b18e972e7 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -212,6 +212,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 channel */ diff --git a/src/structures/TextChannel.js b/src/structures/TextChannel.js index 0545d7bdf..dcaa3d97d 100644 --- a/src/structures/TextChannel.js +++ b/src/structures/TextChannel.js @@ -62,6 +62,16 @@ class TextChannel extends GuildChannel { return this.client.rest.methods.getChannelWebhooks(this); } + /** + * 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); + } + /** * Create a webhook for the channel. * @param {string} name The name of the webhook @@ -85,26 +95,26 @@ class TextChannel extends GuildChannel { // These are here only for documentation purposes - they are implemented by TextBasedChannel /* eslint-disable no-empty-function */ - send() {} - sendMessage() {} - sendEmbed() {} - sendFile() {} - sendFiles() {} - sendCode() {} - fetchMessage() {} - fetchMessages() {} - fetchPinnedMessages() {} - search() {} - startTyping() {} - stopTyping() {} - get typing() {} - get typingCount() {} - createCollector() {} - createMessageCollector() {} - awaitMessages() {} - bulkDelete() {} - acknowledge() {} - _cacheMessage() {} + send() { } + sendMessage() { } + sendEmbed() { } + sendFile() { } + sendFiles() { } + sendCode() { } + fetchMessage() { } + fetchMessages() { } + fetchPinnedMessages() { } + search() { } + startTyping() { } + stopTyping() { } + get typing() { } + get typingCount() { } + createCollector() { } + createMessageCollector() { } + awaitMessages() { } + bulkDelete() { } + acknowledge() { } + _cacheMessage() { } } TextBasedChannel.applyToClass(TextChannel, true);