Learn how to harness the power of AI to create sophisticated Telegram bot commands without writing a single line of code. This guide covers everything from basic concepts to advanced techniques.
Our platform uses advanced language models to convert your plain English descriptions into production-ready Python code. Here's the process:
Tell the AI what you want your command to do in plain language. Be specific about inputs, processing, and desired outputs.
Example:
"Take a user's photo file and convert it to black and white, then send the converted photo back to the user"
The AI breaks down your request, identifies required inputs, determines output types, and plans the implementation logic.
AI generates complete Python code including imports, input validation, main logic, error handling, and output formatting.
from PIL import Image
import io
def process(photo_file):
img = Image.open(photo_file)
bw_img = img.convert('L')
output = io.BytesIO()
bw_img.save(output, format='PNG')
return output.getvalue()
Code is packaged with dependencies in an isolated microservice container and deployed to your bot instantly.
The quality of your command depends heavily on how well you describe it. Follow these principles:
Clearly state what inputs are needed and what output is expected.
Good: Take a user's name (text) and age (number) and generate a birthday greeting message
Bad: Make a greeting
Use clear verbs that describe what the command does.
Good: Fetch weather data from OpenWeather API using city name and return temperature and conditions
Bad: Weather stuff
Include all necessary details about data processing and formatting.
Good: Download CSV file from URL, parse it with pandas, filter rows where status='active', and send summary statistics
Bad: Process CSV
Use this template structure for consistent results:
1. Input Description: What data does the user provide?
2. Processing Steps: What should happen with that data?
3. Output Format: How should results be returned?
4. Special Requirements: Any error handling, validations, or edge cases?
Parameters define what information users must provide when using your command. Our platform supports various parameter types that automatically create conversation flows.
Free-form text input from the user
Example: Username, message content, description
Whole numbers
Example: Age, count, quantity, ID
Decimal numbers
Example: Price, temperature, percentage
True/false choice
Example: Enable feature, public/private
Any file upload (image, document, video)
Example: Photo to process, CSV to analyze
Image files specifically
Example: Profile picture, product image
Documents (PDF, DOCX, etc.)
Example: Contract, report, spreadsheet
Multiple values of the same type
Example: Tags, email addresses, IDs
When you define parameters, the platform automatically creates a conversational flow that:
Your bot commands can send responses using any Telegram message type. You can also combine multiple output types in a single command to send different message types based on your command's logic.
A single command can return different output types depending on its logic. For example:
Simply select multiple output types when creating your command!
Plain text message with formatting (Markdown/HTML)
Best for: Status updates, text results, confirmations
Max: 4,096 characters
Send images (JPG, PNG, GIF) with optional caption
Best for: Generated images, processed photos, charts, diagrams
Max: 10 MB per photo, 1024 char caption
Send any file type (PDF, Excel, ZIP, etc.)
Best for: Reports, exports, generated documents, CSVs
Max: 50 MB per file
Send video files (MP4, MOV) with thumbnail
Best for: Video processing, animations, tutorials, clips
Max: 50 MB per video
Send audio files (MP3, M4A) with metadata
Best for: Audio processing, music, podcasts, voice synthesis
Max: 50 MB per audio file
Send GIF or short video animations
Best for: Animated graphics, GIF creation, motion graphics
H.264/MPEG-4 AVC video without sound
Send voice messages (OGG with OPUS)
Best for: Text-to-speech, voice notes, audio memos
Displays as waveform in chat
Send rounded square video messages
Best for: Video messages, video memos (max 1 minute)
Rounded square MPEG4 format
Create interactive polls or quizzes
Best for: Surveys, voting, quizzes, feedback collection
2-10 options, quiz mode available
Share geographic coordinates and live location
Best for: Maps, location services, tracking, directions
Supports live location updates
Share location with venue details (name, address)
Best for: Business locations, event venues, POI information
Includes Foursquare/Google Places
Share contact information (phone, name, vCard)
Best for: Contact sharing, vCard generation, networking
Supports full vCard format
Send animated dice, darts, or casino emojis
Best for: Games, random number generation, entertainment
🎲 🎯 🏀 ⚽ 🎳 🎰
Send 2-10 photos or videos as an album
Best for: Photo galleries, multiple files, image collections
Photos and videos in single message
Show "typing..." or upload indicators
Best for: Long-running commands, improving UX
typing, upload_photo, record_video, etc.
No message sent (background processing)
Best for: Data logging, webhook handlers, silent updates
Command executes without sending output
Make money directly through your bot! The sendPaidMedia output type allows you to sell exclusive photos and videos to users for Telegram Stars.
"Generate a high-quality AI image based on the user's text prompt using DALL-E. Send it as paid media for 50 stars. Include a caption explaining what was generated."
💡 Tip: Combine with other output types to send a preview message before the paid content!
Request user input mid-command! Your bot commands can dynamically ask users for additional information during execution using the built-in request_user_input() function.
Unlike pre-defined parameters (collected before command execution), interactive input allows your command logic to:
Example: "What's your email address?"
Example: "How many items do you want? (1-10)"
Example: "Choose format: [PDF] [Excel] [CSV]"
💡 Pro Tip: In your AI prompt, simply say "ask the user for [input type]" and the AI will generate code using request_user_input(). Example: "Ask the user if they want to proceed using buttons (Yes/No)"
Learn from these proven command patterns used by successful bots on our platform.
AI Prompt:
"Fetch current weather data from OpenWeather API using the city name provided by the user. Return a formatted message with temperature in Celsius, weather conditions, humidity, and wind speed. Handle API errors gracefully."
Parameters:
city_name (str)Output:
sendMessage
AI Prompt:
"Accept a CSV file from the user, parse it with pandas, calculate summary statistics (mean, median, max, min) for numeric columns, and generate a bar chart visualization. Return both the statistics as text and the chart as an image."
Parameters:
csv_file (document)Output:
sendMessage + sendPhoto
AI Prompt:
"Send an email via Gmail API using OAuth authentication. Accept recipient email, subject, and message body from the user. Validate email format and handle authentication errors. Confirm when email is sent successfully."
Parameters:
recipient (str)subject (str)body (str)Parameters:
csv_file (document)Output:
sendMessage + sendPhoto
AI Prompt:
"Send an email via Gmail API using OAuth authentication. Accept recipient email, subject, and message body from the user. Validate email format and handle authentication errors. Confirm when email is sent successfully."
Parameters:
recipient (str)subject (str)body (str)Output:
sendMessage
Requires Gmail OAuth
Solutions:
Solutions:
Solutions:
Create workflows by having one command trigger another using webhooks or shared workspace files.
Reference environment variables in your prompts for API keys and configuration:
"Fetch data from API at API_ENDPOINT using API_KEY from environment variables"
Commands can read from and write to their workspace:
"Load configuration from config.json in the workspace, process user data accordingly, and save results to output.csv"
When creating commands that need OAuth, mention it clearly:
"Using Gmail OAuth, send an email with the provided subject and body to the recipient. Authenticate the user if not already authorized."
Start your free trial and build professional bot commands in minutes.
Start Building Now →