mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 14:04:31 +00:00
fix(slack): fail closed on slash command channel type lookup
This commit is contained in:
@@ -34,6 +34,7 @@ import {
|
||||
} from "./allow-list.js";
|
||||
import { resolveSlackChannelConfig, type SlackChannelConfigResolved } from "./channel-config.js";
|
||||
import { buildSlackSlashCommandMatcher, resolveSlackSlashCommandConfig } from "./commands.js";
|
||||
import { normalizeSlackChannelType } from "./context.js";
|
||||
import { isSlackChannelAllowedByPolicy } from "./policy.js";
|
||||
import { deliverSlackSlashReplies } from "./replies.js";
|
||||
|
||||
@@ -176,8 +177,9 @@ export function registerSlackMonitorSlashCommands(params: {
|
||||
}
|
||||
|
||||
const channelInfo = await ctx.resolveChannelName(command.channel_id);
|
||||
const channelType =
|
||||
const rawChannelType =
|
||||
channelInfo?.type ?? (command.channel_name === "directmessage" ? "im" : undefined);
|
||||
const channelType = normalizeSlackChannelType(rawChannelType, command.channel_id);
|
||||
const isDirectMessage = channelType === "im";
|
||||
const isGroupDm = channelType === "mpim";
|
||||
const isRoom = channelType === "channel" || channelType === "group";
|
||||
|
||||
Reference in New Issue
Block a user