Bug
When a bot (e.g. chaodu) sends a message containing a role mention (<@&ROLE_ID>) in a thread, the other bots who are members of that role do not respond.
The same role mention from a human user in a thread works correctly.
Root Cause
Discord does not auto-add thread members for role mentions sent by bots. When a bot posts <@&ROLE_ID> in a thread, Discord renders it visually but does NOT:
- Add the role's members to the thread
- Deliver the message event to bots that are not thread members
When a human user mentions the same role, Discord's client adds the role members to the thread, so they receive the event.
┌─────────────────────────────────────────────────────────────┐
│ Thread (created by chaodu) │
│ │
│ chaodu: "@一群法師 大家好!" │
│ ▲ │
│ │ Discord renders role mention visually │
│ │ BUT does NOT add role members to thread │
│ │ → other bots never receive the message event │
│ │
│ ❌ baidu, pudu, juedu, koudu: (no event received) │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ Thread (same or different) │
│ │
│ human: "@一群法師 你們好" │
│ ▲ │
│ │ Discord client adds role members to thread │
│ │ → all bots receive the message event │
│ │
│ ✅ baidu, pudu, juedu, koudu: (respond normally) │
└─────────────────────────────────────────────────────────────┘
Proposed Fix
When OAB sends a message containing a role mention (<@&ID> where ID is in allowed_role_ids), and the target channel is a thread, explicitly add the role's bot members to the thread via:
PUT /channels/{thread_id}/thread-members/{user_id}
This ensures the other bots are thread members before the message is delivered, so they receive the event and can respond.
Workarounds
- Mention each bot by user ID (
<@BOT_ID>) instead of role — direct mentions auto-add to threads
- Send role mentions in the main channel instead of a thread
Environment
- OAB on ECS Fargate (us-east-1)
- Discord, serenity 0.12
allow_bot_messages = "mentions"
allowed_role_ids configured on all bots
Bug
When a bot (e.g. chaodu) sends a message containing a role mention (
<@&ROLE_ID>) in a thread, the other bots who are members of that role do not respond.The same role mention from a human user in a thread works correctly.
Root Cause
Discord does not auto-add thread members for role mentions sent by bots. When a bot posts
<@&ROLE_ID>in a thread, Discord renders it visually but does NOT:When a human user mentions the same role, Discord's client adds the role members to the thread, so they receive the event.
Proposed Fix
When OAB sends a message containing a role mention (
<@&ID>where ID is inallowed_role_ids), and the target channel is a thread, explicitly add the role's bot members to the thread via:This ensures the other bots are thread members before the message is delivered, so they receive the event and can respond.
Workarounds
<@BOT_ID>) instead of role — direct mentions auto-add to threadsEnvironment
allow_bot_messages = "mentions"allowed_role_idsconfigured on all bots