Skip to content

Commit

Permalink
fix(Channels): OldChannel permissionOverwrites showing updated perms (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
conorwastakenwastaken authored Jun 11, 2024
1 parent 692521c commit f48547b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
7 changes: 2 additions & 5 deletions lib/structures/CategoryChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ class CategoryChannel extends GuildChannel {
this.position = data.position;
}
if(data.permission_overwrites !== undefined) {
if(this.permissionOverwrites === undefined) {
this.permissionOverwrites = new Collection(PermissionOverwrite);
}
this.permissionOverwrites.clear();
this.permissionOverwrites = new Collection(PermissionOverwrite);
data.permission_overwrites.forEach((overwrite) => {
this.permissionOverwrites.update(overwrite);
this.permissionOverwrites.add(overwrite);
});
}
}
Expand Down
7 changes: 2 additions & 5 deletions lib/structures/MediaChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ class MediaChannel extends GuildChannel {
this.nsfw = data.nsfw;
}
if(data.permission_overwrites !== undefined) {
if(this.permissionOverwrites === undefined) {
this.permissionOverwrites = new Collection(PermissionOverwrite);
}
this.permissionOverwrites.clear();
this.permissionOverwrites = new Collection(PermissionOverwrite);
data.permission_overwrites.forEach((overwrite) => {
this.permissionOverwrites.update(overwrite);
this.permissionOverwrites.add(overwrite);
});
}
if(data.position !== undefined) {
Expand Down
7 changes: 2 additions & 5 deletions lib/structures/TextChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,9 @@ class TextChannel extends GuildTextableChannel {
this.position = data.position;
}
if(data.permission_overwrites !== undefined) {
if(this.permissionOverwrites === undefined) {
this.permissionOverwrites = new Collection(PermissionOverwrite);
}
this.permissionOverwrites.clear();
this.permissionOverwrites = new Collection(PermissionOverwrite);
data.permission_overwrites.forEach((overwrite) => {
this.permissionOverwrites.update(overwrite);
this.permissionOverwrites.add(overwrite);
});
}
if(data.nsfw !== undefined) {
Expand Down
7 changes: 2 additions & 5 deletions lib/structures/VoiceChannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,9 @@ class VoiceChannel extends GuildTextableChannel {
this.position = data.position;
}
if(data.permission_overwrites !== undefined) {
if(this.permissionOverwrites === undefined) {
this.permissionOverwrites = new Collection(PermissionOverwrite);
}
this.permissionOverwrites.clear();
this.permissionOverwrites = new Collection(PermissionOverwrite);
data.permission_overwrites.forEach((overwrite) => {
this.permissionOverwrites.update(overwrite);
this.permissionOverwrites.add(overwrite);
});
}
if(data.nsfw !== undefined) {
Expand Down

0 comments on commit f48547b

Please sign in to comment.