Building a Water Tracking Telegram Bot with Cloudflare Workers and grammY
By
flashblaze
If you only eat one bagel today, this is the bagel.
Summary
A technical walkthrough detailing how to build a Telegram bot for water consumption tracking using Cloudflare Workers, Durable Objects, and the grammY framework. The article covers the motivation (personal need to track water intake), technical implementation including setting up webhooks, handling bot responses, dynamic command registration, and deployment to Cloudflare's serverless platform. It emphasizes practical learning and demonstrates how to create a functional bot with persistent per-user data storage using Durable Objects.
Key quotes
· 3 pulledI then started keeping track of how much water I drank, but then I used to miss a couple of days. So I thought, why not create an app to track this and also remind myself to drink water.
Durable Objects are used for per-person DB and grammY is used to interact with the Telegram API
Things I learned: Setting webhook URL, Bot not responding to messages, Commands can be registered dynamically, Not everything has to be AI
You might also wanna read
Google enters AI agent runtime race as the infrastructure layer becomes commoditized
Google repositioned Antigravity as a platform for developing and managing teams of autonomous AI agents at its I/O conference. The platform
bit.ly·11h agoBuilding a Minimal RAG System from Scratch: PDF to Highlighted Answers in ~100 Lines of Python
A hands-on tutorial that builds the smallest functional RAG (Retrieval-Augmented Generation) system from scratch using about 100 lines of Py
How to Install Ubuntu Server 26.04 on Raspberry Pi: A Step-by-Step Guide
A practical guide for installing Ubuntu Server 26.04 on Raspberry Pi models. The article covers using Raspberry Pi Imager or direct download
Cloudflare Integrates Claude Managed Agents for Developer Deployment
Cloudflare has added support for Claude Managed Agents, enabling developers to deploy, run, and manage Claude AI agents within the Cloudflar
How four open-source projects power Floci, a fast AWS emulator that starts in 24ms
Floci, a free MIT-licensed AWS emulator, achieves fast startup (~24ms) and low memory usage (13 MiB RAM) by leveraging four mature open-sour
dev.to·3d agoWhy average CPU utilization is a misleading metric for cloud-native applications
The article discusses the pitfalls of relying on average CPU utilization metrics in cloud-native environments, particularly in Kubernetes. I
