Skip to main content
Home

Dispatcher and bot framework based on @mtcute/core

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
76%
Published
a month ago (0.23.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!')
})

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@mtcute/dispatcher

Import symbol

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

Import directly with a jsr specifier

import * as dispatcher from "jsr:@mtcute/dispatcher";

Add Package

pnpm i jsr:@mtcute/dispatcher
or (using pnpm 10.8 or older)
pnpm dlx jsr add @mtcute/dispatcher

Import symbol

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

Add Package

yarn add jsr:@mtcute/dispatcher
or (using Yarn 4.8 or older)
yarn dlx jsr add @mtcute/dispatcher

Import symbol

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

Add Package

npx jsr add @mtcute/dispatcher

Import symbol

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

Add Package

bunx jsr add @mtcute/dispatcher

Import symbol

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