fix(params-factory): use new arguments set

This commit is contained in:
Morb0 2021-01-06 19:37:30 +03:00
parent 2030f086bf
commit 4ada932d4e

View File

@ -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;