Files
discord.js/src/structures/StoreChannel.js
SpaceEEC 097c7b9cdd fix: don't patch missing properties from partial payloads (#5796)
* fix: don't patch missing properties from partial payloads

* fix(GuildChannel): initialize permissionOverwrites in the constructor

* refactor(GuildChannel): remove redundant if
2021-06-10 17:42:45 +01:00

34 lines
646 B
JavaScript

'use strict';
const GuildChannel = require('./GuildChannel');
/**
* Represents a guild store channel on Discord.
* @extends {GuildChannel}
*/
class StoreChannel extends GuildChannel {
/**
* @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}
*/
this.nsfw = Boolean(data.nsfw);
}
_patch(data) {
super._patch(data);
if ('nsfw' in data) {
this.nsfw = Boolean(data.nsfw);
}
}
}
module.exports = StoreChannel;