/** * Telegram Adapter - Hermes-style Telegram platform adapter * * Features: * - Polling and webhook modes * - DM and group chat support * - Inline queries * - Callback buttons */ import { BaseAdapter, type PlatformConfig } from "./base.js"; interface TelegramConfig extends PlatformConfig { platform: "telegram"; token: string; mode?: "polling" | "webhook"; webhookUrl?: string; webhookSecret?: string; allowedChats?: string[]; requireUsername?: boolean; } export type { TelegramConfig }; export declare class TelegramAdapter extends BaseAdapter { readonly platform: "telegram"; config: TelegramConfig; private bot; private offset; private pollingInterval; private connected; constructor(config: TelegramConfig); initialize(): Promise; private apiRequest; start(callbacks: any): Promise; private startPolling; private poll; private handleUpdate; private sleep; stop(): Promise; sendMessage(channelId: string, content: string): Promise; sendPhoto(channelId: string, photoUrl: string, caption?: string): Promise; sendButtons(channelId: string, text: string, buttons: Array>): Promise; editMessage(channelId: string, messageId: string, content: string): Promise; deleteMessage(channelId: string, messageId: string): Promise; setTyping(channelId: string, isTyping: boolean): Promise; getStatus(): Promise<{ connected: boolean; latency?: number; }>; getMe(): Promise<{ id: number; username: string; first_name: string; }>; handleWebhookUpdate(update: any): Promise; }