fix(telegram): make quote parsing/types CI-safe

This commit is contained in:
Denis Rybnikov
2026-02-08 23:52:55 +01:00
committed by Ayaan Zaidi
parent a4b38ce886
commit 1c1d7fa0e5
2 changed files with 5 additions and 4 deletions

View File

@@ -480,7 +480,6 @@ async function sendTelegramVoiceFallbackText(opts: {
function buildTelegramSendParams(opts?: {
replyToMessageId?: number;
thread?: TelegramThreadSpec | null;
replyQuoteText?: string;
}): Record<string, unknown> {
const threadParams = buildTelegramThreadParams(opts?.thread);
const params: Record<string, unknown> = {};
@@ -510,7 +509,6 @@ async function sendTelegramText(
): Promise<number | undefined> {
const baseParams = buildTelegramSendParams({
replyToMessageId: opts?.replyToMessageId,
replyQuoteText: opts?.replyQuoteText,
thread: opts?.thread,
});
// Add link_preview_options when link preview is disabled.

View File

@@ -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";