mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-01-25 21:31:07 +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()
|
@Injectable()
|
||||||
export class TelegrafSceneExplorer implements OnModuleInit {
|
export class TelegrafSceneExplorer implements OnModuleInit {
|
||||||
private readonly stage = new Stage();
|
private readonly stage = new Stage([]);
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(Telegraf)
|
@Inject(Telegraf)
|
||||||
private readonly telegraf: Telegraf,
|
private readonly telegraf: Telegraf<never>,
|
||||||
private readonly discoveryService: DiscoveryService,
|
private readonly discoveryService: DiscoveryService,
|
||||||
private readonly metadataAccessor: TelegrafMetadataAccessor,
|
private readonly metadataAccessor: TelegrafMetadataAccessor,
|
||||||
private readonly metadataScanner: MetadataScanner,
|
private readonly metadataScanner: MetadataScanner,
|
||||||
@ -55,7 +55,7 @@ export class TelegrafSceneExplorer implements OnModuleInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private registerIfListener(
|
private registerIfListener(
|
||||||
scene: Scene,
|
scene: Scene<never>,
|
||||||
instance: Record<string, Function>,
|
instance: Record<string, Function>,
|
||||||
methodKey: string,
|
methodKey: string,
|
||||||
): void {
|
): void {
|
||||||
|
@ -9,7 +9,7 @@ import { TelegrafMetadataAccessor } from '../telegraf.metadata-accessor';
|
|||||||
export class TelegrafUpdateExplorer implements OnModuleInit {
|
export class TelegrafUpdateExplorer implements OnModuleInit {
|
||||||
constructor(
|
constructor(
|
||||||
@Inject(Telegraf)
|
@Inject(Telegraf)
|
||||||
private readonly telegraf: Telegraf,
|
private readonly telegraf: Telegraf<never>,
|
||||||
private readonly discoveryService: DiscoveryService,
|
private readonly discoveryService: DiscoveryService,
|
||||||
private readonly metadataAccessor: TelegrafMetadataAccessor,
|
private readonly metadataAccessor: TelegrafMetadataAccessor,
|
||||||
private readonly metadataScanner: MetadataScanner,
|
private readonly metadataScanner: MetadataScanner,
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
UPDATE_LISTENER_METADATA,
|
UPDATE_LISTENER_METADATA,
|
||||||
UPDATE_METADATA,
|
UPDATE_METADATA,
|
||||||
} from './telegraf.constants';
|
} from './telegraf.constants';
|
||||||
import { ListenerMetadata } from './interfaces/listener-metadata.interface';
|
import { ListenerMetadata } from './interfaces';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class TelegrafMetadataAccessor {
|
export class TelegrafMetadataAccessor {
|
||||||
|
@ -12,11 +12,6 @@ export type OnlyFunctionPropertyNames<T> = {
|
|||||||
[K in keyof T]: T[K] extends (...args: any) => any ? K : never;
|
[K in keyof T]: T[K] extends (...args: any) => any ? K : never;
|
||||||
}[keyof T];
|
}[keyof T];
|
||||||
|
|
||||||
// export type FilterComposerMethods<T extends string> = Exclude<
|
|
||||||
// T,
|
|
||||||
// 'middleware' | 'guard' | 'filter' | 'drop'
|
|
||||||
// >;
|
|
||||||
|
|
||||||
export type ComposerMethodArgs<
|
export type ComposerMethodArgs<
|
||||||
T extends Composer<never>,
|
T extends Composer<never>,
|
||||||
U extends OnlyFunctionPropertyNames<T> = OnlyFunctionPropertyNames<T>
|
U extends OnlyFunctionPropertyNames<T> = OnlyFunctionPropertyNames<T>
|
||||||
@ -26,4 +21,4 @@ export type UpdateMethods = OnlyFunctionPropertyNames<Composer<never>>;
|
|||||||
export type SceneMethods = OnlyFunctionPropertyNames<BaseScene<never>>;
|
export type SceneMethods = OnlyFunctionPropertyNames<BaseScene<never>>;
|
||||||
|
|
||||||
export type TelegrafOption = ConstructorParameters<typeof Telegraf>[1];
|
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"
|
"sample-app": "ts-node --transpile-only -r tsconfig-paths/register sample/main.ts"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"telegraf": "https://github.com/telegraf/telegraf.git#develop"
|
"telegraf": "^3.38.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nestjs/common": "7.6.1",
|
"@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
|
// 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