Install
openclaw skills install file-transferTransfers files intelligently based on chat context with MIME validation and progress tracking, supporting Telegram and extensible channels.
openclaw skills install file-transferContext-aware file transfer skill for OpenClaw ecosystem. Intelligently transfers files based on conversation context with progress tracking.
npm install file-transfer
import { FileTransferSkill } from 'file-transfer';
const skill = new FileTransferSkill({
channels: { telegram: { enabled: true } }
});
const result = await skill.sendFileWithContext({
file: '/path/to/document.pdf',
caption: 'Team weekly report',
context: { chatId: '-1003655501651' }
});
import { TelegramAdapter } from 'file-transfer/src/adapters/telegram-adapter.js';
const adapter = new TelegramAdapter();
const result = await adapter.sendFile({
filePath: '/path/to/file.pdf',
chatId: '-1003655501651',
caption: 'Document sharing'
});
Transfers a file with intelligent context detection.
Parameters:
file (string, required): Path to the filecaption (string, optional): File descriptioncontext (object, optional): Conversation context with chatIdReturns:
success (boolean): Transfer success statusmessageId (string): Message IDcontext (object): Context analysis result (scenario, urgency, confidence)stats (object): Transfer statistics (size, duration, channel)Retrieves file transfer history.
Parameters:
options (object, optional): Query optionsReturns:
history (array): Transfer history recordsstats (object): Transfer statisticsconst skill = new FileTransferSkill({
contextEngine: {
enableAI: false,
maxHistoryLength: 10
},
file: {
maxFileSize: 100 * 1024 * 1024, // 100MB
allowedMimeTypes: ['application/pdf', 'image/jpeg', ...]
},
channels: {
telegram: {
enabled: true,
maxFileSize: 50 * 1024 * 1024 // 50MB
}
}
});
The ContextEngine analyzes file transfers and returns:
| Field | Values | Description |
|---|---|---|
| scenario | share, backup, collaborate, archive | Transfer intent |
| urgency | low, medium, high, critical | Priority level |
| confidence | 0.0 - 1.0 | Analysis confidence |
| fileCategory | document, image, video, archive, code | File classification |
npm test # All tests
npm run test:unit # Unit tests
npm run test:integration # Integration tests
MIT License - see LICENSE for details.