-
-
Notifications
You must be signed in to change notification settings - Fork 55k
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Summary
OpenClaw does not currently route Discord GUILD_MEMBER_ADD (member join) events to agents. The only workaround is polling via a cron job that calls the Discord REST API with curl, which is unreliable — agents receive join notifications minutes or days late, and the approach leaks the bot token into process arguments.
Current behavior
- No
DiscordMemberAddListenerexists insrc/discord/monitor/listeners.ts - Agents that need to react to member joins (e.g. welcome bots) must poll Discord's REST API on a cron schedule
- The
guildMembersprivileged intent config key exists (channels.discord.intents.guildMembers) but enabling it has no effect — nothing consumesGUILD_MEMBER_ADDevents from the gateway
Expected behavior
When a user joins a Discord guild, the event is routed to the appropriate agent (via the existing binding/routing system) as a system event, the same way reactions and presence updates are handled today.
What's already in place
@buape/carbonexposesGuildMemberAddListener(andGuildMemberRemoveListener,GuildMemberUpdateListener) ready to extendsrc/discord/monitor/gateway-plugin.tsalready gates onintentsConfig?.guildMembersto setGatewayIntents.GuildMembersresolveAgentRoute()already acceptsguildIdandmemberRoleIds— no routing changes neededenqueueSystemEvent()is the established pattern for delivering non-message events to agent sessions (see reaction listener atsrc/discord/monitor/listeners.ts)
Proposed implementation
- Add
DiscordMemberAddListenerclass insrc/discord/monitor/listeners.tsextendingGuildMemberAddListener - In the handler: extract guild ID + user ID + member roles, call
resolveAgentRoute(), format a human-readable event text, queue viaenqueueSystemEvent() - Register the listener in
monitorDiscordProvider()(currentlysrc/discord/monitor/provider.ts~line 554) - Update docs (
docs/channels/discord.md) to document theintents.guildMembersconfig key and member event routing
Labels
feature, discord
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
staleMarked as stale due to inactivityMarked as stale due to inactivity