diff --git a/lib/explorers/telegraf-scene.explorer.ts b/lib/explorers/telegraf-scene.explorer.ts index dbf36c6..2ab2c49 100644 --- a/lib/explorers/telegraf-scene.explorer.ts +++ b/lib/explorers/telegraf-scene.explorer.ts @@ -7,11 +7,11 @@ import { TelegrafMetadataAccessor } from '../telegraf.metadata-accessor'; @Injectable() export class TelegrafSceneExplorer implements OnModuleInit { - private readonly stage = new Stage(); + private readonly stage = new Stage([]); constructor( @Inject(Telegraf) - private readonly telegraf: Telegraf, + private readonly telegraf: Telegraf, private readonly discoveryService: DiscoveryService, private readonly metadataAccessor: TelegrafMetadataAccessor, private readonly metadataScanner: MetadataScanner, @@ -55,7 +55,7 @@ export class TelegrafSceneExplorer implements OnModuleInit { } private registerIfListener( - scene: Scene, + scene: Scene, instance: Record, methodKey: string, ): void { diff --git a/lib/explorers/telegraf-update.explorer.ts b/lib/explorers/telegraf-update.explorer.ts index eac2625..a848806 100644 --- a/lib/explorers/telegraf-update.explorer.ts +++ b/lib/explorers/telegraf-update.explorer.ts @@ -9,7 +9,7 @@ import { TelegrafMetadataAccessor } from '../telegraf.metadata-accessor'; export class TelegrafUpdateExplorer implements OnModuleInit { constructor( @Inject(Telegraf) - private readonly telegraf: Telegraf, + private readonly telegraf: Telegraf, private readonly discoveryService: DiscoveryService, private readonly metadataAccessor: TelegrafMetadataAccessor, private readonly metadataScanner: MetadataScanner, diff --git a/lib/telegraf.metadata-accessor.ts b/lib/telegraf.metadata-accessor.ts index 19e58b5..5c4394d 100644 --- a/lib/telegraf.metadata-accessor.ts +++ b/lib/telegraf.metadata-accessor.ts @@ -5,7 +5,7 @@ import { UPDATE_LISTENER_METADATA, UPDATE_METADATA, } from './telegraf.constants'; -import { ListenerMetadata } from './interfaces/listener-metadata.interface'; +import { ListenerMetadata } from './interfaces'; @Injectable() export class TelegrafMetadataAccessor { diff --git a/lib/telegraf.types.ts b/lib/telegraf.types.ts index c319853..84019a5 100644 --- a/lib/telegraf.types.ts +++ b/lib/telegraf.types.ts @@ -12,11 +12,6 @@ export type OnlyFunctionPropertyNames = { [K in keyof T]: T[K] extends (...args: any) => any ? K : never; }[keyof T]; -// export type FilterComposerMethods = Exclude< -// T, -// 'middleware' | 'guard' | 'filter' | 'drop' -// >; - export type ComposerMethodArgs< T extends Composer, U extends OnlyFunctionPropertyNames = OnlyFunctionPropertyNames @@ -26,4 +21,4 @@ export type UpdateMethods = OnlyFunctionPropertyNames>; export type SceneMethods = OnlyFunctionPropertyNames>; export type TelegrafOption = ConstructorParameters[1]; -export type TelegrafLaunchOption = Parameters[0]; +export type TelegrafLaunchOption = Parameters['launch']>[0]; diff --git a/package.json b/package.json index d842c0e..8932e6a 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "sample-app": "ts-node --transpile-only -r tsconfig-paths/register sample/main.ts" }, "dependencies": { - "telegraf": "https://github.com/telegraf/telegraf.git#develop" + "telegraf": "^3.38.0" }, "devDependencies": { "@nestjs/common": "7.6.1", diff --git a/sample/interfaces/context.interface.ts b/sample/interfaces/context.interface.ts index fcefe97..58f20ef 100644 --- a/sample/interfaces/context.interface.ts +++ b/sample/interfaces/context.interface.ts @@ -1,4 +1,4 @@ -import { SceneContext } from 'telegraf'; +import { SceneContextMessageUpdate } from 'telegraf/typings/stage'; // eslint-disable-next-line @typescript-eslint/no-empty-interface -export interface Context extends SceneContext {} +export interface Context extends SceneContextMessageUpdate {}