fix: inject reply context into body

This commit is contained in:
Peter Steinberger
2025-12-23 02:44:38 +01:00
parent 950432eac0
commit 67a3dda53a
7 changed files with 23 additions and 6 deletions

View File

@@ -124,13 +124,16 @@ export function createTelegramBot(opts: TelegramBotOptions) {
""
).trim();
if (!rawBody) return;
const replySuffix = replyTarget
? `\n\n[Replying to ${replyTarget.sender}]\n${replyTarget.body}\n[/Replying]`
: "";
const body = formatAgentEnvelope({
surface: "Telegram",
from: isGroup
? buildGroupLabel(msg, chatId)
: buildSenderLabel(msg, chatId),
timestamp: msg.date ? msg.date * 1000 : undefined,
body: rawBody,
body: `${rawBody}${replySuffix}`,
});
const ctxPayload = {