A Telegram bot interface for executing FlowWeave workflows, specializing in media file processing and Arweave uploads. This bot allows users to upload media files to Arweave through a simple chat interface.
- Upload media files (images, documents, videos, audio) to Arweave
- Automatic file processing and status notifications
- Simple and intuitive command interface
- Real-time upload status tracking
- Secure and persistent file storage on Arweave
- Node.js (v14 or higher)
- pnpm package manager
- A Telegram Bot Token (obtain from @BotFather)
- Access to FlowWeave API endpoints
-
Clone the repository and install dependencies:
pnpm install
-
Create a
.envfile in the root directory and add your Telegram bot token:TELEGRAM_BOT_TOKEN=your_bot_token_here -
Build the TypeScript code:
pnpm build
-
Start the bot:
pnpm start
For development with hot-reload:
pnpm dev
/start- Initialize the bot and see available commands/workflows- List all available workflows/help- Show help information/execute_arweave- Start the Arweave upload workflow
- Start by sending
/execute_arweaveto select the Arweave upload workflow - Send any media file (supported types: images, documents, videos, audio)
- The bot will:
- Process your file
- Upload to Arweave
- Send you the Arweave URL once complete
Note: The bot only processes media files. Text messages (except commands) will be ignored.
The project uses TypeScript for type safety and better development experience. Key files:
src/index.ts- Main bot logic and command handlerssrc/types/workflow.ts- Type definitions for workflowssrc/types/api.ts- Type definitions for API responsessrc/services/arweave.service.ts- Arweave upload service implementation
The bot integrates with the following FlowWeave API endpoints:
/api/telegram/initialize- Bot initialization/api/telegram/start- Start bot service/api/telegram/files/recent- Check for new files/api/telegram/ardrive/files/{id}/cost- Get upload cost/api/telegram/ardrive/files/{id}/upload- Upload to Arweave/api/proxy/telegram/send- Send notifications
To add new workflows:
- Add new workflow types in
src/types/workflow.ts - Update the
availableWorkflowsarray insrc/index.ts - Implement the corresponding service in
src/services/
The bot includes comprehensive error handling for:
- File processing errors
- Insufficient funds for uploads
- API communication issues
- Invalid file types
ISC