From 05634eed1692a428d7b7b9ae049980f3c971424e Mon Sep 17 00:00:00 2001 From: Gustavo Madeira Santana Date: Tue, 17 Mar 2026 23:48:04 +0000 Subject: [PATCH] Discord: own message tool components schema --- extensions/discord/src/channel-actions.ts | 9 +++++++++ extensions/discord/src/channel.ts | 2 ++ 2 files changed, 11 insertions(+) diff --git a/extensions/discord/src/channel-actions.ts b/extensions/discord/src/channel-actions.ts index 21f24fd9553..b77050d9c74 100644 --- a/extensions/discord/src/channel-actions.ts +++ b/extensions/discord/src/channel-actions.ts @@ -1,4 +1,5 @@ import { + createDiscordMessageToolComponentsSchema, createUnionActionGate, listTokenSourcedAccounts, } from "openclaw/plugin-sdk/channel-runtime"; @@ -110,6 +111,14 @@ export const discordMessageActions: ChannelMessageActionAdapter = { listTokenSourcedAccounts(listEnabledDiscordAccounts(cfg)).length > 0 ? (["interactive", "components"] as const) : [], + getToolSchema: ({ cfg }) => + listTokenSourcedAccounts(listEnabledDiscordAccounts(cfg)).length > 0 + ? { + properties: { + components: createDiscordMessageToolComponentsSchema(), + }, + } + : null, extractToolSend: ({ args }) => { const action = typeof args.action === "string" ? args.action.trim() : ""; if (action === "sendMessage") { diff --git a/extensions/discord/src/channel.ts b/extensions/discord/src/channel.ts index 29568ed58dc..780c04eb2e6 100644 --- a/extensions/discord/src/channel.ts +++ b/extensions/discord/src/channel.ts @@ -81,6 +81,8 @@ const discordMessageActions: ChannelMessageActionAdapter = { getDiscordRuntime().channel.discord.messageActions?.listActions?.(ctx) ?? [], getCapabilities: (ctx) => getDiscordRuntime().channel.discord.messageActions?.getCapabilities?.(ctx) ?? [], + getToolSchema: (ctx) => + getDiscordRuntime().channel.discord.messageActions?.getToolSchema?.(ctx) ?? null, extractToolSend: (ctx) => getDiscordRuntime().channel.discord.messageActions?.extractToolSend?.(ctx) ?? null, handleAction: async (ctx) => {