diff --git a/src/structures/GroupDMChannel.js b/src/structures/GroupDMChannel.js index 15eea2c22..c51ede298 100644 --- a/src/structures/GroupDMChannel.js +++ b/src/structures/GroupDMChannel.js @@ -172,6 +172,7 @@ class GroupDMChannel extends Channel { awaitMessages() {} // Doesn't work on group DMs; bulkDelete() {} acknowledge() {} + get nsfw() {} _cacheMessage() {} } diff --git a/src/structures/TextChannel.js b/src/structures/TextChannel.js index 617c17a78..429cf61e5 100644 --- a/src/structures/TextChannel.js +++ b/src/structures/TextChannel.js @@ -88,6 +88,7 @@ class TextChannel extends GuildChannel { stopTyping() {} get typing() {} get typingCount() {} + get nsfw() {} createCollector() {} createMessageCollector() {} awaitMessages() {} diff --git a/src/structures/interfaces/TextBasedChannel.js b/src/structures/interfaces/TextBasedChannel.js index 8eec647db..e87edff92 100644 --- a/src/structures/interfaces/TextBasedChannel.js +++ b/src/structures/interfaces/TextBasedChannel.js @@ -389,6 +389,15 @@ class TextBasedChannel { return this.client.rest.methods.ackTextChannel(this); } + /** + * If the Discord Client considers this channel NSFW + * @type {boolean} + * @readonly + */ + get nsfw() { + return /^nsfw(-|$)/.test(this.name); + } + _cacheMessage(message) { const maxSize = this.client.options.messageCacheMaxSize; if (maxSize === 0) return null; @@ -493,7 +502,8 @@ exports.applyToClass = (structure, full = false, ignore = []) => { 'fetchPinnedMessages', 'createCollector', 'createMessageCollector', - 'awaitMessages' + 'awaitMessages', + 'nsfw' ); } for (const prop of props) {