mirror of
				https://github.com/Maks1mS/nestjs-telegraf.git
				synced 2025-11-04 07:51:22 +03:00 
			
		
		
		
	fix(): change botName to name
This commit is contained in:
		@@ -24,7 +24,7 @@ export interface TelegrafOptionsFactory {
 | 
			
		||||
 | 
			
		||||
export interface TelegrafModuleAsyncOptions
 | 
			
		||||
  extends Pick<ModuleMetadata, 'imports'> {
 | 
			
		||||
  botName?: string;
 | 
			
		||||
  name?: string;
 | 
			
		||||
  useExisting?: Type<TelegrafOptionsFactory>;
 | 
			
		||||
  useClass?: Type<TelegrafOptionsFactory>;
 | 
			
		||||
  useFactory?: (
 | 
			
		||||
 
 | 
			
		||||
@@ -14,19 +14,13 @@ import {
 | 
			
		||||
  TelegrafOptionsFactory,
 | 
			
		||||
} from './interfaces';
 | 
			
		||||
import { TELEGRAF_MODULE_OPTIONS } from './telegraf.constants';
 | 
			
		||||
import {
 | 
			
		||||
  MetadataAccessorService,
 | 
			
		||||
  ListenersExplorerService,
 | 
			
		||||
} from './services';
 | 
			
		||||
import { MetadataAccessorService, ListenersExplorerService } from './services';
 | 
			
		||||
import { getBotToken, createBotFactory } from './utils';
 | 
			
		||||
 | 
			
		||||
@Global()
 | 
			
		||||
@Module({
 | 
			
		||||
  imports: [DiscoveryModule],
 | 
			
		||||
  providers: [
 | 
			
		||||
    ListenersExplorerService,
 | 
			
		||||
    MetadataAccessorService,
 | 
			
		||||
  ],
 | 
			
		||||
  providers: [ListenersExplorerService, MetadataAccessorService],
 | 
			
		||||
})
 | 
			
		||||
export class TelegrafCoreModule implements OnApplicationShutdown {
 | 
			
		||||
  constructor(
 | 
			
		||||
@@ -57,7 +51,7 @@ export class TelegrafCoreModule implements OnApplicationShutdown {
 | 
			
		||||
  public static forRootAsync(
 | 
			
		||||
    options: TelegrafModuleAsyncOptions,
 | 
			
		||||
  ): DynamicModule {
 | 
			
		||||
    const telegrafBotName = getBotToken(options.botName);
 | 
			
		||||
    const telegrafBotName = getBotToken(options.name);
 | 
			
		||||
 | 
			
		||||
    const telegrafBotProvider: Provider = {
 | 
			
		||||
      provide: telegrafBotName,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user