Send Telegram Notifications from Google Sheets Using Apps Script
Telegram's Bot API is one of the simplest messaging APIs to work with — no SDK required. Combined with Apps Script, you can fire off notifications, alerts, and reports to any Telegram chat.
Step 1 — Create a Telegram Bot
Open Telegram and search for @BotFather.
Send /newbot and follow the prompts to name your bot.
BotFather will give you a Bot Token — save it.
Start a chat with your new bot, then visit:
https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
Send a message to the bot first, then check the response for your chat_id.
functioncheckAndAlert(){const sheet =SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();const value = sheet.getRange('C2').getValue();const threshold =500;if(value > threshold){sendTelegramMessage(`⚠️ *Threshold Exceeded*\nCell C2 is currently *${value}*, above the limit of ${threshold}.`);}}
parse_mode: 'Markdown' supports *bold*, _italic_, `inline code`, and [link text](url).
For group chats, the chat_id is negative (e.g. -1001234567890). Get it the same way — send a message to the group with the bot added, then call getUpdates.
Telegram bots can only send messages to chats they are already a member of. Make sure the bot has been started or added to the group.
The Bot API is free and has generous rate limits — 30 messages/second to different chats, 1 message/second to the same chat.