fix(telegram): preserve inbound quote context and avoid QUOTE_TEXT_INVALID

This commit is contained in:
Denis Rybnikov
2026-02-08 23:48:14 +01:00
committed by Ayaan Zaidi
parent 727a390d13
commit a4b38ce886
4 changed files with 60 additions and 26 deletions

View File

@@ -484,16 +484,8 @@ function buildTelegramSendParams(opts?: {
}): Record<string, unknown> {
const threadParams = buildTelegramThreadParams(opts?.thread);
const params: Record<string, unknown> = {};
const quoteText = opts?.replyQuoteText?.trim();
if (opts?.replyToMessageId) {
if (quoteText) {
params.reply_parameters = {
message_id: Math.trunc(opts.replyToMessageId),
quote: quoteText,
};
} else {
params.reply_to_message_id = opts.replyToMessageId;
}
params.reply_to_message_id = opts.replyToMessageId;
}
if (threadParams) {
params.message_thread_id = threadParams.message_thread_id;