mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 01:51:24 +00:00
fix(agents): scope message tool schema by channel (#18215)
Co-authored-by: Shadow <shadow@openclaw.ai>
This commit is contained in:
@@ -26,6 +26,17 @@ export function supportsChannelMessageButtons(cfg: OpenClawConfig): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function supportsChannelMessageButtonsForChannel(params: {
|
||||
cfg: OpenClawConfig;
|
||||
channel?: string;
|
||||
}): boolean {
|
||||
if (!params.channel) {
|
||||
return false;
|
||||
}
|
||||
const plugin = getChannelPlugin(params.channel as Parameters<typeof getChannelPlugin>[0]);
|
||||
return plugin?.actions?.supportsButtons?.({ cfg: params.cfg }) === true;
|
||||
}
|
||||
|
||||
export function supportsChannelMessageCards(cfg: OpenClawConfig): boolean {
|
||||
for (const plugin of listChannelPlugins()) {
|
||||
if (plugin.actions?.supportsCards?.({ cfg })) {
|
||||
@@ -35,6 +46,17 @@ export function supportsChannelMessageCards(cfg: OpenClawConfig): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function supportsChannelMessageCardsForChannel(params: {
|
||||
cfg: OpenClawConfig;
|
||||
channel?: string;
|
||||
}): boolean {
|
||||
if (!params.channel) {
|
||||
return false;
|
||||
}
|
||||
const plugin = getChannelPlugin(params.channel as Parameters<typeof getChannelPlugin>[0]);
|
||||
return plugin?.actions?.supportsCards?.({ cfg: params.cfg }) === true;
|
||||
}
|
||||
|
||||
export async function dispatchChannelMessageAction(
|
||||
ctx: ChannelMessageActionContext,
|
||||
): Promise<AgentToolResult<unknown> | null> {
|
||||
|
||||
Reference in New Issue
Block a user