mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-01-15 08:21:21 +03:00
43816099a6
This reverts commit 2d23eba148
.
27 lines
749 B
TypeScript
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 {}
|