Skip to content

Commit

Permalink
refactor(GuildChannel): simplify constructor (#9499)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyranet committed May 2, 2023
1 parent 6d7f3b0 commit f2ad076
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/discord.js/src/structures/GuildChannel.js
Expand Up @@ -20,7 +20,7 @@ const PermissionsBitField = require('../util/PermissionsBitField');
*/
class GuildChannel extends BaseChannel {
constructor(guild, data, client, immediatePatch = true) {
super(guild?.client ?? client, data, false);
super(client, data, false);

/**
* The guild the channel is in
Expand All @@ -33,8 +33,6 @@ class GuildChannel extends BaseChannel {
* @type {Snowflake}
*/
this.guildId = guild?.id ?? data.guild_id;

this.parentId = this.parentId ?? null;
/**
* A manager of permission overwrites that belong to this channel
* @type {PermissionOverwriteManager}
Expand Down Expand Up @@ -73,6 +71,8 @@ class GuildChannel extends BaseChannel {
* @type {?Snowflake}
*/
this.parentId = data.parent_id;
} else {
this.parentId ??= null;
}

if ('permission_overwrites' in data) {
Expand Down

0 comments on commit f2ad076

Please sign in to comment.