§ Ember — habit & ritual tracker
Telegram — nudges & check-ins
The brief was: the bot reminds me, and I check in with a tap. Two constraints shaped the whole design.
Constraint 1 — one poller per token
Telegram lets exactly one process long-poll (or webhook) a bot token. The telegram-bot router already owns that. So Ember's app must not talk to Telegram directly. Instead:
- Nudges are produced by a plugin inside the bot framework (a
@watcherthat asks Ember's API "what's due?" and returns an alert the router pushes). - Check-ins come back as inline-button callbacks, routed by the framework to the same plugin, which posts to Ember's
/api/checkin.
Ember's app never sees Telegram; the plugin is a thin bridge. See the-rituals-plugin.
Constraint 2 — the framework couldn't do buttons yet
The bot framework only handled text commands. Tappable ✅/⏭/😴 buttons needed two new capabilities — sending inline keyboards, and receiving the taps — so the framework got a general, backward-compatible upgrade. That's a reusable win for every future plugin, not just Ember. See inline-buttons-and-callbacks.
The shape of a nudge
🔥 Time for: Meditate
Current streak: 6 days
[ ✅ Done ] [ ⏭ Skip ] [ 😴 +1h ]
Tapping ✅ edits the message in place into "🔥 Meditate — 7 days" and pops a "Done!" toast — all without leaving the chat. Verified end-to-end: a real sendMessage returned 200 and the callback path is unit-tested.
Subpages