Skip to content

Commit 249beb1

Browse files
HandyS11claude
andcommitted
Suppress mentions on embed-only wipe posts
Only pass AllowedMentions.All when ping content is present; use AllowedMentions.None for embed-only posts so incidental mention-like text in the localized embed cannot ping users or roles. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent c34c71d commit 249beb1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/RustPlusBot.Features.Wipes/Posting/DiscordWipeChannelPoster.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ public async Task PostAsync(ulong channelId, string? content, Embed embed, Cance
2626
return;
2727
}
2828

29+
// Only permit mentions when we are deliberately pinging (content carries the @everyone).
30+
// For an embed-only post, suppress all mentions so incidental mention-like text in the
31+
// localized embed can never ping a user or role.
2932
await channel.SendMessageAsync(
3033
content,
3134
embed: embed,
3235
options: options,
33-
allowedMentions: AllowedMentions.All)
36+
allowedMentions: content is null ? AllowedMentions.None : AllowedMentions.All)
3437
.ConfigureAwait(false);
3538
}
3639
catch (OperationCanceledException)

0 commit comments

Comments
 (0)