The moment it happens
Answer Telegram questions from your Google Docs
People ask your Telegram bot a question and get an answer based only on your FAQ or policy Google Doc.
- Runs
- The moment it happens
- Apps
- Google Docs, Telegram
- AI
- Yes, uses the built-in AI allowance
- Access
- doc read; bot token
Send this to your assistant
Create a ClickRuntime automation: when someone asks my Telegram bot a question, answer it using only the content of my FAQ Google Doc.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A holiday rental host gets the same questions from guests every week: check-in times, parking, the wifi password, how the heating works. The answers are all in a house guide in Google Docs, but guests message instead of reading it, often late at night.
This automation turns that document into a Telegram bot. Guests or customers ask in their own words and get a short answer drawn only from your document. When the document changes, the bot's answers change with it.
What you get out of it
Answers at any hour
Questions at midnight or during a busy day get an answer straight away. You are no longer the help desk for questions you have already written down.
One document stays the source
You keep editing your Google Doc as you always have. There is no separate knowledge base or chatbot setup to maintain.
Answers stay on script
The bot is told to answer only from your document and to say when it does not know. That keeps it from guessing about refunds, prices or rules.
Works for any audience
A rental house guide, a club's rules, an internal HR policy or a product FAQ all work the same way. One bot per document, or one bot across a few.
How it works
What happens, step by step
When someone messages your Telegram bot, ClickRuntime receives the question.
It reads your FAQ Google Doc, reusing a recent copy so it is not fetched for every message.
AI writes a short answer using only what the document says, and says so when the answer is not there.
The answer is sent back to the person in the same Telegram chat.
Before it runs live
- Connect Google Docs
- 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 Google Docs and Telegram steps into one automation
Under the hood
The code that runs this automation
import time
from clickruntime import on_event, credentials, http, state, ai
DOC_ID = "your-faq-doc-id"
def doc_text():
cached = state.get("doc") or {}
if time.time() - cached.get("at", 0) < 3600:
return cached["text"]
text = http.get(f"https://www.googleapis.com/drive/v3/files/{DOC_ID}/export", params={"mimeType": "text/plain"},
headers={"Authorization": f"Bearer {credentials.connection('google', 'work')}"}).text[:100000]
state.set("doc", {"text": text, "at": time.time()})
return text
@on_event
def handle(event):
msg = (event.json or {}).get("message") or {}
question = msg.get("text", "")
if not question or question.startswith("/"):
return {"skipped": True}
try:
answer = ai.generate(f"Document:\n{doc_text()}\n\nQuestion: {question[:500]}", max_output_tokens=300,
system="Answer only from the document, briefly. If it is not covered, say you don't know and suggest contacting us.").text
except ai.AIError:
answer = "Sorry, I can't answer right now. Please try again a little later."
http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage",
json={"chat_id": msg["chat"]["id"], "text": answer, "reply_to_message_id": msg["message_id"]})
return {"answered": True}FAQ
Common questions
What happens when the answer is not in the document?
How quickly does it see edits to my document?
How long can the document be?
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
Chat with a Telegram assistant that remembers you
Your Telegram bot answers using the notes in your Memory Google Doc, and adds anything new you tell it to that doc.
See how it worksSummarise YouTube videos from Telegram into a Google Doc
Send a YouTube link to your Telegram bot and get a summary back, saved in your Video notes doc as well.
See how it worksSave Telegram voice notes and photos into a Google Doc journal
Voice notes you send to Telegram are transcribed and tagged, and photos are added to the same journal doc with a link, all in date order.
See how it worksKeep exploring
Set up “Answer Telegram questions from your Google Docs” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.