A Telegram bot I can message with what I’m reading, which then writes the markdown behind the reading list and pushes it. Send it a title and a new book page appears. Send it an update on something already there and it edits the existing one.
I’m building it from a guide I had AI write rather than from working code it handed me, because the point is to come out of this knowing some Go rather than just owning a bot.
Why I’m building it
The reading list is maintained by hand. Adding a book means opening Obsidian, copying the template, filling in the author and the status, and pushing. That’s enough friction that the list lags behind what I’m actually reading, which defeats the point of having it.
The bigger reason is that I wanted something small and real to learn Go on. I write .NET all day, so a single static binary sitting on a VPS with no runtime underneath it is unfamiliar enough to be interesting and small enough to actually finish.
It also gives the site a write path. Once a bot can commit a book, the same trick works for TILs, links and daily notes.
How it’s meant to work
A few decisions made up front:
Long polling rather than webhooks. The bot only ever makes outbound connections, so there’s no inbound port, no certificate and no subdomain to set up. The whole deployment is a binary and a systemd unit on a cheap VPS.
Writing through the GitHub API rather than a clone on the box. The bot holds a token scoped to this one repo and commits through the Contents API. The server stays stateless and never has to resolve a merge.
Buttons rather than parsing sentences. I’m doing this from my phone, so I send a title and get back a keyboard: finished, abandoned, add a note, rate it. Nothing to remember and nothing to misparse.
Metadata comes from Open Library, which needs no API key.
Notes
I’ll update this section as I work through the guide with anything I think is relevant :)
Still to do
Working through the phases in the guide. The first seven are the actual project: at the end of them it creates real pages, tells me when it’s broken something, and can undo itself. Everything after that is making it nicer to use.
- Enough Go to write the config loader without guessing
- The config loader, and the tests that prove it
- A bot that talks to me and nobody else, deployed while it still does nothing
- The frontmatter editor, and the tests that pin its behaviour down
- The GitHub client, including the conflict retry
- Create a real book page end to end
- Know when I’ve broken the site, and be able to undo it
- Open Library lookup and inline keyboards
- Find and update a book that already exists
- systemd, graceful shutdown, a deploy that survives a reboot
- Covers, batched edits, a status command