feat(discord): route GUILD_MEMBER_ADD events to agents#24000
Open
pdd-cli wants to merge 2 commits intoopenclaw:mainfrom
Open
feat(discord): route GUILD_MEMBER_ADD events to agents#24000pdd-cli wants to merge 2 commits intoopenclaw:mainfrom
pdd-cli wants to merge 2 commits intoopenclaw:mainfrom
Conversation
aa948ec to
7a01a67
Compare
adc3184 to
b18f307
Compare
added 2 commits
February 28, 2026 10:55
Adds a DiscordMemberAddListener that fires when a user joins a Discord guild and delivers a system event to the matched agent session. Gated on the existing intents.guildMembers privileged intent flag (must also be enabled in the Discord Developer Portal). Opt-in per guild via memberJoinNotifications: 'on' (default: 'off' to avoid high-volume floods on existing deployments). Closes openclaw#23978
b18f307 to
ad3a2c7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DiscordMemberAddListenerthat fires when a user joins a Discord guild and delivers a system event to the matched agent sessionintents.guildMembersprivileged intent flag (must also be enabled in Discord Developer Portal)memberJoinNotifications: "on"(default:"off"to avoid high-volume floods on existing deployments)Motivation
Without this, the only way to react to member joins was a polling cron that called the Discord REST API directly every few minutes — unreliable, leaks the bot token into process args, and caused welcome messages to arrive hours or days late.
Config
{ "channels": { "discord": { "intents": { "guildMembers": true }, "guilds": { "YOUR_GUILD_ID": { "memberJoinNotifications": "on" } } } } }Test plan
pnpm tsgo— no errorspnpm test src/discord/monitor/— 118 tests pass[discord] GuildMembers intent enabled — member-add listener registeredCloses #23978
🤖 Generated with Claude Code
Greptile Summary
Adds support for Discord
GUILD_MEMBER_ADDevents by introducing a newDiscordMemberAddListenerthat fires system events when users join guilds. The implementation follows existing patterns from the reaction listener, includes proper opt-in configuration (memberJoinNotifications: "on"), and correctly gates the feature on theguildMembersprivileged intent.DiscordMemberJoinNotificationModetype with "off" (default) and "on" valuesguildIdandmemberRoleIdsfor proper agent selectionintents.guildMembersis enabledConfidence Score: 5/5
src/discord/monitor/). No logic errors or security issues detected.Last reviewed commit: aa948ec
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!