This commit is contained in:
lennox-saint 2026-01-30 17:05:54 +05:30 committed by GitHub
commit c14eea342d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -105,7 +105,7 @@ export async function deliverReplies(params: {
const chunks = chunkText(reply.text || ""); const chunks = chunkText(reply.text || "");
for (let i = 0; i < chunks.length; i += 1) { for (let i = 0; i < chunks.length; i += 1) {
const chunk = chunks[i]; const chunk = chunks[i];
if (!chunk) continue; if (!chunk?.html?.trim()) continue;
// Only attach buttons to the first chunk. // Only attach buttons to the first chunk.
const shouldAttachButtons = i === 0 && replyMarkup; const shouldAttachButtons = i === 0 && replyMarkup;
await sendTelegramText(bot, chatId, chunk.html, runtime, { await sendTelegramText(bot, chatId, chunk.html, runtime, {
@ -501,6 +501,10 @@ async function sendTelegramText(
replyMarkup?: ReturnType<typeof buildInlineKeyboard>; replyMarkup?: ReturnType<typeof buildInlineKeyboard>;
}, },
): Promise<number | undefined> { ): Promise<number | undefined> {
if (!text?.trim()) {
logVerbose("sendTelegramText: skipping empty message");
return undefined;
}
const baseParams = buildTelegramSendParams({ const baseParams = buildTelegramSendParams({
replyToMessageId: opts?.replyToMessageId, replyToMessageId: opts?.replyToMessageId,
replyQuoteText: opts?.replyQuoteText, replyQuoteText: opts?.replyQuoteText,