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