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.
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
You add your bot to the group and turn off its privacy mode so it can see every message.
As messages arrive, ClickRuntime keeps each one with the sender's name and time.
At 23:30 it writes the day's messages into a text file named with the date and saves it in your Drive folder.
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
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
- 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
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?
What happens to photos and files?
Do group members need to do anything?
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
Save files and photos sent to Telegram in Drive
Anything sent to your Telegram bot is filed in Drive in a folder for each sender and date, and the bot replies with the link.
See how it worksSearch Google Drive from a Telegram bot
Send your bot a few words and get back links to the matching files in your Google Drive, newest first.
See how it worksTranscribe voice notes sent to Telegram and save them to Drive
Send a voice note or audio file to your Telegram bot and get the text and a summary back, with both saved to your Transcripts folder.
See how it worksKeep exploring
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.