diff --git a/lib/interfaces/telegraf-options.interface.ts b/lib/interfaces/telegraf-options.interface.ts index 417d5bf..09ffb2c 100644 --- a/lib/interfaces/telegraf-options.interface.ts +++ b/lib/interfaces/telegraf-options.interface.ts @@ -1,11 +1,18 @@ import { ModuleMetadata, Type } from '@nestjs/common/interfaces'; import { Middleware, Context } from 'telegraf'; -import { TelegrafLaunchOption, TelegrafOption } from '../telegraf.types'; +import { + LaunchPollingOptions, + LaunchWebhookOptions, + TelegrafOptions, +} from 'telegraf/typings/telegraf'; export interface TelegrafModuleOptions { token: string; - options?: TelegrafOption; - launchOptions?: TelegrafLaunchOption; + options?: TelegrafOptions; + launchOptions?: { + polling?: LaunchPollingOptions; + webhook?: LaunchWebhookOptions; + }; middlewares?: Middleware[]; } diff --git a/lib/telegraf.types.ts b/lib/telegraf.types.ts index 84019a5..4a6dc63 100644 --- a/lib/telegraf.types.ts +++ b/lib/telegraf.types.ts @@ -1,4 +1,4 @@ -import { Composer, Middleware, BaseScene, Telegraf } from 'telegraf'; +import { BaseScene, Composer, Middleware } from 'telegraf'; export type Filter = T extends [] ? [] @@ -19,6 +19,3 @@ export type ComposerMethodArgs< export type UpdateMethods = OnlyFunctionPropertyNames>; export type SceneMethods = OnlyFunctionPropertyNames>; - -export type TelegrafOption = ConstructorParameters[1]; -export type TelegrafLaunchOption = Parameters['launch']>[0];