@adonis-agora/agent
Version:
Governed, durable-backed AI agent (chat + tool-calling + governance) for AdonisJS — part of the Agora ecosystem.
35 lines • 1.89 kB
TypeScript
import { type ChannelFetch } from '../http.js';
import type { ChannelAdapter } from '../types.js';
export interface TelegramOptions {
/** The bot's token from @BotFather. */
botToken: string;
/**
* The `secret_token` given to `setWebhook`: Telegram sends it back as
* `X-Telegram-Bot-Api-Secret-Token` on every update, and a request without it is refused.
*/
secretToken: string;
/** Format replies as MarkdownV2 (`true`, default) or send plain text (`false`). */
markdown?: boolean;
/** Answer in groups and supergroups too. Default `false`: private chats only. */
groups?: boolean;
/** The adapter's name — the dedupe prefix and the decision's `via`. Default `'telegram'`. */
name?: string;
/** Per-request timeout. Default 20 s. */
timeoutMs?: number;
/** Bot API origin. Default `https://api.telegram.org` (a self-hosted Bot API server goes here). */
apiUrl?: string;
fetch?: ChannelFetch;
}
/**
* A Telegram bot over the [Bot API](https://core.telegram.org/bots/api) webhook. Register it with
* `setWebhook({ url, secret_token, allowed_updates: ['message', 'callback_query'] })`.
*
* Reads text messages, media (photos, documents, voice notes, audio, video, stickers — downloaded
* with `getFile`, which serves up to 20 MB) and inline-keyboard presses (`callback_query`, answered with
* `answerCallbackQuery` and the keyboard removed so it cannot be pressed twice); ignores bots and
* (unless `groups`) group chats. Sends `sendMessage` in MarkdownV2 — when Telegram refuses the
* formatting, the same text goes again as plain text. Files go with `sendPhoto` / `sendDocument` /
* `sendAudio` / `sendVideo` (by URL, or uploaded as `multipart/form-data` when given as bytes).
*/
export declare function telegram(options: TelegramOptions): ChannelAdapter;
//# sourceMappingURL=telegram.d.ts.map