Mark the habit, the bot keeps the streak
Type «done», get the count of days in a row. Not one model call, so a run costs almost nothing.
What the scenario looks like
Отметка о привычке
СерияS
Единица
Плюс один▶
Сохранить серию▶
Ответ▶
Ответ▶
- Execute + Data
- Data
A streak works better than reminders: forty days in a row is too much to lose over one missed evening. There are plenty of apps for this, and what is actually needed is one message in the messenger you already have open.
What is inside
- Habit check-in — the entry.
- Streak — a variable scoped to
thread. That scope is what makes it memory:sessionlives for one run,threadis stored in the database and outlives it. - Plus one adds one to the streak. Plain arithmetic, no model.
- Save the streak writes the new value back.
- The answer prints the result with the right word ending.
There is no model here at all, and that is the point. A run costs one flat charge for the run and nothing more: for a counter poked every day, that is the difference between pennies and a noticeable line on the bill.
What to set up for yourself
- The answer text. The word forms are handled in the template.
- Resetting the streak. It currently only grows. An honest counter resets on a missed day, which needs the date of the last check-in stored and compared with today.
- Several habits. Give each one a variable and branch on the message text.
What to connect
Nothing. A thread-scoped variable is stored on the platform and tied to the conversation:
yours is yours, anybody else’s is theirs.