Skip to content

feat: support Telegram image and file sending with captions#8

Open
eeee0717 wants to merge 6 commits intofastclaw-ai:devfrom
eeee0717:feat/telegram-media-caption
Open

feat: support Telegram image and file sending with captions#8
eeee0717 wants to merge 6 commits intofastclaw-ai:devfrom
eeee0717:feat/telegram-media-caption

Conversation

@eeee0717
Copy link
Copy Markdown

@eeee0717 eeee0717 commented Mar 27, 2026

Summary

This PR adds outbound Telegram attachment sending and makes it usable from agent tool calls.

What changed

  • add Telegram image sending for OutboundMessage.MediaPaths
  • add Telegram file/document sending for OutboundMessage.FilePaths
  • auto-route single images to sendPhoto
  • auto-route multiple images to sendMediaGroup
  • auto-route single files to sendDocument
  • auto-route multiple files to sendMediaGroup(InputMediaDocument)
  • split large image/file batches above Telegram's media group limit
  • use Text as the attachment caption/message when supported
  • send overflow text as a follow-up message when it exceeds Telegram caption limits
  • reject unsupported attachment combinations such as EditMsgID, inline buttons, or mixed image+file payloads
  • validate local image and file paths before sending
  • remove implicit Telegram media-group fallback; grouped sends now fail fast instead of silently degrading to independent messages

Agent/tooling updates

  • extend the message tool to support media_paths and file_paths
  • allow message tool calls to default to the current conversation route
  • inject current channel, account_id, and chat_id into tool execution context
  • add FILE: protocol support alongside the existing MEDIA: protocol for tool output attachment sending
  • update workspace prompt docs so the agent prefers message with media_paths / file_paths for local attachments

Testing

Manual verification

  • sent a single local image to Telegram successfully
  • sent multiple local images to Telegram successfully
  • sent a single local file to Telegram successfully
  • sent multiple local files as grouped documents successfully
  • verified local image/file sending can now be invoked through agent tooling in the current conversation
image

@eeee0717 eeee0717 changed the title feat: support Telegram image sending with captions feat: support Telegram image and file sending with captions Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant