Skip to content

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.

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

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

  1. You send a message to your Telegram bot.

  2. AI works out whether you want to add an event or check a day, and picks out the title, date and time.

  3. To add an event, ClickRuntime creates it in your Google Calendar. To check a day, it reads your events for that date.

  4. 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

RunsThe moment it happens
Manage your Google Calendar by messaging a Telegram botjust nowSucceeded
Telegram · Calendar bot✅ Added Session with Dana (Acme Gym), Thu 6 Nov 07:00

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
  • 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

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.
add_and_check_calendar_events_by_telegram_message.pyexample
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?
Requests to add an event, such as "Lunch with Ana Friday 1pm", and questions about a day, such as "what do I have on Monday".
Can anyone message my bot and change my calendar?
No. It only acts on messages from your own Telegram account and ignores everyone else.
Does it check if I am free before adding an event?
Yes. If the time clashes with something already in your calendar, the bot tells you in its reply.
What permissions does it need?
calendar read+write; bot token. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly 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 “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.