fix: preserve complete weekly brief content and date bounds
This commit is contained in:
+2
-2
@@ -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(() => ({}));
|
||||
|
||||
Reference in New Issue
Block a user