Summary
The Slack adapter does not respond to direct messages (DMs). When a user sends a message directly to the bot, the bot is silent.
Root Cause
In src/slack.rs, the "message" event handler only processes messages that are already in a thread (has_thread && ...):
if has_thread && !is_bot && !skip_subtype && !mentions_bot {
handle_message(...)
}
In DMs (message.im), the initial message has no thread_ts, so has_thread is false and the message is dropped silently. The app_mention branch also never fires in DMs because users cannot @mention the bot in a DM.
Affected Event Types
message with channel_type: "im" (DM channels, IDs start with D)
Proposed Fix
Detect DM channels via channel_type == "im" (or channel ID prefix D) and allow those messages through regardless of has_thread:
let channel_type = event["channel_type"].as_str().unwrap_or("");
let channel_id = event["channel"].as_str().unwrap_or("");
let is_dm = channel_type == "im" || channel_id.starts_with('D');
if (has_thread || is_dm) && !is_bot && !skip_subtype && !mentions_bot {
handle_message(...)
}
Tracking
Part of #382
Summary
The Slack adapter does not respond to direct messages (DMs). When a user sends a message directly to the bot, the bot is silent.
Root Cause
In
src/slack.rs, the"message"event handler only processes messages that are already in a thread (has_thread && ...):In DMs (
message.im), the initial message has nothread_ts, sohas_threadisfalseand the message is dropped silently. Theapp_mentionbranch also never fires in DMs because users cannot @mention the bot in a DM.Affected Event Types
messagewithchannel_type: "im"(DM channels, IDs start withD)Proposed Fix
Detect DM channels via
channel_type == "im"(or channel ID prefixD) and allow those messages through regardless ofhas_thread:Tracking
Part of #382