mirror of
https://github.com/danbulant/discord.js
synced 2026-05-24 20:42:27 +00:00
Add TextBasedChannel#nsfw (excluding User and GuildMember) (#1419)
This commit is contained in:
parent
298ee4e79f
commit
5ac22691d2
3 changed files with 13 additions and 1 deletions
|
|
@ -172,6 +172,7 @@ class GroupDMChannel extends Channel {
|
|||
awaitMessages() {}
|
||||
// Doesn't work on group DMs; bulkDelete() {}
|
||||
acknowledge() {}
|
||||
get nsfw() {}
|
||||
_cacheMessage() {}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ class TextChannel extends GuildChannel {
|
|||
stopTyping() {}
|
||||
get typing() {}
|
||||
get typingCount() {}
|
||||
get nsfw() {}
|
||||
createCollector() {}
|
||||
createMessageCollector() {}
|
||||
awaitMessages() {}
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue