feat(GuildChannel): add setNSFW method

Backported from commit: 0fc9459450
PR: #2050
This commit is contained in:
SpaceEEC
2018-05-09 16:04:49 +02:00
parent 9169958264
commit 54913d9edb
3 changed files with 32 additions and 20 deletions

View File

@@ -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<TextChannel>}
*/
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);