Telegram/documents: guard verbose reply preview

This commit is contained in:
Gustavo Madeira Santana
2026-04-14 20:45:34 -04:00
parent 5e2c36f483
commit 09a87c184f

View File

@@ -442,7 +442,7 @@ export async function buildTelegramInboundContextPayload(params: {
});
if (visibleReplyTarget && shouldLogVerbose()) {
const preview = visibleReplyTarget.body.replace(/\s+/g, " ").slice(0, 120);
const preview = (visibleReplyTarget.body ?? "").replace(/\s+/g, " ").slice(0, 120);
logVerbose(
`telegram reply-context: replyToId=${visibleReplyTarget.id} replyToSender=${visibleReplyTarget.sender} replyToBody="${preview}"`,
);