fix(bot): make EmbedLinks permission check work with threads

This commit is contained in:
Iris System
2023-05-28 14:42:18 +12:00
parent 71c61e93b5
commit 97666a62df
3 changed files with 9 additions and 7 deletions

View File

@@ -100,7 +100,7 @@ public class ProxyService
// Check if the sender account can mention everyone/here + embed links
// we need to "mirror" these permissions when proxying to prevent exploits
var senderPermissions = PermissionExtensions.PermissionsFor(guild, rootChannel, message);
var senderPermissions = PermissionExtensions.PermissionsFor(guild, rootChannel, message, isThread: rootChannel.Id != channel.Id);
var allowEveryone = senderPermissions.HasFlag(PermissionSet.MentionEveryone);
var allowEmbeds = senderPermissions.HasFlag(PermissionSet.EmbedLinks);