The moment it happens
Generate images from a bot command
Type /img and a description, and your bot sends back a generated image.
- Runs
- The moment it happens
- Apps
- Telegram
- AI
- Not needed
- Access
- bot token
Send this to your assistant
Create a ClickRuntime automation: when someone sends /img followed by a description to my Telegram bot, generate an image with my OpenAI key and send it back.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A designer or a hobbyist wants to try an idea for an image while away from a computer. Opening an image tool on a phone means logging in, finding the prompt box and waiting through menus. Sharing the result with friends means saving it and sending it again somewhere else. The creative spark often fades before the first image appears.
When you type /img followed by a description in your Telegram bot, ClickRuntime parses the command, sends the prompt to the image model you have connected with your own key, such as OpenAI's image API, and returns the picture with sendPhoto. The result appears right in the chat, where it can be forwarded to anyone.
It suits creators, teams brainstorming in a group chat and anyone who likes to experiment with prompts on the go.
What you get out of it
Ideas become images in a chat
Typing one line in an app you already have open is the quickest path from thought to picture. You can test a concept in seconds, while the idea is still fresh.
Sharing is instant
The picture arrives in the conversation, so friends or teammates can react right away. A group can iterate on a mascot or a poster together without exchanging files. Nobody has to download and re-upload a file just to show a friend a rough idea.
You choose your own image model
Because it uses your own key, you decide which provider and model generates the pictures. Your costs and quality settings are under your control, and you see usage on your own account.
Prompts become a shared habit
Teams who try it together learn what wording works. The chat history is a record of prompts and results that others can copy and improve on. Over a few weeks, the thread turns into a useful reference of what works.
No extra app is needed
There is nothing to install and nothing to log in to. Anyone with Telegram can use the bot, which makes it easy to share with non-technical colleagues. That makes it easy to hand to a client or a family member who just wants pictures.
How it works
What happens, step by step
When you send your Telegram bot a command such as /img followed by a description, ClickRuntime picks it up straight away.
It sends your description to your own image-generation account, such as OpenAI.
The bot replies in the chat with the finished image.
Before it runs live
- Connect Telegram
- Paste your automation's link into the other app's webhook settings
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Act only on the items that match your own rules, and skip the rest
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Telegram steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_event, http, credentials
def tg(method, **params):
r = http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/{method}", json=params)
r.raise_for_status()
return r.json()["result"]
@on_event
def handle(event):
msg = (event.json or {}).get("message") or {}
text = msg.get("text", "")
if not text.startswith("/img "):
return {"generated": False}
r = http.post("https://api.openai.com/v1/images/generations", timeout=60,
headers={"Authorization": f"Bearer {credentials.secret('OPENAI_API_KEY')}"},
json={"model": "dall-e-3", "prompt": text[5:500], "size": "1024x1024"})
r.raise_for_status()
tg("sendPhoto", chat_id=msg["chat"]["id"], photo=r.json()["data"][0]["url"], caption=text[5:200])
return {"generated": True}FAQ
Common questions
Which image model does it use?
Can I control image size or style?
Can anyone message the bot, or only me?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Read receipts you photograph
Send your bot a photo of a receipt and get the merchant, date and total back.
See how it worksGet error alerts from your tools on Telegram
Any system that can send to a link can now alert you on your phone.
See how it worksRun a support inbox and broadcasts through your bot
Messages to your bot reach your admin chat, you reply from there, and you can message everyone who started the bot.
See how it worksKeep exploring
Set up “Generate images from a bot command” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.