feat(): add middleware support & refactor

This commit is contained in:
Arthur
2020-12-30 01:49:09 +03:00
parent 306f239603
commit 3e585859d0
35 changed files with 105 additions and 81 deletions

View File

@@ -1,6 +1,4 @@
import { UpdateMethods } from '../telegraf.types';
export interface ListenerMetadata {
method: UpdateMethods;
method: string;
args: unknown[];
}

View File

@@ -1,10 +1,12 @@
import { ModuleMetadata, Type } from '@nestjs/common/interfaces';
import { Middleware, Context } from 'telegraf';
import { TelegrafLaunchOption, TelegrafOption } from '../telegraf.types';
export interface TelegrafModuleOptions {
export interface TelegrafModuleOptions<C extends Context = Context> {
token: string;
options?: TelegrafOption;
launchOptions?: TelegrafLaunchOption;
middlewares?: Middleware<C>[];
}
export interface TelegrafOptionsFactory {