Skip to content

Commit 42fa643

Browse files
committed
fix(slack): exclude DM channel IDs from direct lookup
DM (D...) channel IDs require im:*/mpim:* OAuth scopes, which the connector does not request. The regex now matches only public (C) and private (G) channel IDs to fail fast with a clearer error instead of hitting missing_scope from Slack.
1 parent 71f6256 commit 42fa643

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

apps/sim/connectors/slack/slack.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,9 @@ async function resolveChannel(
242242
): Promise<SlackChannel | null> {
243243
const trimmed = channelInput.trim().replace(/^#/, '')
244244

245-
// If it looks like a channel ID (starts with C, D, or G), try direct lookup
246-
if (/^[CDG][A-Z0-9]+$/.test(trimmed)) {
245+
// If it looks like a channel ID (public C / private G), try direct lookup.
246+
// DMs (D...) and MPIMs require im:*/mpim:* scopes, which we do not request.
247+
if (/^[CG][A-Z0-9]+$/.test(trimmed)) {
247248
try {
248249
const data = await slackApiGet('conversations.info', accessToken, { channel: trimmed })
249250
return data.channel as SlackChannel

0 commit comments

Comments
 (0)