mtcute/docs/guide/dispatcher/intro.md
alina sireneva cfb572aefb
Some checks failed
Tests / e2e (push) Blocked by required conditions
Tests / e2e-deno (push) Blocked by required conditions
Build and deploy typedoc / build (push) Waiting to run
Build and deploy docs / build (push) Failing after 46s
Tests / lint (push) Has been cancelled
Tests / test-node (node18) (push) Has been cancelled
Tests / test-bun (push) Has been cancelled
Tests / test-node (node22) (push) Has been cancelled
Tests / test-web (chromium) (push) Has been cancelled
Tests / test-deno (push) Has been cancelled
Tests / test-node (node20) (push) Has been cancelled
Tests / test-web (firefox) (push) Has been cancelled
chore: moved docs inside the main repo
Co-authored-by: Kamilla 'ova <me@kamillaova.dev>
Co-authored-by: Alina Chebakova <chebakov05@gmail.com>
Co-authored-by: Kravets <57632712+kravetsone@users.noreply.github.com>
Co-authored-by: starkow <hello@starkow.dev>
Co-authored-by: sireneva <150665887+sireneva@users.noreply.github.com>
2025-01-17 08:48:40 +03:00

20 lines
521 B
Markdown
Executable file

# Introduction
We've already briefly [touched](../intro/updates.html) on what Dispatcher is,
but as a quick reminder: Dispatcher is a class that processes
updates from the client and *dispatches* them to the registered handlers.
It is implemented in `@mtcute/dispatcher` package
## Setting up
To use a dispatcher, you need to first create a bound dispatcher
using `Dispatcher.for` method:
```ts
import { Dispatcher } from '@mtcute/dispatcher'
const tg = new TelegramClient({...})
const dp = Dispatcher.for(tg)
```