mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 13:27:39 +00: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?: {
|
function buildTelegramSendParams(opts?: {
|
||||||
replyToMessageId?: number;
|
replyToMessageId?: number;
|
||||||
thread?: TelegramThreadSpec | null;
|
thread?: TelegramThreadSpec | null;
|
||||||
replyQuoteText?: string;
|
|
||||||
}): Record<string, unknown> {
|
}): Record<string, unknown> {
|
||||||
const threadParams = buildTelegramThreadParams(opts?.thread);
|
const threadParams = buildTelegramThreadParams(opts?.thread);
|
||||||
const params: Record<string, unknown> = {};
|
const params: Record<string, unknown> = {};
|
||||||
@@ -510,7 +509,6 @@ async function sendTelegramText(
|
|||||||
): Promise<number | undefined> {
|
): Promise<number | undefined> {
|
||||||
const baseParams = buildTelegramSendParams({
|
const baseParams = buildTelegramSendParams({
|
||||||
replyToMessageId: opts?.replyToMessageId,
|
replyToMessageId: opts?.replyToMessageId,
|
||||||
replyQuoteText: opts?.replyQuoteText,
|
|
||||||
thread: opts?.thread,
|
thread: opts?.thread,
|
||||||
});
|
});
|
||||||
// Add link_preview_options when link preview is disabled.
|
// Add link_preview_options when link preview is disabled.
|
||||||
|
|||||||
@@ -226,8 +226,11 @@ export type TelegramReplyTarget = {
|
|||||||
|
|
||||||
export function describeReplyTarget(msg: Message): TelegramReplyTarget | null {
|
export function describeReplyTarget(msg: Message): TelegramReplyTarget | null {
|
||||||
const reply = msg.reply_to_message;
|
const reply = msg.reply_to_message;
|
||||||
const externalReply = msg.external_reply;
|
const externalReply = (msg as Message & { external_reply?: Message }).external_reply;
|
||||||
const quoteText = msg.quote?.text ?? reply?.quote?.text ?? externalReply?.quote?.text;
|
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 body = "";
|
||||||
let kind: TelegramReplyTarget["kind"] = "reply";
|
let kind: TelegramReplyTarget["kind"] = "reply";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user