这是indexloc提供的服务,不要输入任何密码
Skip to content

tr4m0ryp/Telegram_Calander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SheetSmarts - Google Calendar to Telegram Bot

A Google Apps Script that automatically sends your daily Google Calendar schedule to a Telegram chat. Perfect for staying organized and getting daily schedule reminders.

Features

  • 📅 Automatically fetches events from your Google Calendar
  • 📱 Sends formatted daily schedule to Telegram
  • ⏰ Configurable daily trigger timing
  • 🎯 Clean, readable message formatting
  • 📍 Shows event locations (when available)
  • 🔧 Easy setup through Google Sheets interface

Setup Instructions

1. Create a Telegram Bot

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow the instructions
  3. Choose a name and username for your bot
  4. Copy the Bot Token (you'll need this later)
  5. Start a chat with your new bot and send any message

2. Get Your Telegram Chat ID

  1. Send a message to your bot
  2. Visit: https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
  3. Look for the "chat":{"id": field in the response
  4. Copy the Chat ID (it's a number, could be negative)

3. Get Your Google Calendar ID

  1. Open Google Calendar
  2. Click on the three dots next to your calendar name
  3. Select "Settings and sharing"
  4. Scroll down to "Calendar ID" and copy it
  5. It looks like: your.email@gmail.com or randomstring@group.calendar.google.com

4. Set Up Google Sheets

  1. Create a new Google Sheets document
  2. Create a sheet named "Settings" (exactly as shown)
  3. Set up the configuration as shown in the example below:
A B C
1 SheetSmarts Configuration
2
3 Setting Value
4 Bot Token <YOUR_BOT_TOKEN>
5 Chat ID <YOUR_CHAT_ID>
6
7 Calendar ID <YOUR_CALENDAR_ID>
8
9 Daily Send Time 7:00:00 AM
10
11 Header Text 🗓️ Your Schedule for Today

Important: The configuration must be in column C (C5, C6, C8, C10, C12)

5. Add the Google Apps Script

  1. In your Google Sheets, go to Extensions → Apps Script
  2. Delete the default myFunction() code
  3. Copy and paste the entire calander.js code
  4. Save the project (Ctrl+S)
  5. Authorize the script when prompted

6. Test the Setup

  1. In Google Sheets, you should see a new "SheetSmarts" menu
  2. Click SheetSmarts → Send Test Message to verify Telegram connection
  3. Click SheetSmarts → Send Today's Events Now to test calendar integration

7. Set Up Daily Automation

  1. Click SheetSmarts → Install Daily Schedule Trigger
  2. The script will automatically send your schedule at the time specified in C10

Configuration Details

Settings Sheet Layout

Cell Setting Description Example
C5 Bot Token Your Telegram bot token from BotFather 123456789:ABCdefGHIjklMNOpqrSTUvwxyz
C6 Chat ID Your Telegram chat ID 123456789 or -987654321
C8 Calendar ID Your Google Calendar ID your.email@gmail.com
C10 Daily Send Time When to send daily schedule 7:00:00 AM
C12 Header Text Custom header for messages 🗓️ Your Schedule for Today

Message Format

The bot sends messages in this format:

🗓️ Your Schedule for Today: (Wednesday, 3 Sep 2025)

• 09:00–11:00: Meeting with Team
  📍 Conference Room A

• 14:00–15:30: Project Review

• 18:00–19:00: Dinner with Friends
  📍 Restaurant XYZ

Generated by SheetSmarts

Menu Options

Menu Item Description
Send Test Message Sends a test message to verify Telegram connection
Send Today's Events Now Manually sends today's schedule
Install Daily Schedule Trigger Sets up automatic daily sending
Uninstall Daily Schedule Trigger Removes automatic sending
Update Daily Schedule Trigger Updates the trigger time

Troubleshooting

Common Issues

  1. "Telegram send failed"

    • Check your Bot Token (C5)
    • Verify Chat ID (C6)
    • Make sure you've started a chat with your bot
  2. "Calendar not found"

    • Verify your Calendar ID (C8)
    • Ensure the calendar is accessible to your Google account
  3. No events showing

    • Check if events exist for today
    • Verify calendar permissions
    • Check the script timezone matches your calendar
  4. Trigger not working

    • Ensure time format in C10 is correct (e.g., 7:00:00 AM)
    • Check script permissions are granted
    • Verify trigger is installed via the menu

Getting Help

  1. Check the View → Logs in Apps Script for error messages
  2. Use SheetSmarts → Send Test Message to verify basic connectivity
  3. Ensure all settings in the Settings sheet are correctly filled

Advanced Configuration

Custom Time Zones

The script uses your Google account's timezone by default. Events are displayed in this timezone.

Multiple Calendars

To use multiple calendars, you would need to modify the script to loop through multiple calendar IDs.

Message Threading

The script is configured to send messages to topic ID 63. To change this, modify the message_thread_id value in the code.

Privacy & Security

  • Your bot token and chat ID are stored in your private Google Sheets
  • Only you have access to your calendar data
  • Messages are sent directly from Google to Telegram
  • No external services store your data

License

This project is open source. Feel free to modify and distribute as needed.

Files

  • calander.js - The main Google Apps Script code
  • SheetSmarts-Example.csv - Example spreadsheet with proper configuration
  • README.md - This documentation file

Telegram_Calander

About

A SImple tool that pushes forward you Google Calander Appointment into Telegram

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published