From 9252021c9c7b0d27991bbaccf96e73273181043c Mon Sep 17 00:00:00 2001 From: rudi193-cmd Date: Fri, 12 Jun 2026 06:44:57 -0600 Subject: [PATCH] fix(discord): ignore thread recap system messages Filter Discord message types so thread-creation recaps (type 18) do not trigger Claude on the parent channel. Fixes #230. Co-authored-by: Cursor --- .claude-plugin/marketplace.json | 2 +- .claude-plugin/plugin.json | 2 +- src/commands/discord.ts | 10 ++++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 2965c7a7..f5430793 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -8,7 +8,7 @@ "name": "claudeclaw", "source": "./", "description": "Cron-like daemon that runs Claude prompts on a schedule", - "version": "1.0.39", + "version": "1.0.40", "keywords": [ "cron", "heartbeat", diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 9e77a27c..2688e3ab 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,5 +1,5 @@ { "name": "claudeclaw", - "version": "1.0.39", + "version": "1.0.40", "description": "Cron-like daemon that runs Claude prompts on a schedule" } diff --git a/src/commands/discord.ts b/src/commands/discord.ts index ee39c0da..3199ec34 100644 --- a/src/commands/discord.ts +++ b/src/commands/discord.ts @@ -79,6 +79,12 @@ interface DiscordMessage { type: number; } +const enum DiscordMessageType { + Default = 0, + Reply = 19, + ThreadCreated = 18, +} + interface DiscordInteraction { id: string; type: number; // 2=APPLICATION_COMMAND, 3=MESSAGE_COMPONENT @@ -740,6 +746,10 @@ async function handleMessageCreate(token: string, message: DiscordMessage, skipC // Ignore bot messages if (message.author.bot) return; + // Ignore system message types (thread creation recap, pins, etc.) — only process + // regular messages (0) and replies (19) to avoid spurious prompts on the parent channel. + if (message.type !== DiscordMessageType.Default && message.type !== DiscordMessageType.Reply) return; + const userId = message.author.id; const channelId = message.channel_id; const isDM = !message.guild_id;