fix: retain verified Telegram message receipts for weekly briefs

This commit is contained in:
2026-09-06 14:39:12 +03:00
parent 7a01e4bed7
commit df0626a71f
7 changed files with 63 additions and 9 deletions
+3 -3
View File
@@ -20,8 +20,8 @@ export function createBriefSender({ store, buildBrief, text, html, telegramConfi
if (telegramConfigured() && telegram?.chatId) {
for (const part of splitBriefText(text(brief))) channels.push({
payload:{channel:'telegram',chatId:telegram.chatId,text:part},
name:'telegram', send:() => sendTelegram(telegram.chatId, part, { parseMode:null }),
valid:receipt => receipt === true,
name:'telegram', send:() => sendTelegram(telegram.chatId, part, { parseMode:null, returnReceipt:true }),
valid:receipt => typeof receipt?.id === 'string' && Boolean(receipt.id.trim()),
});
}
if (emailConfigured()) channels.push({
@@ -50,7 +50,7 @@ export function createBriefSender({ store, buildBrief, text, html, telegramConfi
try {
const receipt = await channel.send();
if (!channel.valid(receipt)) throw new Error('Sağlayıcı gönderimi doğrulamadı.');
if (claim) outbox.accept(claim,receipt === true ? 'telegram-accepted' : receipt.id);
if (claim) outbox.accept(claim,receipt.id);
counts.kabul++;
accepted = true;
} catch (error) {