mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-11 09:03:29 +01:00
fix: consider #nsfw false if not present in data (#4593)
This commit is contained in:
@@ -7,15 +7,25 @@ const GuildChannel = require('./GuildChannel');
|
||||
* @extends {GuildChannel}
|
||||
*/
|
||||
class StoreChannel extends GuildChannel {
|
||||
_patch(data) {
|
||||
super._patch(data);
|
||||
/**
|
||||
* @param {*} guild The guild the store channel is part of
|
||||
* @param {*} data The data for the store channel
|
||||
*/
|
||||
constructor(guild, data) {
|
||||
super(guild, data);
|
||||
|
||||
/**
|
||||
* If the guild considers this channel NSFW
|
||||
* @type {boolean}
|
||||
* @readonly
|
||||
*/
|
||||
this.nsfw = data.nsfw;
|
||||
this.nsfw = Boolean(data.nsfw);
|
||||
}
|
||||
|
||||
_patch(data) {
|
||||
super._patch(data);
|
||||
|
||||
if (typeof data.nsfw !== 'undefined') this.nsfw = Boolean(data.nsfw);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user