fix(bot): don't unnecessarily require permission to create forum threads

This commit is contained in:
leo60228 2025-05-25 23:28:59 -04:00
parent 05817afdba
commit 3e07c2dbb2
No known key found for this signature in database
GPG key ID: 6F3EB461799AD95E

View file

@ -94,8 +94,11 @@ public static class PermissionExtensions
if ((perms & PermissionSet.ViewChannel) == 0) if ((perms & PermissionSet.ViewChannel) == 0)
perms &= ~NeedsViewChannel; perms &= ~NeedsViewChannel;
if ((perms & PermissionSet.SendMessages) == 0 && (!isThread || (perms & PermissionSet.SendMessagesInThreads) == 0)) if ((perms & PermissionSet.SendMessages) == 0)
perms &= ~NeedsSendMessages; if (channel.Type == Channel.ChannelType.GuildForum && (perms & PermissionSet.SendMessagesInThreads) != 0)
perms |= PermissionSet.SendMessages;
else if (!isThread || (perms & PermissionSet.SendMessagesInThreads) == 0)
perms &= ~NeedsSendMessages;
return perms; return perms;
} }