tgApi (telegram-api.mjs)

agenticmail · telegram-api, bot-bridge, mcp-server, email

Telegram Bot API helpers shared across the bridge and the telegram-mcp stdio server. Adapted from enterprise/src/agent-tools/tools/messaging/telegram.ts. /

// Source: https://github.com/agenticmail/agenticmail | License: MIT | Copyright 2026 Ope Olatunji
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Telegram Bot API helpers shared across the bridge and the telegram-mcp
 * stdio server. Adapted from enterprise/src/agent-tools/tools/messaging/telegram.ts.
 */

import { readFile } from 'node:fs/promises';
import { basename } from 'node:path';
import { mkdirSync, writeFileSync, existsSync, copyFileSync } from 'node:fs';
import { join } from 'node:path';
import { TELEGRAM_MEDIA_DIR } from './paths.mjs';

/**
 * Telegram Bot API base URL.
 * Uses local Bot API server (no file size limits) if running, falls back to official.
 */
const LOCAL_API = 'http://localhost:8081';
const OFFICIAL_API = 'https://api.telegram.org';

asy

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key