• Nov 8, 2026
  • 2 min read

A Quiet Nightly RSS Digest for a Telegram Group

The bot has a second job besides moderation: telling members when something new appears on fossengineer.com. The constraint was quiet. One message a day at most, and none on days with nothing new.

The baseline problem

The site’s Hugo feed (/index.xml) contains the full archive, hundreds of posts. A naive bot would post all of them the first night. So the first startup saves every current GUID as “seen” and announces nothing:

def ensure_feed_baseline(self):
    if meta("feed_baselined") is None:
        INSERT OR IGNORE INTO feed_items(guid, title, url) <- every item in the feed
        meta("feed_baselined") = "1"

Dedup by GUID, not by date

New items are found by checking each item’s GUID against feed_items. The channel’s lastBuildDate changes on every rebuild, and item dates can be backdated, so neither tells you what you’ve already announced. GUIDs do.

Once a day, after 21:00 Zurich time

There’s no cron. The main loop already wakes up every 25 seconds or so (the long-poll timeout), so it checks:

now = datetime.now(ZoneInfo("Europe/Zurich"))
if now.hour >= DIGEST_HOUR and meta("last_digest_date") != today:
    post_new_feed_items(f"digest:{today}")     # the action key prevents a double post
    meta("last_digest_date") = today

If the bot was down at 21:00 and comes back at 23:10, the digest still goes out that evening. Items are posted oldest first and cut to stay under Telegram’s 4,096-character limit, so one message is always one message. Anything left over goes out the next night.

Two owner commands

Waiting until 21:00 to test a format is annoying, so the owner’s private chat has:

  • /digest preview: the latest three items, sent only to me. Nothing posted, nothing marked as seen.
  • /digest: run the real digest now, with the same dedup. It replies “Posted 1 new article to the group.” or “No new RSS articles to post.”

Both ignore anyone except the configured owner.

Being careful with the feed

The feed is fetched with a size cap (2 MB) and only links under https://fossengineer.com/ are accepted. If the fetch or parse fails, nothing is marked as announced, the digest is delayed, and I get one alert that day (the alert key includes the date). The next loop tries again.

A small feature, but it’s the part members actually see, and the baseline and preview make it calm instead of noisy.


Next in this series: Homelab Deploy: Docker Gotchas and Lessons From a Telegram Bot

Part 5 of 6. Start with the series overview.