🔹 Context
The client managed social media content for a small business and needed to switch between multiple apps to generate platform-sized images (Instagram, Facebook) while also handling day-to-day messaging with an AI assistant. Image requests and conversations were handled manually, with no single tool covering both. Image generation relied on separate design tools, resized manually for each platform.
🔹 Problem
- Generating custom images required switching between multiple tools/apps, adding extra steps to a simple content request
- No single bot could handle both conversation and platform-specific image requests, forcing the user to juggle two separate workflows
- Errors and failed requests weren't communicated back to the user, leading to unclear situations where it wasn't obvious if a request succeeded or silently failed
- This made day-to-day content creation slower than necessary and created friction for a task that should have been simple
🔹 Solution
Built a single Telegram bot that routes each message based on intent instead of requiring separate tools:
- Detects user intent via keyword commands ("insta", "fb") to trigger image generation in the correct format/size for each platform
- Generates platform-optimized images (Instagram size, Facebook size) on demand, removing manual resizing
- Falls back to a conversational AI assistant (ChatGPT-style) for regular messages, so the same bot handles both chat and image generation
- Sends real-time "typing" chat actions and error messages if generation fails, so the user always knows the request status
A single-bot, intent-routed approach was chosen over separate bots per platform to keep the user experience in one chat window and avoid duplicating logic across multiple bots.
🔹 Process
- Discovery — reviewed the required image formats/sizes per platform and the existing manual workflow
- Design — planned the routing logic to separate chat, Instagram, and Facebook image requests within one bot
- Build — Telegram Trigger + message preprocessing; Switch node for routing (start / insta / fb / fallback); OpenAI integration for both text responses and sized image generation; dedicated Telegram output nodes (text, photo, error handling)
- Testing — verified correct routing per keyword, correct image dimensions per platform, and error handling on failed generation
- Launch & optimization — deployed the bot and refined error messaging and fallback behavior based on real usage