Discord: own message tool components schema
This commit is contained in:
parent
4b5e801d1b
commit
05634eed16
@ -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") {
|
||||
|
||||
@ -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) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user