The moment it happens
Ask a Telegram bot and get answers with sources
Ask your bot any question and get a short answer based on live Google results, with the links it used.
- Runs
- The moment it happens
- Apps
- SerpApi, Telegram
- AI
- Yes, uses the built-in AI allowance
- Access
- SerpApi key; bot token
Send this to your assistant
Create a ClickRuntime automation: when I ask my Telegram bot a question, search Google with SerpApi and reply with a short answer and the top three source links.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A sales rep is about to walk into a meeting and wants to know whether the prospect announced layoffs last month, or what a competitor's new product costs. Opening a browser on a phone, scanning ads and skimming five pages is slow, and AI chat tools without search often answer from old information.
This bot answers with what Google shows today. The rep types the question in Telegram, the bot searches with SerpApi, and AI writes a short answer from the top results, followed by the links so they can check before repeating it to a customer.
What you get out of it
Current answers, not stale ones
Answers come from today's search results, so questions about recent news, prices or announcements get recent answers. That matters for anything that changes month to month.
Sources you can check
Each reply lists the links it used. Before quoting a number to a client, you can tap through and confirm it.
Quick to use on the move
A Telegram message is faster than a browser search on a phone. It suits people between meetings, on the road, or on a shop floor.
Short answers, no scrolling
The bot reads the results so you do not have to. You get a few sentences that answer the question instead of a page of links and ads.
How it works
What happens, step by step
When you send a question to your Telegram bot, ClickRuntime runs a Google search for it through SerpApi.
It collects the titles and snippets of the top results, including any quick answer Google shows.
AI writes a short answer using only those results.
The answer and the top three source links are sent back to you in the same chat.
Before it runs live
- Connect SerpApi
- 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 SerpApi and Telegram steps into one automation
Under the hood
The code that runs this automation
from clickruntime import on_event, credentials, http, ai
@on_event
def handle(event):
msg = (event.json or {}).get("message") or {}
question = msg.get("text", "").strip()
if not question:
return {"ignored": True}
data = http.get("https://serpapi.com/search", params={"engine": "google", "q": question, "num": 8,
"api_key": credentials.secret("SERPAPI_API_KEY")}).json()
results = data.get("organic_results", [])[:6]
context = "\n".join(f"[{i + 1}] {r['title']}: {r.get('snippet', '')}" for i, r in enumerate(results))
if data.get("answer_box"):
context = f"Quick answer: {data['answer_box'].get('answer') or data['answer_box'].get('snippet', '')}\n" + context
answer = ai.generate(f"Question: {question}\n\nSearch results:\n{context}", system="Answer in 2 to 4 sentences using only the results. Say if they do not answer it.",
max_output_tokens=250).text.strip()
links = "\n".join(r["link"] for r in results[:3])
http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage",
json={"chat_id": msg["chat"]["id"], "text": f"{answer}\n\n{links}", "disable_web_page_preview": True})
return {"results": len(results)}FAQ
Common questions
How long are the answers?
Can it answer about a specific website?
Does it remember earlier questions?
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
Send a topic to Telegram and get researched social posts
Message your bot a topic and get back a LinkedIn post and a post for X, written from what is being said about it on the web right now.
See how it worksA Telegram assistant that searches the web when it needs to
Chat with your own assistant on Telegram that remembers the conversation and looks things up online when a question needs current information.
See how it worksFind promo codes for a shop from Telegram
Send a shop name to your bot and get a list of current discount codes found on the web, with what each one claims to offer.
See how it worksKeep exploring
Set up “Ask a Telegram bot and get answers with sources” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.
