18 lines
614 B
TypeScript
18 lines
614 B
TypeScript
import { loadConfig } from "../../config/config.js";
|
|
import type { AnyAgentTool } from "./common.js";
|
|
import { handleTelegramAction } from "./telegram-actions.js";
|
|
import { TelegramToolSchema } from "./telegram-schema.js";
|
|
|
|
export function createTelegramTool(): AnyAgentTool {
|
|
return {
|
|
label: "Telegram",
|
|
name: "telegram",
|
|
description: "Manage Telegram reactions.",
|
|
parameters: TelegramToolSchema,
|
|
execute: async (_toolCallId, args) => {
|
|
const params = args as Record<string, unknown>;
|
|
const cfg = loadConfig();
|
|
return await handleTelegramAction(params, cfg);
|
|
},
|
|
};
|
|
}
|