Skip to content

The moment it happens

Log meals and macros by messaging a Telegram bot

Tell your bot what you ate and get calories and macros logged in your sheet, with today's total in the reply.

Runs
The moment it happens
Apps
Google Sheets, Telegram
AI
Yes, uses the built-in AI allowance
Access
Telegram bot token; Sheets read+write

Send this to your assistant

Create a ClickRuntime automation: when I message my Telegram bot a meal, estimate calories, protein, carbs and fat, add it to my Nutrition sheet and reply with today's totals.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Someone following a training plan or a diet from their coach is asked to log everything they eat. Food tracking apps want every ingredient weighed and searched for, so after a week the logging stops and the plan drifts.

Describing a meal in a sentence is something people will actually keep doing. The bot estimates the numbers, the sheet holds the history, and the reply shows how the day is going so you can adjust the next meal.

What you get out of it

  • Logging takes seconds

    "Chicken wrap and a latte" is enough. Because it is quick, you keep doing it after the first week, which is where most food logs fail.

  • Today's total in every reply

    Each reply shows calories and macros so far today. You can see you are short on protein before dinner rather than finding out at the end of the day.

  • Your data stays in your own sheet

    The log lives in a Google Sheet you own. You can chart it, share it with a coach or nutritionist, and keep it if you change tools.

  • Good enough estimates, consistently

    Estimates from a description are not lab precise, but they are consistent. For tracking trends over weeks, consistent beats perfect and abandoned.

How it works

What happens, step by step

  1. You message your Telegram bot what you ate, for example "porridge with banana and a coffee".

  2. AI estimates the calories, protein, carbs and fat for that meal.

  3. A row with the date, meal and numbers is added to the Nutrition tab of your Google Sheet.

  4. ClickRuntime adds up today's rows and the bot replies with your totals so far.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Telegram
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Log meals and macros by messaging a Telegram botjust nowSucceeded
Telegram · Nutrition botLogged: chicken wrap and latte (610 kcal). Today: 1,420 kcal, P 92g, C 140g, F 51g

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Change what the AI looks for, or how it writes the result
  • Add another app, for example also send it to Slack
  • Combine it with other Google Sheets and Telegram steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
meal_and_nutrition_logger.pyexample
from datetime import date
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_event, credentials, http, ai

SHEET_ID = "your-spreadsheet-id"
SCHEMA = {"type": "object", "properties": {k: {"type": "number"} for k in ["kcal", "protein", "carbs", "fat"]}}

@on_event
def handle(event):
    msg = (event.json or {}).get("message") or {}
    meal, chat = msg.get("text"), msg.get("chat", {}).get("id")
    if not meal:
        return {"skipped": True}
    n = ai.generate(f"Estimate nutrition for this meal: {meal}", json_schema=SCHEMA, max_output_tokens=80).json
    sheets = build("sheets", "v4", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    today = date.today().isoformat()
    v = sheets.spreadsheets().values()
    v.append(spreadsheetId=SHEET_ID, range="Nutrition!A:F", valueInputOption="USER_ENTERED",
             body={"values": [[today, meal, n["kcal"], n["protein"], n["carbs"], n["fat"]]]}).execute()
    rows = [r for r in v.get(spreadsheetId=SHEET_ID, range="Nutrition!A:F").execute().get("values", []) if r and r[0] == today]
    tot = [sum(float(r[i]) for r in rows) for i in range(2, 6)]
    text = f"Logged. Today: {tot[0]:.0f} kcal, P {tot[1]:.0f}g, C {tot[2]:.0f}g, F {tot[3]:.0f}g"
    http.post(f"https://api.telegram.org/bot{credentials.secret('TELEGRAM_BOT_TOKEN')}/sendMessage", json={"chat_id": chat, "text": text})
    return {"logged": meal}

FAQ

Common questions

How accurate are the calorie estimates?
They are estimates based on typical portions, usually close for common meals. Adding quantities such as "200g rice" or a brand name makes them noticeably better.
Can I correct an entry?
Yes, edit the row in the sheet directly. The daily total in the next reply is calculated from the sheet, so your correction is included.
Can more than one person use the same bot?
Yes. Each row can record who sent it, and totals can be calculated per person, so a couple or a small coaching group can share one bot and one sheet.
What permissions does it need?
Telegram bot token; Sheets read+write. Nothing else in your accounts is used.
Does it need AI?
Yes. It uses ClickRuntime's built-in AI, so you don't need an OpenAI or Anthropic key. Every plan includes a monthly AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Log meals and macros by messaging a Telegram bot” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.