Table of contents
I keep my to-do list in Google Tasks, but I rarely open the Tasks app itself. I add, change, and close tasks by talking to Gemini, and every morning a small Google Apps Script sends me a Telegram message with two lists: what I missed and what is due today. The whole setup is free, needs no server, and takes about twenty minutes.
In this article I'll walk through the full setup, step by step.
The idea
The setup has two independent flows that share one data source, your default Google Tasks list:
You ──voice/text──▶ Gemini ──▶ Google Tasks
│
(every morning) ▼
Google Apps Script ──▶ Telegram Bot API ──▶ Your chat
Gemini never talks to Telegram, and the script never talks to Gemini. Google Tasks is the only thing they have in common, so you can replace either side later without touching the other.
What you need
script.google.comStep 1: Manage tasks with Gemini
Gemini can work with Google Tasks once the Google Tasks app is connected:
Here are a few requests that work well:
Add a task "Pay the electricity bill" for tomorrow.
Move "Pay the electricity bill" to Monday.
Rename the dentist task to "Dentist at 10:00".
Mark "Renew domain" as done.
What tasks do I have for this week?
Always give a due date. The morning report only looks at tasks that have one, so a task with no date never shows up in Telegram.
Step 2: Create a Telegram bot
The Telegram side is simple: instead of OAuth, the script uses a static bot token.
/newbot and follow the prompts to pick a name and a username.7123456789:AAF....BOT_TOKEN.getUpdates returns an empty result if the bot has never received a message.<YOUR_TOKEN> with your actual token.https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
Look for "chat": {"id": ...} in the JSON response and copy that number. It is your CHAT_ID.
/revoke to BotFather to get a new one.
Step 3: Create the Apps Script project
script.google.com and click New project. Give it a name, for example Tasks Telegram Report.Tasks object available.UrlFetchApp). This is your own script, so it is safe to allow. On the "Google hasn't verified this app" screen, choose Advanced → Go to project.
Step 4: The morning report script
Full script
Replace the contents of Code.gs with the script below and fill in BOT_TOKEN and CHAT_ID:
const BOT_TOKEN = '<your-token>';
const CHAT_ID = '<your-chat-id>';
function runTasksReport() {
const { message } = getTasksBySections();
sendTelegramMessage(BOT_TOKEN, CHAT_ID, message);
}
function getTasksBySections() {
const now = new Date();
const startOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate());
const endOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
const overdueTasks = [];
const todayTasks = [];
const response = Tasks.Tasks.list('@default', {
showCompleted: false,
maxResults: 100
});
const items = response.items || [];
items.forEach(task => {
if (!task.title || !task.due) return;
// `due` is an RFC 3339 string such as "2026-11-26T00:00:00.000Z".
// Google Tasks stores only the date, so we take the UTC calendar day
// and rebuild it as a local date to compare with "today".
const dueDateUtc = new Date(task.due);
const dueDay = new Date(
dueDateUtc.getUTCFullYear(),
dueDateUtc.getUTCMonth(),
dueDateUtc.getUTCDate()
);
if (dueDay < startOfToday) {
overdueTasks.push(task);
} else if (dueDay <= endOfToday) {
todayTasks.push(task);
}
});
let message = '';
if (overdueTasks.length > 0) {
message += '⚠️ *Overdue:*\n';
overdueTasks.forEach(t => {
const formattedDate = Utilities.formatDate(new Date(t.due), 'UTC', 'dd.MM.yyyy');
message += `• ${escapeMarkdown(t.title)} (${formattedDate})\n`;
});
message += '\n';
}
if (todayTasks.length > 0) {
message += '📌 *Today:*\n';
todayTasks.forEach(t => {
message += `• ${escapeMarkdown(t.title)}\n`;
});
}
if (!message) {
message = 'No open tasks for today and nothing overdue. 🎉';
}
Logger.log(message);
return { overdueTasks, todayTasks, message };
}
function sendTelegramMessage(botToken, chatId, text) {
if (!botToken || !chatId) {
throw new Error('BOT_TOKEN or CHAT_ID is not set.');
}
const url = `https://api.telegram.org/bot${botToken}/sendMessage`;
const payload = {
chat_id: String(chatId),
text: text,
parse_mode: 'Markdown'
};
const options = {
method: 'post',
contentType: 'application/json',
payload: JSON.stringify(payload),
muteHttpExceptions: true
};
const response = UrlFetchApp.fetch(url, options);
const code = response.getResponseCode();
const body = response.getContentText();
if (code !== 200) {
Logger.log(`Telegram API error (${code}): ${body}`);
throw new Error(`Failed to send the Telegram message. Response code: ${code}`);
}
Logger.log('Message sent to Telegram.');
}
// Escape characters that break Telegram's legacy Markdown parser
function escapeMarkdown(str) {
return String(str).replace(/([_*`\[])/g, '\\$1');
}
Select runTasksReport in the toolbar and click Run. A message should appear in Telegram within a second or two.
How it works
runTasksReport is the entry point that the trigger calls. It builds the message and sends it.Tasks.Tasks.list('@default', ...) reads your default list. showCompleted: false skips finished tasks, and maxResults: 100 is the largest page the API returns.due and sends it as midnight UTC. Converting the UTC day into a local Date keeps a task due on the 26th on the 26th, whatever your time zone.sendTelegramMessage posts JSON to sendMessage. muteHttpExceptions: true makes a failed request return its response instead of throwing, so the script can log Telegram's real error before failing.escapeMarkdown puts a backslash before _, *, `, and [. Without it, a task like fix_build would make Telegram reject the whole message with 400 Bad Request: can't parse entities.pageToken, and call Tasks.Tasklists.list() to go through every list instead of only @default.
Step 5: Schedule the morning trigger
You can set up the trigger in the UI: open Triggers (the alarm-clock icon), click Add Trigger, and choose runTasksReport, Time-driven, Day timer, 7am to 8am.
Or create it from code by running this function once:
function createMorningTrigger() {
// Remove old copies so the report isn't sent twice
ScriptApp.getProjectTriggers()
.filter(t => t.getHandlerFunction() === 'runTasksReport')
.forEach(t => ScriptApp.deleteTrigger(t));
ScriptApp.newTrigger('runTasksReport')
.timeBased()
.everyDays(1)
.atHour(7)
.create();
}
Apps Script runs daily triggers at some point within the chosen hour, not at an exact minute. For a morning summary that is usually fine.
Keeping secrets out of the code
Hard-coded constants are fine while you're trying things out. If you ever share the project or copy the code somewhere, move them into Script Properties instead. Go to Project Settings → Script Properties, add BOT_TOKEN and CHAT_ID, then replace the two constants with:
const props = PropertiesService.getScriptProperties();
const BOT_TOKEN = props.getProperty('BOT_TOKEN');
const CHAT_ID = props.getProperty('CHAT_ID');
The rest of the script stays the same, and the token is no longer in the source.
Summary
getUpdates gives you the chat ID directly from the API.sendMessage.Once it's running, you never have to remember to check your list: every morning the list comes to you.
