From 5dc30d68123fd46d8da3cb8b1a4e7122d8a0f2a2 Mon Sep 17 00:00:00 2001 From: Slamakans Date: Sun, 6 Nov 2016 11:43:31 +0100 Subject: [PATCH] Nullable permission overwrites (#869) Made it possible to pass null to GuildChannel.overwritePermissions's PermissionOverwriteOptions to blank the permission out. --- src/structures/GuildChannel.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/structures/GuildChannel.js b/src/structures/GuildChannel.js index 19d7bf3d6..c384279ff 100644 --- a/src/structures/GuildChannel.js +++ b/src/structures/GuildChannel.js @@ -155,6 +155,9 @@ class GuildChannel extends Channel { } else if (options[perm] === false) { payload.allow &= ~(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); } }