From 88f68b7324fde736f1a6e2d40739970030a8955d Mon Sep 17 00:00:00 2001 From: Marcos Candeia Date: Mon, 14 Jul 2025 13:28:51 -0300 Subject: [PATCH] Use join channel differently from channel to send DM Signed-off-by: Marcos Candeia --- slack/actions/deco-chat/channels/invoke.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/slack/actions/deco-chat/channels/invoke.ts b/slack/actions/deco-chat/channels/invoke.ts index b557bb807..28af5a40d 100644 --- a/slack/actions/deco-chat/channels/invoke.ts +++ b/slack/actions/deco-chat/channels/invoke.ts @@ -14,14 +14,14 @@ export default async function invoke( if (challenge) { return { challenge }; } - const [channel, thread] = props.event.channel_type === "im" - ? [ctx.botUserId ?? props.event.channel, props.event.user] - : [props.event.channel, props.event.channel]; + const [joinChannel, channel, thread] = props.event.channel_type === "im" + ? [ctx.botUserId ?? props.event.channel, props.event.channel, props.event.user] + : [props.event.channel, props.event.channel, props.event.channel]; const linkProps = await ctx.appStorage.getItem( - ctx.cb.forTeam(props.event.team, channel), + ctx.cb.forTeam(props.event.team, joinChannel), ) ?? - undefined; + undefined; if (!linkProps) { return; } @@ -31,7 +31,7 @@ export default async function invoke( // avoid loops if ( botId && - props.type === "app_mention" && + (props.type === "app_mention" || props.event.channel_type === "im") && props.user === botId ) { return;