nestjs-telegraf/sample/01-complete-app/src/app.module.ts
Alexander Bukhalo 43816099a6
Revert "initial commit"
This reverts commit 2d23eba148.
2022-11-20 14:16:17 +03:00

27 lines
749 B
TypeScript

import { Module } from '@nestjs/common';
import { TelegrafModule } from 'nestjs-telegraf';
import { EchoModule } from './echo/echo.module';
import { GreeterModule } from './greeter/greeter.module';
import { sessionMiddleware } from './middleware/session.middleware';
import { GreeterBotName } from './app.constants';
@Module({
imports: [
TelegrafModule.forRoot({
token: process.env.ECHO_BOT_TOKEN,
include: [EchoModule],
}),
TelegrafModule.forRootAsync({
botName: GreeterBotName,
useFactory: () => ({
token: process.env.GREETER_BOT_TOKEN,
middlewares: [sessionMiddleware],
include: [GreeterModule],
}),
}),
EchoModule,
GreeterModule,
],
})
export class AppModule {}