mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 00:53:31 +01:00
fix: consider #nsfw false if not present in data (#4593)
This commit is contained in:
@@ -24,6 +24,13 @@ class TextChannel extends GuildChannel {
|
||||
* @type {MessageManager}
|
||||
*/
|
||||
this.messages = new MessageManager(this);
|
||||
|
||||
/**
|
||||
* If the guild considers this channel NSFW
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
this.nsfw = Boolean(data.nsfw);
|
||||
this._typing = new Map();
|
||||
}
|
||||
|
||||
@@ -36,12 +43,7 @@ class TextChannel extends GuildChannel {
|
||||
*/
|
||||
this.topic = data.topic;
|
||||
|
||||
/**
|
||||
* If the guild considers this channel NSFW
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
this.nsfw = data.nsfw;
|
||||
if (typeof data.nsfw !== 'undefined') this.nsfw = Boolean(data.nsfw);
|
||||
|
||||
/**
|
||||
* The ID of the last message sent in this channel, if one was sent
|
||||
|
||||
Reference in New Issue
Block a user