All checks were successful
Build and deploy typedoc / build (push) Successful in 5m15s
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>
20 lines
521 B
Markdown
Executable file
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)
|
|
```
|
|
|