mtcute/packages/dispatcher
2023-11-30 00:20:37 +03:00
..
scripts refactor(dispatcher): improved surface api 2023-10-26 22:22:40 +03:00
src test: run tests in browser 2023-11-30 00:20:37 +03:00
tests test: moved to vitest from mocha/chai 2023-11-09 00:20:43 +03:00
package.json test(dispatcher): some tests 2023-11-19 04:30:16 +03:00
README.md docs: updated packages readmes 2023-11-01 14:05:45 +03:00
tsconfig.json ESM + end-to-end tests (#11) 2023-10-16 19:23:53 +03:00
typedoc.cjs chore: moved most configs to .config 2023-11-13 13:28:11 +03:00

@mtcute/dispatcher

📖 API Reference
🧐 Guide

Dispatcher and bot framework based on @mtcute/client.

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 { NodeTelegramClient, Dispatcher } from '@mtcute/node'

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

dp.onNewMessage(async (msg) => {
    await msg.replyText('Hello world!')
})