From 55c56c4e58508d8b770ca9d0aa6daa3b181e0fc1 Mon Sep 17 00:00:00 2001 From: spiral Date: Sun, 15 Aug 2021 01:04:04 -0400 Subject: [PATCH] oops, actually check guild permissions as well in channel EveryonePermissions --- Myriad/Extensions/PermissionExtensions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Myriad/Extensions/PermissionExtensions.cs b/Myriad/Extensions/PermissionExtensions.cs index e5479c4d..567c32b5 100644 --- a/Myriad/Extensions/PermissionExtensions.cs +++ b/Myriad/Extensions/PermissionExtensions.cs @@ -43,11 +43,12 @@ namespace Myriad.Extensions if (channel.Type == Channel.ChannelType.Dm) return PermissionSet.Dm; + var defaultPermissions = cache.GetGuild(channel.GuildId!.Value).EveryonePermissions(); var overwrite = channel.PermissionOverwrites?.FirstOrDefault(r => r.Id == channel.GuildId); if (overwrite == null) - return cache.GetGuild(channel.GuildId!.Value).EveryonePermissions(); + return defaultPermissions; - var perms = PermissionSet.None; + var perms = defaultPermissions; perms &= ~overwrite.Deny; perms |= overwrite.Allow;