mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
oops, actually check guild permissions as well in channel EveryonePermissions
This commit is contained in:
parent
4c97a9daf6
commit
55c56c4e58
1 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue