fix: honor mention-bypass for group commands

This commit is contained in:
Peter Steinberger
2026-01-09 02:52:44 +01:00
parent efa5f0bfe0
commit 3a99ac7e9a
7 changed files with 43 additions and 5 deletions

View File

@@ -785,6 +785,7 @@ export function createDiscordMessageHandler(params: {
!hasAnyMention &&
commandAuthorized &&
hasControlCommand(baseText);
const effectiveWasMentioned = wasMentioned || shouldBypassMention;
const canDetectMention = Boolean(botId) || mentionRegexes.length > 0;
if (isGuildMessage && shouldRequireMention) {
if (botId && !wasMentioned && !shouldBypassMention) {
@@ -981,7 +982,7 @@ export function createDiscordMessageHandler(params: {
: undefined,
Provider: "discord" as const,
Surface: "discord" as const,
WasMentioned: wasMentioned,
WasMentioned: effectiveWasMentioned,
MessageSid: message.id,
ParentSessionKey: threadKeys.parentSessionKey,
ThreadStarterBody: threadStarterBody,