import type { Message } from '../core/types'; import { BaseChannel } from './index'; /** * Telegram channel — production-quality Telegram bot integration. * * Features (aligned with OpenClaw): * - Live stream preview (sendMessage + editMessageText) * - Ack reaction on message receipt * - Typing indicator throughout processing * - HTML parse mode with Markdown fallback * - Smart text chunking (paragraph-aware) * - /start, /help, /status commands * - Photo/document caption handling * - Callback query (inline button) support * - Reply threading * - Error recovery with plain-text fallback * - Forum topic support * - Group mention filtering */ export interface TelegramChannelConfig { token?: string; mode?: 'polling' | 'webhook'; webhookUrl?: string; webhookSecret?: string; port?: number; streaming?: boolean | 'off' | 'partial'; ackReaction?: string; linkPreview?: boolean; textChunkLimit?: number; requireMention?: boolean; botUsername?: string; voiceReply?: boolean; debounceMs?: number; } export declare class TelegramChannel extends BaseChannel { readonly type = "telegram"; private token; private mode; private webhookUrl?; private webhookSecret?; private port; private botUsername; private botInfo; private streamingEnabled; private ackReaction; private linkPreview; private textChunkLimit; private requireMention; private offset; private polling; private server; private streamHandler?; private messageQueue; private voice; private voiceReply; private lastChatId; constructor(config?: TelegramChannelConfig); setStreamHandler(handler: (msg: Message) => AsyncIterable): void; start(): Promise; stop(): Promise; private startPolling; private poll; private getUpdates; private startWebhook; private stopWebhook; private processUpdate; private handleCommand; private handleCallbackQuery; private streamResponse; sendFormattedMessage(chatId: number | string, text: string, replyTo?: number, threadId?: number): Promise; sendMessage(chatId: number | string, text: string): Promise; /** Send a proactive message to a chat (e.g. from a cron job). Does not mix into any session history. */ sendProactiveMessage(chatId: number | string, text: string): Promise; /** Returns the most recently active chat id, or null if no messages have been received yet. */ getLastChatId(): number | string | null; /** Send a voice message (TTS) alongside or instead of text */ sendVoiceMessage(chatId: number | string, text: string, replyTo?: number): Promise; private setReaction; private sendTyping; private isGroupChat; private isMentioned; private getSessionId; private escapeHtml; /** * Convert basic Markdown to Telegram-safe HTML. * Handles: bold, italic, code, code blocks, links. */ private markdownToHtml; /** * Smart text splitting — prefer paragraph boundaries (blank lines) before hard length split. * Aligned with OpenClaw's chunkMode="newline" behavior. */ private smartSplit; private apiCall; } //# sourceMappingURL=telegram.d.ts.map