#23689: feat(discord): add ignoreOtherMentions config option
channel: discord
size: XS
Cluster:
Signal and Discord Fixes
## Summary
- Add `ignoreOtherMentions` channel/guild config option for Discord multi-bot setups
- When enabled, drops messages that explicitly mention another bot/user but not this one
- Messages with no mentions still pass through normally
## Problem
In multi-bot Discord setups (e.g. two OpenClaw instances in the same channel), both bots respond to messages mentioning the other bot. `requireMention: true` would fix this but also blocks non-mentioned messages. There was no way to achieve "respond to my mentions + unmentioned messages, but ignore messages targeting other bots."
## Solution
New config option `ignoreOtherMentions: boolean` at channel and guild level:
```json
{
"channels": {
"discord": {
"guilds": {
"guild-id": {
"channels": {
"channel-id": {
"allow": true,
"requireMention": false,
"ignoreOtherMentions": true
}
}
}
}
}
}
}
```
| Scenario | `ignoreOtherMentions: true` |
|---|---|
| `@this-bot question` | Responds |
| `@other-bot question` | **Ignores** |
| `plain message` (no mention) | Responds |
| Reply to this bot's message | Responds (implicit mention) |
## Changes
- `src/config/types.discord.ts` — Added `ignoreOtherMentions` to `DiscordGuildChannelConfig` and `DiscordGuildEntry`
- `src/config/zod-schema.providers-core.ts` — Added to zod validation schemas
- `src/discord/monitor/allow-list.ts` — Added to resolved types and config resolver
- `src/discord/monitor/message-handler.preflight.ts` — Core filtering logic after mention gating
## Test plan
- [x] Configure two bot instances in the same Discord channel with `ignoreOtherMentions: true`
- [x] Verify @bot-A message is only handled by bot-A
- [x] Verify @bot-B message is only handled by bot-B
- [x] Verify unmentioned messages are handled by both bots
- [x] Verify reply-to-bot messages are not dropped (implicit mention)
- [x] Verify @everyone messages behavior (known edge case: currently dropped)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds `ignoreOtherMentions` config option for Discord multi-bot setups. When enabled, drops messages that explicitly mention another bot/user but not this one, while allowing messages with no mentions to pass through. This solves the problem of both bots responding in multi-bot channels without requiring `requireMention: true` (which would block all unmentioned messages).
**Changes:**
- Added `ignoreOtherMentions` boolean field to `DiscordGuildChannelConfig` and `DiscordGuildEntry` types with JSDoc
- Added Zod validation schemas for the new field
- Extended resolved config types and propagation in allow-list resolver
- Implemented filtering logic in message preflight handler (after `requireMention` check, before access restrictions)
**Implementation quality:**
- Config changes are properly typed and validated
- Logic correctly uses `hasAnyMention`, `wasMentioned`, and `implicitMention` variables
- Placed appropriately in the preflight flow (after mention gating, before access checks)
- Includes debug and verbose logging for dropped messages
- Correctly records history entries for dropped messages
- Follows existing code patterns and conventions
**Known edge case (acknowledged in PR description):**
- `@everyone` messages without this bot's name pattern in text are currently dropped with `ignoreOtherMentions: true`
**Missing (non-blocking):**
- No unit tests for the new feature
- Documentation (docs/channels/discord.md) not updated with the new config option
<h3>Confidence Score: 4/5</h3>
- Safe to merge with minor follow-ups recommended
- The implementation is well-structured, follows existing patterns, and solves a real problem in multi-bot setups. Config changes are properly typed and validated. The logic is correctly placed in the preflight flow and uses appropriate variables. Missing tests and documentation are noted but don't block the merge since the PR includes a test plan and the feature is opt-in with safe defaults (false).
- No files require special attention - implementation is straightforward and follows established patterns
<sub>Last reviewed commit: ef5d9da</sub>
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#22611: fix(discord): allow messages from other instance bots in multi-acco...
by dae-sun · 2026-02-21
79.1%
#13430: fix(discord): properly handle bot-sent @everyone mentions
by wassimbensalem · 2026-02-10
78.0%
#15864: feat: add deliverOnlyToolMessages config for clean messaging channe...
by gandalf-the-engineer · 2026-02-14
77.9%
#19615: fix(discord): include default account when sub-accounts are configured
by prue-starfield · 2026-02-18
77.0%
#19917: feat(discord): allow disabling intermediate status reactions
by Gitjay11 · 2026-02-18
76.6%
#7719: fix(slack): thread replies with @mentions dropped in requireMention...
by SocialNerd42069 · 2026-02-03
76.5%
#8310: feat(telegram): Add allowBots support for groups (parity with Disco...
by vishaltandale00 · 2026-02-03
76.3%
#14057: feat(telegram): add ignoreMediaTypes config to skip specific inboun...
by pavelsamoylenko · 2026-02-11
75.8%
#16570: feat(mattermost): add replyToMode threading support
by FBartos · 2026-02-14
75.4%
#23158: discord: harden preflight/reply path against slow lookup latency
by danielstarman · 2026-02-22
75.4%