The moment it happens
Manage your Google Calendar by messaging a Telegram bot
Text your Telegram bot to add an event or ask what is on a given day, and it updates or reads your Google Calendar for you.
- Runs
- The moment it happens
- Apps
- Google Calendar, Telegram
- AI
- Yes, uses the built-in AI allowance
- Access
- calendar read+write; bot token
Send this to your assistant
Create a ClickRuntime automation: when I message my Telegram bot, use AI to turn it into a Google Calendar event or answer what I have on a given day.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A personal trainer books clients between sessions, usually standing in a gym with a phone in one hand. Opening the calendar app, picking a date and typing the details takes long enough that he often forgets, and then double-books a slot later in the week.
This automation lets him handle his calendar the way he already messages people. He types "Dana Thursday 7am for an hour" or "what have I got Friday" to his bot, and the calendar is updated or read back to him.
What you get out of it
Add events in seconds
One short message replaces several taps through the calendar app, so events get added at the moment they are agreed.
Check your day without switching apps
Asking "what's on tomorrow" gives you a plain list of your events, right in the chat.
Natural wording works
You can write dates and times the way you would to a person, such as "next Tuesday after lunch".
Confirmation every time
The bot replies with exactly what it added, so you can catch a wrong date immediately.
How it works
What happens, step by step
You send a message to your Telegram bot.
AI works out whether you want to add an event or check a day, and picks out the title, date and time.
To add an event, ClickRuntime creates it in your Google Calendar. To check a day, it reads your events for that date.
The bot replies in Telegram with what it added or the list of events for that day.
Before it runs live
- Connect Google Calendar
- 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 Calendar 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 datetime import datetime, timedelta
from clickruntime import on_event, credentials, http, ai
MY_CHAT_ID = 123456789
@on_event
def handle(event):
m = (event.json or {}).get("message", {})
if m.get("chat", {}).get("id") != MY_CHAT_ID or "text" not in m:
return {"ignored": True}
schema = {"type": "object", "properties": {"intent": {"enum": ["add", "list"]}, "title": {"type": "string"},
"start": {"type": "string"}, "minutes": {"type": "integer"}}}
p = ai.generate(f"Today is {datetime.now():%A %Y-%m-%d}. Parse this calendar request; start as ISO local time: {m['text']}",
json_schema=schema, max_output_tokens=150).json
cal = build("calendar", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False).events()
start = datetime.fromisoformat(p["start"])
if p["intent"] == "add":
end = start + timedelta(minutes=p.get("minutes") or 60)
cal.insert(calendarId="primary", body={"summary": p["title"], "start": {"dateTime": start.isoformat(), "timeZone": "Europe/London"},
"end": {"dateTime": end.isoformat(), "timeZone": "Europe/London"}}).execute()
reply = f"✅ Added {p['title']}, {start:%a %d %b %H:%M}"
else:
day = start.replace(hour=0, minute=0)
items = cal.list(calendarId="primary", timeMin=day.isoformat() + "Z", timeMax=(day + timedelta(days=1)).isoformat() + "Z",
singleEvents=True, orderBy="startTime").execute().get("items", [])
reply = "\n".join(f"{e['start'].get('dateTime', '')[11:16]} {e.get('summary', '')}" for e in items) or "Nothing on."
http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage",
json={"chat_id": MY_CHAT_ID, "text": reply})
return {"intent": p["intent"]}FAQ
Common questions
What kind of messages does it understand?
Can anyone message my bot and change my calendar?
Does it check if I am free before adding an event?
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
Let customers book appointments through your Telegram bot
Customers message your Telegram bot, pick a free slot from buttons, and the booking appears in your Google Calendar.
See how it worksAdd website bookings to Google Calendar with a Telegram alert
Bookings from your website go straight into your calendar when you are free, and you get a Telegram message for each one.
See how it worksGet a Telegram reminder before each meeting
A few minutes before each meeting you get a Telegram message with the time, the join link and a short prep note.
See how it worksKeep exploring
Set up “Manage your Google Calendar by messaging a Telegram bot” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.