#Telegram message tool

1 messages · Page 1 of 1 (latest)

warped inlet
#

In docs I found this regarding the message tool OpenClaw agents use to send a Telegram message with voice note.

Message action example:
{
action: "send",
channel: "telegram",
to: "123456789",
media: "https://example.com/voice.ogg",
asVoice: true,
}

I want the agent to always include the transcript together with the voice note. Is there a field in the message tool that accepts text so that it is sent together with the voice file in the same message?

ancient stratusBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

supple vaporBOT
#

Yes — for Telegram send with media you can include text via caption (or message). OpenClaw will use that text as the caption on the voice note as long as Telegram allows it.

Example:

{
  action: "send",
  channel: "telegram",
  to: "123456789",
  media: "https://example.com/voice.ogg",
  asVoice: true,
  caption: "Transcript: ...",
}

Notes / gotchas:

#
  • Both message and caption are accepted; internally Telegram-send picks message first, then falls back to caption. (So if you pass both, message “wins”.)
    Source: src/channels/plugins/actions/telegram.ts lines 24-30.
  • Telegram captions have a length limit. If the transcript is too long, OpenClaw automatically splits: it sends the voice note without a caption and then sends the transcript as a follow-up text message.
    Source: src/telegram/send.ts lines 588-595 and 715+.

Docs reference for the voice note send action: https://docs.openclaw.ai/channels/telegram (section “Audio, video, and stickers”). Source in repo: docs/channels/telegram.md lines 545-563.

warped inlet
#

What is the command the agent uses to send voice note with caption? For example, message(media=path)

supple vaporBOT
#

Use the message tool with action: "send" and pass both the audio and the text:

JSON-style (what the agent effectively sends)

{
  action: "send",
  channel: "telegram",
  to: "123456789",
  media: "/absolute/path/to/voice.ogg", // can be URL or local path
  asVoice: true,
  caption: "Transcript: …",
}

Shorthand “function call” style (as shown in some docs/examples)

#
message(
  action="send",
  channel="telegram",
  to="123456789",
  media="/absolute/path/to/voice.ogg",
  asVoice=true,
  caption="Transcript: …",
)

Notes:

  • You can also use message: "..." instead of caption: "..." (Telegram send picks message first if both are present), but I’d use caption to make the intent explicit.
  • If the transcript is too long for a Telegram caption, OpenClaw will fall back to sending it as a separate follow-up text message (Telegram caption limit).
warped inlet
#

If I'm using the "openclaw message send" command, is there the option to set asVoice=true?