From 0e9c6324446c21200022f154f60a499760899acc Mon Sep 17 00:00:00 2001 From: Hana Chang Date: Wed, 22 Apr 2026 23:51:36 +0800 Subject: [PATCH] fix(discord): use resolveDiscordChannelNameSafe for voice channel override name Applies the same safe-accessor pattern to the adjacent name field. If @buape/carbon implements name as a getter that also reads _rawData (like parentId), the previous `"name" in channel` pattern would throw for the same reason. Aligns with the fix for parentId in the same call site. --- extensions/discord/src/voice/command.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/extensions/discord/src/voice/command.ts b/extensions/discord/src/voice/command.ts index a06b6d8d9d4..7b5e63eb203 100644 --- a/extensions/discord/src/voice/command.ts +++ b/extensions/discord/src/voice/command.ts @@ -14,7 +14,10 @@ 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 { + resolveDiscordChannelNameSafe, + 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,7 +204,7 @@ export function createDiscordVoiceCommand(params: VoiceCommandContext): CommandW const access = await authorizeVoiceCommand(interaction, params, { channelOverride: { id: channel.id, - name: "name" in channel ? (channel.name as string) : undefined, + name: resolveDiscordChannelNameSafe(channel), parentId: resolveDiscordChannelParentIdSafe(channel), }, });