Repository navigation
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
Closed
DoodleBears wants to merge 1 commit into
DoodleBears wants to merge 1 commit into
Conversation
…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
Collaborator
Author
|
Closing: same fix as #30, which is the more complete version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: in Discord, typing
@shows both the bot user and its same-name managed role. Picking the role reached the Host withmentionedAccount: 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_idis this app, and which the app holds, addresses the app like a user mention. Other roles and@everyonestill do not.How:
inspectDiscordSourceChannelalready reads the guild and the bot member, so it now also returns the app's own managed role IDs.normalizeDiscordHumanTextcounts a match inmention_rolesasmentionedAccountand adds the app tomentionswith 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.mjsfail without the change and pass with it. All Discord test files pass (65 tests).lib/index.jsis rebuilt withnpm run build. I could not runscripts/verify-package.mjshere 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