mirror of
https://github.com/danbulant/discord.js
synced 2026-05-27 14:02:02 +00:00
Nullable permission overwrites (#869)
Made it possible to pass null to GuildChannel.overwritePermissions's PermissionOverwriteOptions to blank the permission out.
This commit is contained in:
parent
fe3914658a
commit
5dc30d6812
1 changed files with 3 additions and 0 deletions
|
|
@ -155,6 +155,9 @@ class GuildChannel extends Channel {
|
||||||
} else if (options[perm] === false) {
|
} else if (options[perm] === false) {
|
||||||
payload.allow &= ~(Constants.PermissionFlags[perm] || 0);
|
payload.allow &= ~(Constants.PermissionFlags[perm] || 0);
|
||||||
payload.deny |= Constants.PermissionFlags[perm] || 0;
|
payload.deny |= Constants.PermissionFlags[perm] || 0;
|
||||||
|
} else if (options[perm] === null) {
|
||||||
|
payload.allow &= ~(Constants.PermissionFlags[perm] || 0);
|
||||||
|
payload.deny &= ~(Constants.PermissionFlags[perm] || 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue