Skip to content

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.

Paste it into your assistant. It tells you what it will send or change before it runs live.

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

  1. When someone messages your Telegram bot, ClickRuntime receives the question.

  2. It reads your FAQ Google Doc, reusing a recent copy so it is not fetched for every message.

  3. AI writes a short answer using only what the document says, and says so when the answer is not there.

  4. 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

RunsThe moment it happens
Answer Telegram questions from your Google Docsjust nowSucceeded
Telegram · Guest help botCheck-in is from 3pm. The key box is to the left of the front door; the code is in your booking email.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
telegram_bot_answering_from_my_google_docs.pyexample
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?
The bot says it does not have that information and suggests contacting you directly. You can set the exact wording, such as your email address or phone number.
How quickly does it see edits to my document?
The document is reloaded at least every hour, so edits show up in answers soon after you save them. You can shorten that if your document changes often.
How long can the document be?
Up to roughly 50 pages of text works well. For longer material, split it into a few focused documents.
What permissions does it need?
doc read; bot token. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

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.