mirror of https://github.com/openclaw/openclaw.git
Discord: map shared interactive sends in actions
This commit is contained in:
parent
474368d746
commit
bdc91130fe
|
|
@ -8,7 +8,9 @@ import { readDiscordParentIdParam } from "../../../../src/agents/tools/discord-a
|
|||
import { handleDiscordAction } from "../../../../src/agents/tools/discord-actions.js";
|
||||
import { resolveReactionMessageId } from "../../../../src/channels/plugins/actions/reaction-message-id.js";
|
||||
import type { ChannelMessageActionContext } from "../../../../src/channels/plugins/types.js";
|
||||
import { normalizeInteractiveReply } from "../../../../src/interactive/payload.js";
|
||||
import { readBooleanParam } from "../../../../src/plugin-sdk/boolean-param.js";
|
||||
import { buildDiscordInteractiveComponents } from "../shared-interactive.js";
|
||||
import { resolveDiscordChannelId } from "../targets.js";
|
||||
import { tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin.js";
|
||||
|
||||
|
|
@ -40,7 +42,9 @@ export async function handleDiscordMessageAction(
|
|||
if (action === "send") {
|
||||
const to = readStringParam(params, "to", { required: true });
|
||||
const asVoice = readBooleanParam(params, "asVoice") === true;
|
||||
const rawComponents = params.components;
|
||||
const rawComponents =
|
||||
params.components ??
|
||||
buildDiscordInteractiveComponents(normalizeInteractiveReply(params.interactive));
|
||||
const hasComponents =
|
||||
Boolean(rawComponents) &&
|
||||
(typeof rawComponents === "function" || typeof rawComponents === "object");
|
||||
|
|
|
|||
Loading…
Reference in New Issue