The moment it happens
Send payment screenshots to a Telegram bot and file them in Drive
Forward a payment screenshot to your Telegram bot and it replies with the amount, date and payer, and files the image in Drive.
- Runs
- The moment it happens
- Apps
- Google Drive, Telegram
- AI
- Yes, uses the built-in AI allowance
- Access
- Telegram bot token; Drive write
Send this to your assistant
Create a ClickRuntime automation: when I send a payment receipt screenshot to my bot, pull out the amount, date and payer, save the image to Drive and reply with the details.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A tutor gets paid by bank transfer and mobile payment apps. Parents send screenshots as proof of payment over chat, and those images end up scattered across conversations. At tax time, matching payments to lessons means scrolling back through months of messages.
This automation gives you a Telegram bot to forward each screenshot to. It reads the amount, date and payer, saves the image to a Drive folder and replies with what it found, so every payment has a filed record within seconds.
What you get out of it
Every receipt in one folder
Proof of payment is saved to Drive the moment you forward it, not lost in a chat history.
Check the details on the spot
The bot replies with the amount, date and payer, so you can confirm it read the screenshot correctly while it is in front of you.
Easier records at tax time
Files are named with the date and payer, so sorting a year of payments takes minutes instead of an evening.
Works from your phone
Forwarding an image to a bot is quicker than downloading it, renaming it and uploading it to Drive by hand.
How it works
What happens, step by step
ClickRuntime starts when you send a screenshot to your Telegram bot.
AI reads the image and picks out the amount, the date and who paid.
The image is saved in your Drive folder, named with those details.
The bot replies in Telegram with the amount, date, payer and a link to the file.
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
- 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 Drive and Telegram steps into one automation
Under the hood
The code that runs this automation
import base64
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaInMemoryUpload
from clickruntime import on_event, credentials, http, ai
FOLDER_ID, ALLOWED = "your-receipts-folder-id", {123456789}
SCHEMA = {"type": "object", "properties": {k: {"type": "string"} for k in ("amount", "date", "payer")}}
@on_event
def handle(event):
msg = (event.json or {}).get("message", {})
chat = msg.get("chat", {}).get("id")
if chat not in ALLOWED or not msg.get("photo"):
return {"skipped": True}
api = f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}"
path = http.get(f"{api}/getFile", params={"file_id": msg["photo"][-1]["file_id"]}).json()["result"]["file_path"]
image = http.get(f"{api.replace('/bot', '/file/bot')}/{path}").content
x = ai.generate(f"Payment screenshot caption: {msg.get('caption', '')}. Extract amount, date (YYYY-MM-DD) and payer.",
json_schema=SCHEMA, max_output_tokens=80).json
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
f = drive.files().create(body={"name": f"{x.get('date')} {x.get('payer')} {x.get('amount')}.jpg", "parents": [FOLDER_ID]},
media_body=MediaInMemoryUpload(image, mimetype="image/jpeg"), fields="id,webViewLink").execute()
http.post(f"{api}/sendMessage", json={"chat_id": chat,
"text": f"✅ {x.get('amount')} from {x.get('payer')} on {x.get('date')}\n{f['webViewLink']}"})
return {"file": f["id"]}FAQ
Common questions
What kinds of screenshots work?
Who can send images to the bot?
How are the files named?
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
Transcribe 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 worksGenerate images from Telegram messages and keep them in Drive
Describe an image to your Telegram bot and it sends back the picture and saves a copy in your Drive AI images folder.
See how it worksMessage a video idea to Telegram and get the finished video back
Send your Telegram bot a video idea and get a short generated video back in the chat, with a copy saved in your Drive Shorts folder.
See how it worksKeep exploring
Set up “Send payment screenshots to a Telegram bot and file them in Drive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.