mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
* fix: don't patch missing properties from partial payloads * fix(GuildChannel): initialize permissionOverwrites in the constructor * refactor(GuildChannel): remove redundant if
34 lines
646 B
JavaScript
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;
|