mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-27 08:18:08 +03:00
43816099a6
This reverts commit 2d23eba148
.
28 lines
710 B
TypeScript
28 lines
710 B
TypeScript
import { Module, DynamicModule } from '@nestjs/common';
|
|
import { TelegrafCoreModule } from './telegraf-core.module';
|
|
import {
|
|
TelegrafModuleOptions,
|
|
TelegrafModuleAsyncOptions,
|
|
} from './interfaces';
|
|
|
|
@Module({})
|
|
export class TelegrafModule {
|
|
public static forRoot(options: TelegrafModuleOptions): DynamicModule {
|
|
return {
|
|
module: TelegrafModule,
|
|
imports: [TelegrafCoreModule.forRoot(options)],
|
|
exports: [TelegrafCoreModule],
|
|
};
|
|
}
|
|
|
|
public static forRootAsync(
|
|
options: TelegrafModuleAsyncOptions,
|
|
): DynamicModule {
|
|
return {
|
|
module: TelegrafModule,
|
|
imports: [TelegrafCoreModule.forRootAsync(options)],
|
|
exports: [TelegrafCoreModule],
|
|
};
|
|
}
|
|
}
|