0
Fork 0
mirror of https://github.com/mastra-ai/mastra.git synced 2026-11-17 08:44:46 +00:00
mastra/channels/telegram
History 2026-11-12 07:20:12 -08:00
..
src chore(deps): update dependencies across the monorepo (#28417) 2026-10-26 16:59:30 +01:00
CHANGELOG.md chore: version - exit prerelease mode 2026-11-03 23:45:58 +00:00
lint-staged.config.js chore: run oxfmt instead of prettier in the last six pre-commit configs (#29892) 2026-11-10 12:35:37 +01:00
package.json chore(deps): Vanta 2026-11-12 — raise undici to 8.12.4 / 7.30.2 (#30205) 2026-11-12 07:20:12 -08:00
README.md chore(*): Update/unify/add READMEs (#22858) 2026-09-02 14:36:59 +02:00
tsconfig.json chore: upgrade monorepo to TypeScript 7 (#22459) 2026-08-28 23:55:51 +02:00
tsdown.config.ts chore: upgrade monorepo to TypeScript 7 (#22459) 2026-08-28 23:55:51 +02:00
vitest.config.ts fix(ci): discover omitted Vitest projects in root test runs (#23965) 2026-09-15 12:19:24 +02:00

@mastra/telegram

@mastra/telegram connects Mastra agents to Telegram through the Bot API. It handles bot installations, polling or webhook delivery, secret-token verification, commands, rich messages, and Mastra's channel lifecycle.

Installation

npm install @mastra/telegram

Usage

import { Agent } from '@mastra/core/agent';
import { Mastra } from '@mastra/core/mastra';
import { TelegramProvider } from '@mastra/telegram';

const supportAgent = new Agent({
  id: 'support',
  name: 'Support agent',
  instructions: 'Help users with product questions.',
  model: 'openai/gpt-5-mini',
});

const telegram = new TelegramProvider({
  baseUrl: 'https://your-app.example.com',
});

export const mastra = new Mastra({
  agents: { supportAgent },
  channels: { telegram },
});

await telegram.connect('support', {
  botToken: process.env.TELEGRAM_BOT_TOKEN!,
});

Documentation

Changelog

See the package changelog for version history and release notes.

Support

We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.