Skip to main content

Dispatcher and bot framework based on @mtcute/core

Works with
This package works with Bun
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Browsers
JSR Score
82%
Published
2 weeks ago (0.12.0)

@mtcute/dispatcher

📖 API Reference
🧐 Guide

Dispatcher and bot framework based on @mtcute/core.

Features

  • Straightforward: Simple and expressive API
  • State: Supports storing state for each chat
  • Filters: Powerful and easy-to-use filtering system
  • Middleware: Basic middleware support for updates
  • Scenes: Built-in support for scenes

Usage

import { Dispatcher } from '@mtcute/dispatcher'

const tg = new TelegramClient({ ... })
const dp = Dispatcher.for(tg)

dp.onNewMessage(async (msg) => {
    await msg.replyText('Hello world!')
})
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @mtcute/dispatcher

Import symbol

import * as mod from "@mtcute/dispatcher";

Add Package

npx jsr add @mtcute/dispatcher

Import symbol

import * as mod from "@mtcute/dispatcher";

Add Package

yarn dlx jsr add @mtcute/dispatcher

Import symbol

import * as mod from "@mtcute/dispatcher";

Add Package

pnpm dlx jsr add @mtcute/dispatcher

Import symbol

import * as mod from "@mtcute/dispatcher";

Add Package

bunx jsr add @mtcute/dispatcher

Import symbol

import * as mod from "@mtcute/dispatcher";