File tree Expand file tree Collapse file tree
slack/actions/deco-chat/channels Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,14 +14,14 @@ export default async function invoke(
1414 if ( challenge ) {
1515 return { challenge } ;
1616 }
17- const [ channel , thread ] = props . event . channel_type === "im"
18- ? [ ctx . botUserId ?? props . event . channel , props . event . user ]
19- : [ props . event . channel , props . event . channel ] ;
17+ const [ joinChannel , channel , thread ] = props . event . channel_type === "im"
18+ ? [ ctx . botUserId ?? props . event . channel , props . event . channel , props . event . user ]
19+ : [ props . event . channel , props . event . channel , props . event . channel ] ;
2020 const linkProps =
2121 await ctx . appStorage . getItem < JoinChannelProps & { installId : string } > (
22- ctx . cb . forTeam ( props . event . team , channel ) ,
22+ ctx . cb . forTeam ( props . event . team , joinChannel ) ,
2323 ) ??
24- undefined ;
24+ undefined ;
2525 if ( ! linkProps ) {
2626 return ;
2727 }
@@ -31,7 +31,7 @@ export default async function invoke(
3131 // avoid loops
3232 if (
3333 botId &&
34- props . type === "app_mention" &&
34+ ( props . type === "app_mention" || props . event . channel_type === "im" ) &&
3535 props . user === botId
3636 ) {
3737 return ;
You can’t perform that action at this time.
0 commit comments