mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 18:18:28 +00:00
fix: restore telegram draft streaming partials
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { Bot } from "grammy";
|
||||
import { buildTelegramThreadParams } from "./bot/helpers.js";
|
||||
|
||||
const TELEGRAM_DRAFT_MAX_CHARS = 4096;
|
||||
const DEFAULT_THROTTLE_MS = 300;
|
||||
@@ -24,10 +25,7 @@ export function createTelegramDraftStream(params: {
|
||||
const rawDraftId = Number.isFinite(params.draftId) ? Math.trunc(params.draftId) : 1;
|
||||
const draftId = rawDraftId === 0 ? 1 : Math.abs(rawDraftId);
|
||||
const chatId = params.chatId;
|
||||
const threadParams =
|
||||
typeof params.messageThreadId === "number"
|
||||
? { message_thread_id: Math.trunc(params.messageThreadId) }
|
||||
: undefined;
|
||||
const threadParams = buildTelegramThreadParams(params.messageThreadId);
|
||||
|
||||
let lastSentText = "";
|
||||
let lastSentAt = 0;
|
||||
|
||||
Reference in New Issue
Block a user