Personal Telegram Secretary Bot

A seamless bridge between instant messaging and Google Calendar, hosted locally.

Discover the architecture
View Source Code
Telegram Bot Project Logo

Abstract

In a fast-paced digital environment, opening a calendar app to schedule a simple meeting can be a friction point. The goal of this project was to create a conversational interface using Telegram—an app I use daily—to interact directly with my Google Account. By leveraging the Telegram API and Google Calendar API, I created a "Secretary Bot" that parses natural language and manages my schedule automatically.

The Interface: Telegram

The frontend of this application is entirely chat-based. Using @BotFather, I registered a new bot identity on the Telegram network.

Instead of building a complex React or Vue UI, I utilized the chat interface which provides zero-latency interactions on both mobile and desktop. The bot listens for specific command triggers or natural language inputs, ready to parse dates and event titles.

Telegram BotFather Setup Interface

The Brain: Google Integration

Google Cloud Console API Dashboard

The core logic handles the authentication and data sync with Google Services.

  • Google Service Account: Used for secure server-to-server authentication without manual OAuth logins.
  • Calendar API: The bot allows reading upcoming events and inserting new ones (POST requests).
  • Chrome Integration: The system is linked to my main Google Chrome account, ensuring instant sync across all my devices.

The Home: Self Hosting

To ensure the "Secretary" is awake 24/7, I deployed the Python codebase on a Raspberry Pi.

This IoT approach allows for a low-power, always-on solution. The bot runs as a systemd service (or via Docker), ensuring it automatically restarts if the Pi reboots. This makes the architecture completely independent of third-party cloud hosting providers, giving me full control over the data flow.

Raspberry Pi Hosting Setup

Bot in Action

Watch how a simple text message converts into a real Google Calendar event in seconds.

Demo of the Telegram Bot adding an event