From 5c5fa5f38bcc03a3f93b2a6a0ad9eb43c98fc893 Mon Sep 17 00:00:00 2001 From: Hana Chang Date: Wed, 22 Apr 2026 21:55:53 +0800 Subject: [PATCH] fix(discord): use resolveDiscordChannelParentIdSafe in voice command path #69908 switched native slash commands, listeners, and the model picker to the safe accessor for partial thread channels, but the voice /join command still reads channel.parentId through the unsafe "parentId" in channel pattern. Route it through the same helper so the voice command path does not crash with "Cannot access rawData on partial Channel" when invoked from inside a thread on @buape/carbon >=0.16. --- extensions/discord/src/voice/command.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extensions/discord/src/voice/command.ts b/extensions/discord/src/voice/command.ts index 8205d20e984..a06b6d8d9d4 100644 --- a/extensions/discord/src/voice/command.ts +++ b/extensions/discord/src/voice/command.ts @@ -14,6 +14,7 @@ import type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime"; import type { DiscordAccountConfig } from "openclaw/plugin-sdk/config-runtime"; import { formatMention } from "../mentions.js"; import { normalizeDiscordSlug } from "../monitor/allow-list.js"; +import { resolveDiscordChannelParentIdSafe } from "../monitor/channel-access.js"; import { resolveDiscordChannelInfo } from "../monitor/message-utils.js"; import { resolveDiscordSenderIdentity } from "../monitor/sender-identity.js"; import { resolveDiscordThreadParentInfo } from "../monitor/threading.js"; @@ -201,10 +202,7 @@ export function createDiscordVoiceCommand(params: VoiceCommandContext): CommandW channelOverride: { id: channel.id, name: "name" in channel ? (channel.name as string) : undefined, - parentId: - "parentId" in channel - ? ((channel as { parentId?: string }).parentId ?? undefined) - : undefined, + parentId: resolveDiscordChannelParentIdSafe(channel), }, }); if (!access.ok) {