mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 03:03:24 -04:00
fix(telegram): make quote parsing/types CI-safe
This commit is contained in:
committed by
Ayaan Zaidi
parent
a4b38ce886
commit
1c1d7fa0e5
@@ -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.
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user