A Telegram bot that turns inbox processing into a tap-driven conversation. Every thought you send gets captured to your second brain, and
/dailywalks you through your GTD inbox one item at a time with inline buttons.
I had 50+ captured thoughts piling up in my GTD inbox: voice notes, messages, emails, random ideas from the day. Processing them meant sitting at a computer, context-switching away from whatever I was actually doing, and working through each one in a text conversation. A 30-item inbox turned into a 90-minute ordeal. I kept avoiding it, the inbox kept growing, and important next actions got lost in the noise.
The GTD method says the clarify-to-zero step should be fast and reflexive. It wasn’t.
A Telegram bot that does two things:
Captures everything passively. Text messages become thoughts. Voice notes get transcribed and captured. Action items get auto-extracted into GTD tasks. This already existed.
Processes the inbox with one command. Send /daily from your phone. The bot walks you through every inbox item one at a time, with a keyboard of buttons below each one:
📥 Inbox ▓▓▓▓░░░░░░░░ 4/12
send in invoice for payment
🎯 Next ⏳ Wait 💭 Someday
✅ Done 🗑 Drop 📂 Project
ℹ️ Context ⏭ Skip 🛑 End
Each tap is one decision:
When the last item is done, the bot sends a summary: today’s calendar, do-now tasks, due today, overdue, and stale waiting-for items.
Each inbox item appears as a single message with decision buttons. Tap one and the card updates in place.
“Next” opens a sub-flow: context → priority → due date. Four taps total.
After the last item, the bot renders today’s calendar, do-now tasks, overdue, and stale waiting-for.
/cancel only clears the session; no task mutation is ever reverted.gtd_review_sessions table; the function reads it, acts, writes it back. Sessions carry a short-id prefix in every callback payload so stale buttons from a restarted session fail loud instead of silently corrupting state.Stack: Supabase Edge Functions (Deno/TypeScript), Postgres with gtd_* schema, Telegram Bot API (inline keyboards + callback queries), Google Calendar service account, Groq Whisper (voice transcription), OpenRouter (embedding + metadata extraction for captures).
The daily review flow is implemented as a single Edge Function that branches on Telegram update type:
callback_query → handleCallback → resolves session by chat_id + short prefix, validates cursor, dispatches to per-action handler.message.text starting with / → command router (/daily, /cancel, /status, /help).message.text when a session has pending_stage != null → consumed as free-text follow-up (delegate name, project name).Two helper Edge Functions support it: gtd_task_context (pulls the source thought for the ℹ️ Context button) and gtd_calendar_today (wraps the Google Calendar API for the /status command and the end-of-review summary).
/daily), bot shows: “📥 Inbox 1/N” + title + buttons.Needs:
TELEGRAM_BOT_TOKEN, OPENROUTER_API_KEY, GROQ_API_KEY, and (optional but recommended) GOOGLE_SERVICE_ACCOUNT_EMAIL / GOOGLE_PRIVATE_KEY / GOOGLE_CALENDAR_IDtelegram-capture Edge FunctionSingle-user today: tasks are stored under a fixed UUID. Multi-user would take ~1 hour: add a telegram_user_id → supabase_user_id mapping table and parameterize the USER_ID constant.
Doesn’t render Telegram’s MarkdownV2 everywhere: uses the classic Markdown parse mode and escapes only the characters that matter. One or two special chars in task titles could render weirdly; a future pass could switch to MarkdownV2 with a stricter escape.
“I used to avoid my GTD inbox because processing it took an hour and required sitting at my computer. Now I tap through the whole thing from the bus in four minutes. Same method, different interface, and because the bot captures voice notes and auto-creates tasks, the inbox fills itself without me thinking about it.”