mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-13 01:53:30 +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 {
|
class PermissionOverwriteManager extends CachedManager {
|
||||||
constructor(channel, iterable) {
|
constructor(channel, iterable) {
|
||||||
super(channel.client, PermissionOverwrites, iterable);
|
super(channel.client, PermissionOverwrites);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The channel of the permission overwrite this manager belongs to
|
* The channel of the permission overwrite this manager belongs to
|
||||||
* @type {GuildChannel}
|
* @type {GuildChannel}
|
||||||
*/
|
*/
|
||||||
this.channel = channel;
|
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
|
* The category parent of this channel
|
||||||
* @type {?CategoryChannel}
|
* @type {?CategoryChannel}
|
||||||
|
|||||||
Reference in New Issue
Block a user