← Back to PRs

#20697: feat(discord): auto-resolve user mentions in message content

by tdjackey open 2026-02-19 07:08 View on GitHub →
channel: discord size: XS
## Summary Resolves Discord user mentions (e.g., `<@123>`) in incoming message content to human-readable names (e.g., `@Alice`) using the message's `mentions` metadata. Fixes #20617. ## Implementation - Added `resolveDiscordMentions` helper in `message-utils.ts` - Maps ID to `global_name` (priority) or `username` - Handles both `<@id>` and `<@!id>` formats - Added unit tests covering resolution and no-op cases ## Impact - Agents now see `@Alice hello` instead of `<@12345> hello` - Improves context understanding for multi-user conversations <!-- greptile_comment --> <h3>Greptile Summary</h3> Adds user mention resolution to Discord message content, converting `<@id>` format to readable names like `@Alice`. The implementation correctly prioritizes `global_name` over `username` and handles both `<@id>` and `<@!id>` formats. The change is scoped to the message text resolution flow and includes appropriate test coverage for basic cases. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The implementation is clean, focused, and follows existing patterns in the codebase. The change is scoped to message text resolution with appropriate guards. Test coverage validates the core functionality. No breaking changes or security concerns identified. - No files require special attention <sub>Last reviewed commit: 0cb7e10</sub> <!-- greptile_other_comments_section --> <sub>(4/5) You can add custom instructions or style guidelines for the agent [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs