import { ModuleMetadata, Type } from '@nestjs/common/interfaces'; import { Middleware, Context } from 'telegraf'; import { TelegrafOptions, LaunchPollingOptions, LaunchWebhookOptions, TelegrafOptions, } from 'telegraf/typings/telegraf'; import { Middleware } from 'telegraf/typings/composer'; import { Context } from './context.interface'; export interface TelegrafModuleOptions { token: string; options?: TelegrafOptions; launchOptions?: { polling?: LaunchPollingOptions; webhook?: LaunchWebhookOptions; }; botName?: string; include?: Function[]; middlewares?: ReadonlyArray>; disableGlobalCatch?: boolean; middlewares?: Middleware[]; } export interface TelegrafOptionsFactory { createTelegrafOptions(): TelegrafModuleOptions; } export interface TelegrafModuleAsyncOptions extends Pick { botName?: string; useExisting?: Type; useClass?: Type; useFactory?: ( ...args: any[] ) => Promise | TelegrafModuleOptions; inject?: any[]; }