Skip to content

The moment it happens

Save Telegram group messages to Google Drive daily

Your bot collects the messages in a Telegram group through the day and saves them as one dated text file in Google Drive each night.

Runs
The moment it happens
Apps
Google Drive, Telegram
AI
Not needed
Access
bot token (privacy mode off or bot as admin to see all group messages); Drive file write (drive.file)

Send this to your assistant

Create a ClickRuntime automation: collect every message posted in my team's Telegram group, and at 23:30 each day save that day's messages as a text file in my "Telegram archive" Google Drive folder.

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

Work groups on Telegram carry real decisions: delivery changes, prices agreed with a supplier, who is covering which shift. Telegram's own export is manual and runs only from the desktop app, so most groups never get backed up.

This automation keeps a plain, searchable copy in Google Drive without anyone having to remember. Your bot collects each message as it arrives and writes one dated file per day into the folder you choose.

It suits small teams, clubs and businesses that run day-to-day work through a Telegram group and want a record they control.

What you get out of it

  • A record that does not depend on Telegram

    If a message is deleted or a member leaves, the day's file in Drive still has what was said.

  • Searchable with Drive

    Plain text files are indexed by Drive, so you can find a supplier name or price months later.

  • One file per day

    Dated file names make it easy to jump to the day a decision was made.

  • Nothing to remember

    No manual exports. The file appears every night whether or not anyone thought about it.

  • Easy to share

    Give an accountant or new team member access to the folder instead of forwarding screenshots.

How it works

What happens, step by step

  1. You add your bot to the group and turn off its privacy mode so it can see every message.

  2. As messages arrive, ClickRuntime keeps each one with the sender's name and time.

  3. At 23:30 it writes the day's messages into a text file named with the date and saves it in your Drive folder.

  4. The next day starts with an empty list, so each file holds one day.

Before it runs live

  • Connect Google Drive
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Save Telegram group messages to Google Drive dailyjust nowSucceeded
Google Drive · Telegram archive2026-11-09 Ops team.txt [08:14] Priya: Van 2 is at the depot, keys at reception [08:20] Tom: Thanks, picking up at 9 [13:02] Priya: Client moved delivery to Thursday … 46 messages

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
  • 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 Google Drive 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.
save_telegram_group_messages_to_google_drive_daily.pyexample
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaInMemoryUpload
from datetime import datetime, timezone
from clickruntime import on_trigger, credentials, state

GROUP_ID, FOLDER_ID = -1001234567890, "your-archive-folder-id"

@on_trigger
def run(event):
    update = event.get("json") or {}
    msg = update.get("message")
    if msg:  # webhook: a new group message
        if msg.get("chat", {}).get("id") != GROUP_ID:
            return {"skipped": True}
        who = msg.get("from", {}).get("first_name", "someone")
        when = datetime.fromtimestamp(msg["date"], timezone.utc).strftime("%H:%M")
        text = msg.get("text") or msg.get("caption") or "[" + next((k for k in ("photo", "document", "voice", "sticker") if k in msg), "media") + "]"
        lines = state.get("buffer") or []
        lines.append(f"[{when}] {who}: {text}")
        state.set("buffer", lines)
        return {"buffered": len(lines)}
    lines = state.get("buffer") or []  # schedule: write the day's file
    if not lines:
        return {"saved": 0}
    drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    name = f"{event.get('scheduled_time', '')[:10]} group chat.txt"
    drive.files().create(body={"name": name, "parents": [FOLDER_ID]},
                         media_body=MediaInMemoryUpload("\n".join(lines).encode(), mimetype="text/plain")).execute()
    state.set("buffer", [])
    return {"saved": len(lines)}

FAQ

Common questions

Can it save messages from before I added the bot?
No. Telegram bots only receive messages sent after they join, so the archive starts on the day you add the bot.
What happens to photos and files?
The text file records them as [photo] or [document] with any caption. Ask your assistant to also download each file into a dated subfolder if you want the media kept too.
Do group members need to do anything?
No. Once the bot is in the group with privacy mode off, it sees messages like any member. It is good practice to tell the group that messages are archived.
What permissions does it need?
bot token (privacy mode off or bot as admin to see all group messages); Drive file write (drive.file). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's 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 “Save Telegram group messages to Google Drive daily” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.