mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 02:08:27 +00:00
fix: unify telegram thread handling
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import type { Bot } from "grammy";
|
||||
import { buildTelegramThreadParams } from "./bot/helpers.js";
|
||||
import { buildTelegramThreadParams, type TelegramThreadSpec } from "./bot/helpers.js";
|
||||
|
||||
const TELEGRAM_DRAFT_MAX_CHARS = 4096;
|
||||
const DEFAULT_THROTTLE_MS = 300;
|
||||
@@ -15,7 +15,7 @@ export function createTelegramDraftStream(params: {
|
||||
chatId: number;
|
||||
draftId: number;
|
||||
maxChars?: number;
|
||||
messageThreadId?: number;
|
||||
thread?: TelegramThreadSpec | number | null;
|
||||
throttleMs?: number;
|
||||
log?: (message: string) => void;
|
||||
warn?: (message: string) => void;
|
||||
@@ -25,7 +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 = buildTelegramThreadParams(params.messageThreadId);
|
||||
const threadParams = buildTelegramThreadParams(params.thread);
|
||||
|
||||
let lastSentText = "";
|
||||
let lastSentAt = 0;
|
||||
|
||||
Reference in New Issue
Block a user