Chloe

Reference

@chloejs/core/tools/telegram

Sending a message on Telegram to somebody the channel already knows.

The tool for an agent on Telegram: sending a message to someone the channel already knows, without waiting for them to write first.

import * as telegram from "@chloejs/core/tools/telegram";
tools: { telegramSendMessage: telegram.sendMessage({ who: ["12345"], when: "..." }) }

sendMessage

sendMessagefunction

export function sendMessage({ who, when, channel = "telegram" }: { who: string[]; when: string; channel?: string })

Makes a tool that lets the model send a Telegram message to someone.

The model chooses the recipient and the text. It can write only to people in the who list, and only while the agent's Telegram channel is running.

Options:

  • who: Telegram user ids the model may send to. Required.
  • when: when the model should use the tool, in your own words. Added to the tool's description. Required.
  • channel: the name of the agent's Telegram channel. Default: "telegram".

Needs a telegramChannel on the agent.

plugins/telegram/tools.ts:26