2020-12-26 16:23:54 +03:00
|
|
|
import { Module } from '@nestjs/common';
|
2021-01-03 17:32:58 +03:00
|
|
|
import { TelegrafModule } from 'nestjs-telegraf';
|
2021-01-03 14:26:32 +03:00
|
|
|
import { EchoModule } from './echo/echo.module';
|
|
|
|
import { GreeterModule } from './greeter/greeter.module';
|
2020-12-30 01:49:09 +03:00
|
|
|
import { sessionMiddleware } from './middleware/session.middleware';
|
2021-01-03 14:26:32 +03:00
|
|
|
import { GreeterBotName } from './app.constants';
|
2020-12-26 16:23:54 +03:00
|
|
|
|
|
|
|
@Module({
|
|
|
|
imports: [
|
|
|
|
TelegrafModule.forRoot({
|
2021-01-03 17:32:58 +03:00
|
|
|
token: process.env.ECHO_BOT_TOKEN,
|
2021-01-03 13:50:04 +03:00
|
|
|
middlewares: [sessionMiddleware],
|
2021-01-03 14:26:32 +03:00
|
|
|
include: [EchoModule],
|
2021-01-03 13:50:04 +03:00
|
|
|
}),
|
|
|
|
TelegrafModule.forRoot({
|
2021-01-03 14:26:32 +03:00
|
|
|
name: GreeterBotName,
|
2021-01-03 17:32:58 +03:00
|
|
|
token: process.env.GREETER_BOT_TOKEN,
|
2020-12-30 01:49:09 +03:00
|
|
|
middlewares: [sessionMiddleware],
|
2021-01-03 14:26:32 +03:00
|
|
|
include: [GreeterModule],
|
2020-12-26 16:23:54 +03:00
|
|
|
}),
|
2021-01-03 14:26:32 +03:00
|
|
|
EchoModule,
|
|
|
|
GreeterModule,
|
2020-12-26 16:23:54 +03:00
|
|
|
],
|
|
|
|
})
|
|
|
|
export class AppModule {}
|