mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 16:43:31 +01:00
fix(GuildChannel): clone its PermissionOverwriteManager too (#6083)
This commit is contained in:
@@ -13,13 +13,19 @@ const { OverwriteTypes } = require('../util/Constants');
|
||||
*/
|
||||
class PermissionOverwriteManager extends CachedManager {
|
||||
constructor(channel, iterable) {
|
||||
super(channel.client, PermissionOverwrites, iterable);
|
||||
super(channel.client, PermissionOverwrites);
|
||||
|
||||
/**
|
||||
* The channel of the permission overwrite this manager belongs to
|
||||
* @type {GuildChannel}
|
||||
*/
|
||||
this.channel = channel;
|
||||
|
||||
if (iterable) {
|
||||
for (const item of iterable) {
|
||||
this._add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -90,6 +90,12 @@ class GuildChannel extends Channel {
|
||||
}
|
||||
}
|
||||
|
||||
_clone() {
|
||||
const clone = super._clone();
|
||||
clone.permissionOverwrites = new PermissionOverwriteManager(clone, this.permissionOverwrites.cache.values());
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* The category parent of this channel
|
||||
* @type {?CategoryChannel}
|
||||
|
||||
Reference in New Issue
Block a user