mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-01-11 14:48:10 +03:00
feat(): use last telegraf release
This commit is contained in:
parent
3e585859d0
commit
f56526b9f3
@ -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<never>,
|
||||
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<never>,
|
||||
instance: Record<string, Function>,
|
||||
methodKey: string,
|
||||
): void {
|
||||
|
@ -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<never>,
|
||||
private readonly discoveryService: DiscoveryService,
|
||||
private readonly metadataAccessor: TelegrafMetadataAccessor,
|
||||
private readonly metadataScanner: MetadataScanner,
|
||||
|
@ -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 {
|
||||
|
@ -12,11 +12,6 @@ export type OnlyFunctionPropertyNames<T> = {
|
||||
[K in keyof T]: T[K] extends (...args: any) => any ? K : never;
|
||||
}[keyof T];
|
||||
|
||||
// export type FilterComposerMethods<T extends string> = Exclude<
|
||||
// T,
|
||||
// 'middleware' | 'guard' | 'filter' | 'drop'
|
||||
// >;
|
||||
|
||||
export type ComposerMethodArgs<
|
||||
T extends Composer<never>,
|
||||
U extends OnlyFunctionPropertyNames<T> = OnlyFunctionPropertyNames<T>
|
||||
@ -26,4 +21,4 @@ export type UpdateMethods = OnlyFunctionPropertyNames<Composer<never>>;
|
||||
export type SceneMethods = OnlyFunctionPropertyNames<BaseScene<never>>;
|
||||
|
||||
export type TelegrafOption = ConstructorParameters<typeof Telegraf>[1];
|
||||
export type TelegrafLaunchOption = Parameters<Telegraf['launch']>[0];
|
||||
export type TelegrafLaunchOption = Parameters<Telegraf<never>['launch']>[0];
|
||||
|
@ -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",
|
||||
|
@ -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 {}
|
||||
|
Loading…
Reference in New Issue
Block a user