The moment it happens
Save 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.
- Runs
- The moment it happens
- Apps
- Google Docs, Telegram
- AI
- Yes, uses the built-in AI allowance
- Access
- bot token; doc edit
Send this to your assistant
Create a ClickRuntime automation: when I send a voice note to my Telegram bot, transcribe it, add tags and append it to my Journal Google Doc. When I send a photo, save it and add a link to it in the same doc.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A researcher has ideas on walks and reads printed papers with notes in the margins. Voice memos pile up unplayed in one app, photos of pages sit in the camera roll, and none of it is searchable when she needs it.
Sending each one to a Telegram bot puts spoken notes in one dated, tagged Google Doc as text, with photos linked alongside them. Ideas captured on the move end up in one place she can search and quote later.
What you get out of it
Ideas captured in seconds
Recording a voice note is faster than typing on a phone. The thought is saved before it is gone.
One dated journal for everything
Spoken notes become searchable text, and photos sit next to them in the same doc. Finding an idea from last month is a search, not a scroll through media.
Tags make it easy to review
Each voice note gets a few topic tags. Pulling together notes on one project is quicker.
No new app to learn
You use the Telegram chat you already have open. The journal grows without a separate notes app.
How it works
What happens, step by step
You send a voice note or a photo to your Telegram bot.
For a voice note, ClickRuntime sends the audio to a transcription service and AI adds two or three topic tags.
For a photo, it saves the image to your Google Drive and keeps a link to it.
The dated entry, either the transcript or the photo link with your caption, is added to your Journal Google Doc and the bot confirms.
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 json
from datetime import date
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, ai
DOC_ID, FOLDER_ID = "your-journal-doc-id", "your-drive-folder-id"
@on_event
def handle(event):
msg = (event.json or {}).get("message") or {}
media = msg.get("voice") or (msg.get("photo") or [None])[-1]
if not media:
return {"skipped": True}
token = credentials.secret("TELEGRAM_BOT_TOKEN")
path = http.get(f"https://api.telegram.org/bot{token}/getFile", params={"file_id": media["file_id"]}).json()["result"]["file_path"]
data, name = http.get(f"https://api.telegram.org/file/bot{token}/{path}").content, path.split("/")[-1]
if msg.get("voice"):
text = http.post("https://api.openai.com/v1/audio/transcriptions", headers={"Authorization": f"Bearer {credentials.secret('OPENAI_API_KEY')}"},
data={"model": "whisper-1"}, files={"file": (name, data)}).json()["text"]
try:
tags = ai.generate(f"Give 3 short topic tags, comma-separated, for:\n{text[:4000]}", max_output_tokens=30).text.strip()
except ai.AIError:
tags = "voice note"
else:
up = http.post("https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart&fields=webViewLink",
headers={"Authorization": f"Bearer {credentials.connection('google', 'work')}"},
files={"metadata": ("m", json.dumps({"name": name, "parents": [FOLDER_ID]}), "application/json"), "file": (name, data)}).json()
tags, text = "photo", f"{msg.get('caption', '')} {up['webViewLink']}".strip()
docs = build("docs", "v1", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).documents()
end = docs.get(documentId=DOC_ID).execute()["body"]["content"][-1]["endIndex"] - 1
docs.batchUpdate(documentId=DOC_ID, body={"requests": [{"insertText": {"location": {"index": end},
"text": f"\n\n{date.today().isoformat()} [{tags}]\n{text}"}}]}).execute()
http.post(f"https://api.telegram.org/bot{token}/sendMessage", json={"chat_id": msg["chat"]["id"], "text": f"Saved [{tags}]"})
return {"saved": True}FAQ
Common questions
How long can a voice note be?
What happens to photos?
Is the original audio kept?
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 worksAnswer 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.
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 worksKeep exploring
Set up “Save Telegram voice notes and photos into a Google Doc journal” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.