Skip to main content

Send File to Channel

Send a local file to the user via the current chat channel (Telegram, WhatsApp, Discord, Slack).

Installation

npm install @framers/agentos-ext-send-file-to-channel

Usage

import { createExtensionPack } from '@framers/agentos-ext-send-file-to-channel';

const pack = createExtensionPack();

Tool: send_file_to_channel

ParameterTypeRequiredDescription
filePathstringYesAbsolute path to the file to send
captionstringNoMessage to accompany the file

Example

User: "Send me pic.png from my Downloads"
Tool calls:
1. local_file_search({ query: "pic.png" })
2. send_file_to_channel({ filePath: "/Users/me/Downloads/pic.png", caption: "Here's your file!" })

Platform File Size Limits

PlatformLimit
Telegram50 MB
WhatsApp (Cloud API)100 MB
WhatsApp (Twilio)16 MB
Discord25 MB
Slack1 GB

When a file exceeds the platform limit, the tool returns an error suggesting compression:

"File is 60.0MB but telegram limit is 50MB. Would you like me to compress it first?"

Channel Context

This tool requires a ChannelContext to be injected by the ChatTaskResponder. It only works when invoked via a messaging channel — not in CLI or API mode.

License

MIT