nestjs-telegraf/docs/index.md
2023-07-24 16:02:21 +03:00

614 B

Installation

$ npm i nestjs-telegraf telegraf

Once the installation process is complete, we can import the TelegrafModule into the root AppModule.

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.