From 021d03eb0ba6a2cbb5425fb55712bb41de341c8e Mon Sep 17 00:00:00 2001 From: Nakano Kenji Date: Mon, 16 Feb 2026 04:00:11 +0800 Subject: [PATCH] fix(discord): add DIRECT_MESSAGES intent to enable DM support * fix(discord): add DIRECT_MESSAGES intent to enable DM support * fix(discord): allow DMs to bypass guild_id filter --------- Co-authored-by: Moeblack --- src/channels/discord.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/channels/discord.rs b/src/channels/discord.rs index 5e83b4d..baf8321 100644 --- a/src/channels/discord.rs +++ b/src/channels/discord.rs @@ -146,7 +146,7 @@ impl Channel for DiscordChannel { "op": 2, "d": { "token": self.bot_token, - "intents": 33281, // GUILDS | GUILD_MESSAGES | MESSAGE_CONTENT | DIRECT_MESSAGES + "intents": 37377, // GUILDS | GUILD_MESSAGES | MESSAGE_CONTENT | DIRECT_MESSAGES "properties": { "os": "linux", "browser": "zeroclaw", @@ -258,9 +258,12 @@ impl Channel for DiscordChannel { // Guild filter if let Some(ref gid) = guild_filter { - let msg_guild = d.get("guild_id").and_then(serde_json::Value::as_str).unwrap_or(""); - if msg_guild != gid { - continue; + let msg_guild = d.get("guild_id").and_then(serde_json::Value::as_str); + // DMs have no guild_id — let them through; for guild messages, enforce the filter + if let Some(g) = msg_guild { + if g != gid { + continue; + } } }