mnemosyne/lib/Mnemosyne/Digest.pm

28 lines
1.1 KiB
Perl

package Mnemosyne::Digest;
use strict;
use warnings;
# Assembles the "Day at a Glance" digest content and sends it via Telegram.
# Also used by the /today and /glance commands for on-demand delivery.
#
# Sections (in order), each omitted when empty:
# 1. Overdue — dated tasks past their due date with no completion
# 2. Today — tasks due today
# 3. Upcoming — tasks due in the next upcoming_horizon days (default 7)
# 4. Floating — priority-driven selection per Schedule::_floating_show rules
#
# Each actionable line gets a Mark Done inline keyboard button.
# A friendly "all clear" line is shown when all sections are empty.
#
# TODO: build($db, $config, $today_dt) — returns an arrayref of message segments
# (Telegram has a 4096-char limit; split into multiple messages if needed)
#
# TODO: send($db, $config, $telegram, $chat_id, $today_dt)
# — calls build(), sends via Telegram, records last_digest_sent in config table
#
# TODO: already_sent_today($db, $today_dt)
# — checks last_digest_sent config row; returns true if digest was sent today
# — used by mnemosyne-digest script to prevent duplicate sends
1;