mtcute/docs/guide/dispatcher/intro.md
alina sireneva 690948b8b1
All checks were successful
Build and deploy typedoc / build (push) Successful in 5m15s
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:50:35 +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)
```