anthropics / anthropics/claude-plugins-official
discord plugin: bot-authored messages are unconditionally dropped — blocks agent-to-agent coordination in opted-in group channels
- Dominant language
- Python
- Stars
- 36.2k
- Forks
- 4.1k
- PR merge metrics
- PR metrics pending
Description
## Summary
`discord/server.ts` line ~806:
```ts
client.on('messageCreate', msg => {
if (msg.author.bot) return
```
drops every bot-authored message before the access gate runs. This makes the plugin unusable for a real emerging use case: **two Claude Code sessions (on different machines) coordinating through a shared Discord channel, each behind its own bot**. Each side's mention of the other is silently ignored — no event ever reaches the session, with nothing in the logs, so it presents as "the bot is deaf" and takes real diagnosis to find.
## Why the blanket filter is broader than its purpose needs
The self-echo/loop concern is legitimate, but the existing access model already provides the safety layers for the bot-to-bot case:
- group channels are **opt-in** (`groups` in access.json — default ignore),
- opted-in channels default to **requireMention**,
- a per-group `allowFrom` can pin exactly which sender IDs (including specific bot IDs) are allowed.
With those gates, the only *hard* requirement is not processing your **own** messages.
## Suggested
Minimal: drop only self — `if (msg.author.id === client.user?.id) return` — and let the normal gate (opt-in + mention + allowFrom) decide the rest.
More conservative if you want bot-drop to stay the default: keep dropping bot authors **unless** the message is in an opted-in group whose `allowFrom` explicitly lists that bot's ID (i.e., opt-in per sending bot). That makes bot-to-bot an explicit operator decision with zero change for existing setups.
Either way, a debug-level log line for dropped bot messages would have cut the diagnosis time to seconds.
## Context
discord plugin **0.0.4**, Linux, bun 1.3.14. We've locally patched the self-only form and it works (mention-gated channel, two bots, no loops — helped by a convention of never @mentioning the counterpart bot in routine replies). Happy to test a build.
## Loop-safety note for reviewers
Self-filter + requireMention means a loop needs both bots to @mention each other in replies. A belt-and-braces option: rate-limit inbound from bot authors, or ignore a bot message that only quotes/mentions with no other content.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.