mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 16:13:43 +00:00
fix(discord): align message action send parameters
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import type { AgentToolResult } from "@mariozechner/pi-agent-core";
|
import type { AgentToolResult } from "@mariozechner/pi-agent-core";
|
||||||
import type { DiscordActionConfig } from "../../config/config.js";
|
import type { DiscordActionConfig } from "../../config/config.js";
|
||||||
import type { DiscordSendComponents, DiscordSendEmbeds } from "../../discord/send.shared.js";
|
import type { DiscordSendComponents, DiscordSendEmbeds } from "../../discord/send.shared.js";
|
||||||
import { readDiscordComponentSpec } from "../../discord/components.js";
|
|
||||||
import {
|
import {
|
||||||
createThreadDiscord,
|
createThreadDiscord,
|
||||||
deleteMessageDiscord,
|
deleteMessageDiscord,
|
||||||
|
|||||||
@@ -37,14 +37,11 @@ export async function handleDiscordMessageAction(
|
|||||||
const asVoice = params.asVoice === true;
|
const asVoice = params.asVoice === true;
|
||||||
const rawComponents = params.components;
|
const rawComponents = params.components;
|
||||||
const components =
|
const components =
|
||||||
rawComponents &&
|
rawComponents && (Array.isArray(rawComponents) || typeof rawComponents === "function")
|
||||||
(Array.isArray(rawComponents) ||
|
|
||||||
typeof rawComponents === "function" ||
|
|
||||||
(typeof rawComponents === "object" && !Array.isArray(rawComponents)))
|
|
||||||
? rawComponents
|
? rawComponents
|
||||||
: undefined;
|
: undefined;
|
||||||
const content = readStringParam(params, "message", {
|
const content = readStringParam(params, "message", {
|
||||||
required: !asVoice && !components,
|
required: !asVoice,
|
||||||
allowEmpty: true,
|
allowEmpty: true,
|
||||||
});
|
});
|
||||||
// Support media, path, and filePath for media URL
|
// Support media, path, and filePath for media URL
|
||||||
|
|||||||
Reference in New Issue
Block a user