mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-29 17:18:10 +03:00
663 B
663 B
id | title | sidebar_label | slug |
---|---|---|---|
installation | Installation | Installation | / |
$ npm i nestjs-telegraf
Once the installation process is complete, we can import the TelegrafModule into the root AppModule.
/* app.module.ts */
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.