mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-25 15:34:38 +03:00
fix: forRoot method working
This commit is contained in:
parent
25710b7908
commit
ee0ad03af8
@ -19,10 +19,18 @@ import { TelegrafProvider } from './telegraf.provider';
|
|||||||
})
|
})
|
||||||
export class TelegrafCoreModule {
|
export class TelegrafCoreModule {
|
||||||
public static forRoot(options: TelegrafModuleOptions): DynamicModule {
|
public static forRoot(options: TelegrafModuleOptions): DynamicModule {
|
||||||
|
const telegrafProvider = {
|
||||||
|
provide: TELEGRAF_PROVIDER,
|
||||||
|
useClass: TelegrafProvider,
|
||||||
|
inject: [TELEGRAF_MODULE_OPTIONS],
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
module: TelegrafCoreModule,
|
module: TelegrafCoreModule,
|
||||||
providers: [],
|
providers: [
|
||||||
exports: [],
|
{ provide: TELEGRAF_MODULE_OPTIONS, useValue: options },
|
||||||
|
telegrafProvider,
|
||||||
|
],
|
||||||
|
exports: [telegrafProvider],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user