Background
Follow-up from PR #364 review.
resolve_mentions (introduced in #364) correctly resolves user mentions to @DisplayName, but role mentions (<@&ROLE_ID>) fall through to the fallback and become @unknown. This loses semantic context — if a user typed @Admin, the agent should ideally see @Admin, not @unknown.
Suggested Approach
- Use
msg.mention_roles to get role IDs mentioned in the message
- Look up role names from the guild cache (
guild.roles)
- Resolve
<@&ROLE_ID> → @RoleName before the fallback step
If guild cache is not readily available, a lighter alternative is to replace <@&ID> with @role:ID instead of @unknown, preserving at least some context.
Related
DC: https://discord.com/channels/1491295327620169908/1494031440482926706
Background
Follow-up from PR #364 review.
resolve_mentions(introduced in #364) correctly resolves user mentions to@DisplayName, but role mentions (<@&ROLE_ID>) fall through to the fallback and become@unknown. This loses semantic context — if a user typed@Admin, the agent should ideally see@Admin, not@unknown.Suggested Approach
msg.mention_rolesto get role IDs mentioned in the messageguild.roles)<@&ROLE_ID>→@RoleNamebefore the fallback stepIf guild cache is not readily available, a lighter alternative is to replace
<@&ID>with@role:IDinstead of@unknown, preserving at least some context.Related
DC: https://discord.com/channels/1491295327620169908/1494031440482926706