openclaw - 💡(How to fix) Fix [Bug]: discord-auto-reply: bot ignores messages when user picks role-mention autocomplete instead of user-mention [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74967Fetched 2026-05-01 05:39:29
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
2
Author
Timeline (top)
labeled ×2closed ×1commented ×1cross-referenced ×1

discord-auto-reply skips bot-addressed messages when Discord client autocomplete picks the bot's auto-managed role mention (<@&ROLE_ID>) instead of the bot user mention (<@USER_ID>); both render identically in the Discord UI but only user mentions populate mentions[], which is the only field the preflight checks.

Root Cause

discord-auto-reply skips bot-addressed messages when Discord client autocomplete picks the bot's auto-managed role mention (<@&ROLE_ID>) instead of the bot user mention (<@USER_ID>); both render identically in the Discord UI but only user mentions populate mentions[], which is the only field the preflight checks.

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

discord-auto-reply skips bot-addressed messages when Discord client autocomplete picks the bot's auto-managed role mention (<@&ROLE_ID>) instead of the bot user mention (<@USER_ID>); both render identically in the Discord UI but only user mentions populate mentions[], which is the only field the preflight checks.

Steps to reproduce

  1. Invite OpenClaw bot with default Administrator permission. Discord
    auto-creates a managed role with the same name as the bot user.
  2. In Discord client, type @<botname> in any guild channel.
  3. Select the role suggestion from the autocomplete list (the @-icon option, not the bot avatar).
  4. Send the message.

Expected behavior

Bot replies to the message, since the user-visible intent (mentioning the bot by name) is the same as a user-mention. The role and user mentions render
identically in the Discord client.

Actual behavior

Message is logged in /tmp/openclaw/openclaw-YYYY-MM-DD.log as:
{"module":"discord-auto-reply"} {"channelId":"...","reason":"no-mention"} discord: skipping guild message

Raw Discord message data shows mentions[] empty, mention_roles[] populated with
the bot's own managed role ID. The preflight at
dist/extensions/discord/message-handler.preflight-*.js:630 only checks mentions[].

OpenClaw version

2026.4.26

Operating system

macOS 15 / Apple Silicon M4

Install method

npm global

Model

anthropic/claude-sonnet-4-6

Provider / routing chain

openclaw -> anthropic

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can be fixed by modifying the preflight checks to also consider mention_roles in addition to mentions.

Guidance

  • The problem arises because the preflight checks only look at mentions[], which is empty when a role mention is used, instead of also checking mention_roles[].
  • To fix this, the code at dist/extensions/discord/message-handler.preflight-*.js:630 needs to be updated to check both mentions[] and mention_roles[] for the bot's ID.
  • The update should ensure that the bot responds to messages where it is mentioned by role, not just by user ID.
  • Verification of the fix can be done by repeating the steps to reproduce and checking if the bot now correctly replies to the message.

Example

// Example of how the preflight check might be updated
if (mentions.includes(botId) || mention_roles.includes(botRoleId)) {
  // Bot is mentioned, proceed with reply
} else {
  // Bot is not mentioned, skip message
}

Notes

This fix assumes that mention_roles is populated correctly when a role mention is used, and that the bot's role ID is available for comparison.

Recommendation

Apply workaround: Update the preflight checks to consider both mentions and mention_roles to ensure the bot responds to role mentions.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Bot replies to the message, since the user-visible intent (mentioning the bot by name) is the same as a user-mention. The role and user mentions render
identically in the Discord client.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING