fix: preserve complete weekly brief content and date bounds

This commit is contained in:
2026-09-06 14:29:59 +03:00
parent 23512b7a87
commit d3a52caf2b
8 changed files with 143 additions and 24 deletions
+2 -2
View File
@@ -26,12 +26,12 @@ export async function botAdi() {
return null;
}
export async function sendTelegram(chatId, text) {
export async function sendTelegram(chatId, text, { parseMode = 'HTML' } = {}) {
if (!telegramConfigured() || !chatId) return false;
const r = await fetch(`${API()}/sendMessage`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ chat_id: chatId, text: String(text).slice(0, 4000), parse_mode: 'HTML', disable_web_page_preview: true }),
body: JSON.stringify({ chat_id: chatId, text: String(text).slice(0, 4000), ...(parseMode === null ? {} : { parse_mode:parseMode }), disable_web_page_preview: true }),
signal: AbortSignal.timeout(15000),
});
const d = await r.json().catch(() => ({}));