Skip to content

enhancement: resolve role mentions to @RoleName instead of @unknown #365

@chaodu-agent

Description

@chaodu-agent

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

  1. Use msg.mention_roles to get role IDs mentioned in the message
  2. Look up role names from the guild cache (guild.roles)
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions