The moment it happens
Have your Telegram bot answer messages
Anyone who messages your bot gets a helpful reply straight away, and the bot remembers the last few messages.
- Runs
- The moment it happens
- Apps
- Telegram
- AI
- Yes, uses the built-in AI allowance
- Access
- bot token
Send this to your assistant
Create a ClickRuntime automation: have my Telegram bot reply to every message with a helpful answer and remember the last 10 messages of each chat.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Someone builds a Telegram bot for their community, store or newsletter, and soon gets questions at all hours: opening times, how to join, what a product costs. Answering personally means being online constantly, and a fixed menu bot feels stiff and cannot handle questions it was not built for. People who get no answer for hours simply stop messaging.
When a user writes to your bot, ClickRuntime receives the update, loads that chat's last ten or so messages from state so the conversation has context, asks ClickRuntime's built-in AI for a reply, and sends it with a typing indicator so the bot feels alive. The new messages are then saved for the next turn.
It is meant for community owners, small businesses and creators who want round-the-clock answers without hiring support.
What you get out of it
People get answers at any hour
A reply within seconds, even at 3 a.m., keeps visitors engaged instead of waiting until morning. Many questions are simple enough to resolve completely without human help. Visitors who get an answer straight away are far more likely to become customers.
Conversations feel natural
Because recent messages are remembered, a follow-up like what about the second option makes sense to the bot. Users talk normally instead of repeating context in every message. Nobody wants to repeat their question in every single message.
You spend less time on repeat questions
The same ten questions make up most messages. Letting the bot handle them leaves your time for the unusual cases that need judgment or a personal touch. You keep your attention for conversations that truly need you.
No AI account is required
The replies come from ClickRuntime's built-in AI, so there is no model key to buy, store or rotate. You can launch a smart bot using just a Telegram bot token.
Typing indicators make it feel responsive
The short typing signal before each reply tells users the bot is working on it. Small touches like that make people more patient and the bot feel less robotic. The bot feels attentive instead of mechanical.
How it works
What happens, step by step
When someone messages your Telegram bot, ClickRuntime receives it straight away.
It loads the last few messages of that chat so the reply has context.
AI writes a reply, while the bot shows that it is typing.
The reply is sent back in the chat, and the conversation is saved for next time.
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
- Change what the AI looks for, or how it writes the result
- 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, ai, state
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 {}
if not msg.get("text"):
return {"replied": False}
chat = msg["chat"]["id"]
tg("sendChatAction", chat_id=chat, action="typing")
history = state.get(f"chat:{chat}") or []
history.append(f"User: {msg['text'][:1000]}")
reply = ai.generate("\n".join(history[-10:]) + "\nAssistant:", system="You are a helpful, concise assistant.",
max_output_tokens=400).text
tg("sendMessage", chat_id=chat, text=reply)
state.set(f"chat:{chat}", (history + [f"Assistant: {reply[:1000]}"])[-10:])
return {"replied": True}FAQ
Common questions
How much of the conversation does the bot remember?
Can I give the bot facts about my business?
Is the bot available in groups or only in private chats?
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
Turn voice notes into text with a reply
Send your bot a voice note and get the transcript back with a short answer.
See how it worksSummarise any link with a bot command
Send /summary with a link and get a five-line summary of the page.
See how it worksTranslate messages you send your bot
Send your bot text in one language and get it back in another.
See how it worksKeep exploring
Set up “Have your Telegram bot answer messages” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.