From 4ada932d4e93c8323b2075ce55c9f3ec6fc84f75 Mon Sep 17 00:00:00 2001 From: Morb0 Date: Wed, 6 Jan 2021 19:37:30 +0300 Subject: [PATCH] fix(params-factory): use new arguments set --- lib/factories/telegraf-params-factory.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/factories/telegraf-params-factory.ts b/lib/factories/telegraf-params-factory.ts index df4b7e0..e52d6ba 100644 --- a/lib/factories/telegraf-params-factory.ts +++ b/lib/factories/telegraf-params-factory.ts @@ -1,3 +1,4 @@ +import { ParamData } from '@nestjs/common'; import { ParamsFactory } from '@nestjs/core/helpers/external-context-creator'; import { Context } from 'telegraf'; import { TelegrafParamtype } from '../enums/telegraf-paramtype.enum'; @@ -5,9 +6,12 @@ import { TelegrafParamtype } from '../enums/telegraf-paramtype.enum'; export class TelegrafParamsFactory implements ParamsFactory { exchangeKeyForValue( type: TelegrafParamtype, - ctx: Context, - next: Function, + data: ParamData, + args: unknown[], ): unknown { + const ctx = args[0] as Context; + const next = args[1] as Function; + switch (type) { case TelegrafParamtype.CONTEXT: return ctx;