fix: retain verified Telegram message receipts for weekly briefs
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user