Skip to content

Treat a mention of the Discord app's own managed role as a mention of the app - #28

Closed
DoodleBears wants to merge 1 commit into
mainfrom
claude/project-thread-vtfyux
Closed

DoodleBears wants to merge 1 commit into
mainfrom
claude/project-thread-vtfyux

Conversation

@DoodleBears

Copy link
Copy Markdown
Collaborator

Before: in Discord, typing @ shows both the bot user and its same-name managed role. Picking the role reached the Host with mentionedAccount: false, so the bound Bot never woke and the Human got no hint why (BotHarness/DeepSeekBot#1615, found in the long-run validation).

After: a mention of the role whose tags.bot_id is this app, and which the app holds, addresses the app like a user mention. Other roles and @everyone still do not.

How: inspectDiscordSourceChannel already reads the guild and the bot member, so it now also returns the app's own managed role IDs. normalizeDiscordHumanText counts a match in mention_roles as mentionedAccount and adds the app to mentions with the role token as key. The Gateway path inspects the channel first when a message only mentions roles, so this works without ordinary-text collection or Message Content approval.

Verification: two new tests in test/channels/discord/external-consumer.test.mjs fail without the change and pass with it. All Discord test files pass (65 tests). lib/index.js is rebuilt with npm run build. I could not run scripts/verify-package.mjs here because the dependency install could not reach the npm registry from this environment.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QAmcXPA6LkMbsPjQgTVtkE


Generated by Claude Code

…ion of the app

Discord gives every bot a managed role with the same name, listed next to the
bot user in the @ autocomplete. Picking it used to reach the Host with
mentionedAccount false, so the Bot was never woken and nothing said why.
Only the role whose tags.bot_id is this app and that the app holds counts;
other roles and @everyone still do not address the app.

Issue: BotHarness/DeepSeekBot#1615
Agent-Task: claude/cloud/session_01QAmcXPA6LkMbsPjQgTVtkE

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QAmcXPA6LkMbsPjQgTVtkE
@DoodleBears

Copy link
Copy Markdown
Collaborator Author

Closing: same fix as #30, which is the more complete version.

@DoodleBears DoodleBears closed this Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants