2023-07-24 16:02:21 +03:00
# Installation
2020-09-09 23:40:23 +03:00
```bash
2021-02-14 23:59:26 +03:00
$ npm i nestjs-telegraf telegraf
2020-09-09 23:40:23 +03:00
```
2021-02-14 23:59:26 +03:00
Once the installation process is complete, we can import the `TelegrafModule` into the root `AppModule` .
2020-09-09 23:40:23 +03:00
2021-02-14 23:59:26 +03:00
```typescript title="src/app.module.ts"
2020-09-09 23:40:23 +03:00
import { Module } from '@nestjs/common';
import { TelegrafModule } from 'nestjs-telegraf';
@Module ({
imports: [
TelegrafModule.forRoot({
token: 'TELEGRAM_BOT_TOKEN',
})
],
})
export class AppModule {}
```
The `forRoot()` method accepts the same configuration object as Telegraf class constructor from the Telegraf package, as described [here ](https://telegraf.js.org/#/?id=constructor ).