diff --git a/src/telegram/bot/delivery.ts b/src/telegram/bot/delivery.ts index 4dce22e5991..2e3411e7646 100644 --- a/src/telegram/bot/delivery.ts +++ b/src/telegram/bot/delivery.ts @@ -480,7 +480,6 @@ async function sendTelegramVoiceFallbackText(opts: { function buildTelegramSendParams(opts?: { replyToMessageId?: number; thread?: TelegramThreadSpec | null; - replyQuoteText?: string; }): Record { const threadParams = buildTelegramThreadParams(opts?.thread); const params: Record = {}; @@ -510,7 +509,6 @@ async function sendTelegramText( ): Promise { const baseParams = buildTelegramSendParams({ replyToMessageId: opts?.replyToMessageId, - replyQuoteText: opts?.replyQuoteText, thread: opts?.thread, }); // Add link_preview_options when link preview is disabled. diff --git a/src/telegram/bot/helpers.ts b/src/telegram/bot/helpers.ts index 6f7ceb8d92b..47c7578c45a 100644 --- a/src/telegram/bot/helpers.ts +++ b/src/telegram/bot/helpers.ts @@ -226,8 +226,11 @@ export type TelegramReplyTarget = { export function describeReplyTarget(msg: Message): TelegramReplyTarget | null { const reply = msg.reply_to_message; - const externalReply = msg.external_reply; - const quoteText = msg.quote?.text ?? reply?.quote?.text ?? externalReply?.quote?.text; + const externalReply = (msg as Message & { external_reply?: Message }).external_reply; + const quoteText = + msg.quote?.text ?? + (reply as Message & { quote?: { text?: string } } | undefined)?.quote?.text ?? + (externalReply as Message & { quote?: { text?: string } } | undefined)?.quote?.text; let body = ""; let kind: TelegramReplyTarget["kind"] = "reply";