feat: add more options for when to make proxied messages silent

This commit is contained in:
Petal Ladenson 2026-01-13 19:26:10 -07:00
parent 952bb02285
commit 546a287c28
9 changed files with 71 additions and 14 deletions

View file

@ -242,7 +242,15 @@ public class ProxyService
var tts = match.Member.Tts && senderPermissions.HasFlag(PermissionSet.SendTtsMessages);
Message.MessageFlags flags = 0;
if (ctx.SuppressNotifications)
// If the guild suppress notifications condition is set to Always
if (ctx.SuppressNotifications == GuildConfig.SuppressCondition.Always ||
// OR if it is set to Match and the trigger message was silent
(ctx.SuppressNotifications == GuildConfig.SuppressCondition.Match &&
trigger.Flags.HasFlag(Message.MessageFlags.SuppressNotifications)) ||
// OR if it is set to Invert and the trigger message wasn't silent
(ctx.SuppressNotifications == GuildConfig.SuppressCondition.Invert &&
!trigger.Flags.HasFlag(Message.MessageFlags.SuppressNotifications)))
// Make the proxied message silent
flags |= Message.MessageFlags.SuppressNotifications;
if (trigger.Flags.HasFlag(Message.MessageFlags.VoiceMessage))
flags |= Message.MessageFlags.VoiceMessage;