From c71c45150ee67238f72e5810c2872ebe85a3118c Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 6 Mar 2026 12:03:42 -0800 Subject: [PATCH] feat: add ignoreBotReactions config toggle for Discord (#508) --- src/channels/discord.ts | 7 ++++++- src/config/types.ts | 1 + src/main.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/channels/discord.ts b/src/channels/discord.ts index 757d70a..a729629 100644 --- a/src/channels/discord.ts +++ b/src/channels/discord.ts @@ -34,6 +34,7 @@ export interface DiscordConfig { attachmentsMaxBytes?: number; groups?: Record; // Per-guild/channel settings agentName?: string; // For scoping daily limit counters in multi-agent mode + ignoreBotReactions?: boolean; // Ignore all bot reactions (default: true). Set false for multi-bot setups. } export function shouldProcessDiscordBotMessage(params: { @@ -434,7 +435,11 @@ Ask the bot owner to approve with: user: import('discord.js').User | import('discord.js').PartialUser, action: InboundReaction['action'] ): Promise { - if ('bot' in user && user.bot) return; + // By default ignore all bot reactions; when ignoreBotReactions is false, + // only ignore self-reactions (allows multi-bot setups) + const ignoreBots = this.config.ignoreBotReactions ?? true; + if (ignoreBots && 'bot' in user && user.bot) return; + if (!ignoreBots && user.id === this.client?.user?.id) return; try { if (reaction.partial) { diff --git a/src/config/types.ts b/src/config/types.ts index c2f1d21..40a33f8 100644 --- a/src/config/types.ts +++ b/src/config/types.ts @@ -372,6 +372,7 @@ export interface DiscordConfig { instantGroups?: string[]; // Guild/server IDs or channel IDs that bypass batching listeningGroups?: string[]; // @deprecated Use groups..mode = "listen" groups?: Record; // Per-guild/channel settings, "*" for defaults + ignoreBotReactions?: boolean; // Ignore all bot reactions (default: true). Set false for multi-bot setups. } /** diff --git a/src/main.ts b/src/main.ts index c38dcff..9063753 100644 --- a/src/main.ts +++ b/src/main.ts @@ -468,6 +468,7 @@ function createChannelsForAgent( attachmentsMaxBytes, groups: agentConfig.channels.discord.groups, agentName: agentConfig.name, + ignoreBotReactions: agentConfig.channels.discord.ignoreBotReactions, })); }