From 1601ad14e3b85e4e2e8795f8dde7bc5aa6be930d Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Wed, 26 Apr 2017 17:21:03 -0500 Subject: [PATCH] i hate my life (#1420) --- src/structures/GroupDMChannel.js | 1 - src/structures/TextChannel.js | 10 +++++++++- src/structures/interfaces/TextBasedChannel.js | 12 +----------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/structures/GroupDMChannel.js b/src/structures/GroupDMChannel.js index c51ede298..15eea2c22 100644 --- a/src/structures/GroupDMChannel.js +++ b/src/structures/GroupDMChannel.js @@ -172,7 +172,6 @@ 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 429cf61e5..f93798403 100644 --- a/src/structures/TextChannel.js +++ b/src/structures/TextChannel.js @@ -72,6 +72,15 @@ class TextChannel extends GuildChannel { }); } + /** + * If the Discord Client considers this channel NSFW + * @type {boolean} + * @readonly + */ + get nsfw() { + return /^nsfw(-|$)/.test(this.name); + } + // These are here only for documentation purposes - they are implemented by TextBasedChannel /* eslint-disable no-empty-function */ send() {} @@ -88,7 +97,6 @@ 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 e87edff92..8eec647db 100644 --- a/src/structures/interfaces/TextBasedChannel.js +++ b/src/structures/interfaces/TextBasedChannel.js @@ -389,15 +389,6 @@ 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; @@ -502,8 +493,7 @@ exports.applyToClass = (structure, full = false, ignore = []) => { 'fetchPinnedMessages', 'createCollector', 'createMessageCollector', - 'awaitMessages', - 'nsfw' + 'awaitMessages' ); } for (const prop of props) {