From 5398faadee073e65340fbdc34f3943b870a60c2d Mon Sep 17 00:00:00 2001 From: martbost Date: Sat, 14 Nov 2026 08:06:41 -0600 Subject: [PATCH] Holding-tank arrivals post shows the running total too (Marty 2026-11-14: post those totals so people know who is waiting to be adopted): '(N waiting in total)' after the new names Co-Authored-By: Claude Opus 5.5 --- server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 07f229f..095eb2b 100644 --- a/server.js +++ b/server.js @@ -1605,12 +1605,13 @@ async function tankNotifyTick() { // the first run of this rule: anyone who joined before it was already announced at sign-up. const graceFrom = st.graceFrom || (st.graceFrom = st.last || Date.now()); const fresh = []; - for (const w of tank.openedSince(await tank.waiting(), since)) if ((w.joined || 0) > graceFrom && await marks.claim('tankopen:' + w.email + ':' + (w.joined || 0))) fresh.push(w); + const all = await tank.waiting(); // the running total goes in the post too (Marty 2026-11-14: "post those totals") + for (const w of tank.openedSince(all, since)) if ((w.joined || 0) > graceFrom && await marks.claim('tankopen:' + w.email + ':' + (w.joined || 0))) fresh.push(w); st.last = Date.now(); fs.writeFileSync(f, JSON.stringify(st)); if (!fresh.length) return; const named = fresh.filter(w => w.username).map(w => '@' + w.username); const who = named.length ? ': ' + named.slice(0, 8).join(', ') + (named.length > 8 ? ' and ' + (named.length - 8) + ' more' : '') : ''; - const text = '\u{1FAA3} InstantAdPay \u00b7 ' + fresh.length + ' new member' + (fresh.length === 1 ? '' : 's') + ' waiting for a sponsor in the holding tank' + who + const text = '\u{1FAA3} InstantAdPay \u00b7 ' + fresh.length + ' new member' + (fresh.length === 1 ? '' : 's') + ' waiting for a sponsor in the holding tank' + who + ' (' + tank.adoptableOf(all).length + ' waiting in total)' + '\nAdopt from My line \u203a Holding tank: instantadpay.com/my'; await telegramSend(sc.telegramEchoChatId, text, sc.telegramEchoTopicId); }