-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Description
Summary
Add support for receiving and responding to Discord Components v2 interactions (button clicks, select menu choices) from messages sent by agents.
Problem to solve
Currently, agents can send rich interactive messages with buttons and select menus using Components v2, but when users click these buttons or make selections, the interactions disappear into a black hole. Agents cannot receive INTERACTION_CREATE events or respond to them, making interactive UI elements non-functional. This limits agents to static, one-way communication in Discord, forcing workarounds like reaction-based interactions or external polling.
Proposed solution
Implement gateway intent handling for MESSAGE_COMPONENT and route interaction events to agent sessions. Add two new tool actions:
- receive_interaction — Poll or stream interaction events with optional filters (messageId, customId, userId)
- respond_interaction — Acknowledge, edit the source message, defer response, or send a follow-up
Alternatives considered
Inject interaction events as system messages to the originating session, letting agents respond naturally in conversation flow.
Impact
- Affected: All Discord channel users wanting interactive experiences
- Severity: Medium-High (blocks modern Discord bot patterns)
- Frequency: Any time rich UI is desired
- Consequence: Agents appear broken when users click non-functional buttons; forces less elegant interaction patterns
Evidence/examples
- Discord's official Components v2 docs: https://discord.com/developers/docs/components/overview
- Current OpenClaw support: Can send components, cannot receive interactions
- Comparable: Most modern Discord bot frameworks (discord.js, discord.py) support interaction handling natively
Additional information
- Must handle Discord's 3-second interaction response timeout
- Should support deferral for long-running operations (up to 15 min follow-up)
- Consider session-aware routing (match interactions to originating session)
- Backward compatible — opt-in via new tool actions