mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-10 08:33:30 +01:00
@@ -66,8 +66,8 @@ class GuildChannel extends Channel {
|
||||
|
||||
const overwrites = this.overwritesFor(member, true, roles);
|
||||
for (const overwrite of overwrites.role.concat(overwrites.member)) {
|
||||
permissions &= ~overwrite.denyData;
|
||||
permissions |= overwrite.allowData;
|
||||
permissions &= ~overwrite.deny;
|
||||
permissions |= overwrite.allow;
|
||||
}
|
||||
|
||||
const admin = Boolean(permissions & Constants.PermissionFlags.ADMINISTRATOR);
|
||||
@@ -144,8 +144,8 @@ class GuildChannel extends Channel {
|
||||
const prevOverwrite = this.permissionOverwrites.get(userOrRole.id);
|
||||
|
||||
if (prevOverwrite) {
|
||||
payload.allow = prevOverwrite.allowData;
|
||||
payload.deny = prevOverwrite.denyData;
|
||||
payload.allow = prevOverwrite.allow;
|
||||
payload.deny = prevOverwrite.deny;
|
||||
}
|
||||
|
||||
for (const perm in options) {
|
||||
@@ -247,6 +247,16 @@ class GuildChannel extends Channel {
|
||||
return this.client.rest.methods.createChannelInvite(this, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clone this channel
|
||||
* @param {string} [name=this.name] Optional name for the new channel, otherwise it has the name of this channel
|
||||
* @param {boolean} [withPermissions=true] Whether to clone the channel with this channel's permission overwrites
|
||||
* @returns {Promise<GuildChannel>}
|
||||
*/
|
||||
clone(name = this.name, withPermissions = true) {
|
||||
return this.guild.createChannel(name, this.type, withPermissions ? this.permissionOverwrites : []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if this channel has the same type, topic, position, name, overwrites and ID as another channel.
|
||||
* In most cases, a simple `channel.id === channel2.id` will do, and is much faster too.
|
||||
|
||||
Reference in New Issue
Block a user