mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-24 23:14:39 +03:00
fix(params-factory): use new arguments set
This commit is contained in:
parent
2030f086bf
commit
4ada932d4e
@ -1,3 +1,4 @@
|
|||||||
|
import { ParamData } from '@nestjs/common';
|
||||||
import { ParamsFactory } from '@nestjs/core/helpers/external-context-creator';
|
import { ParamsFactory } from '@nestjs/core/helpers/external-context-creator';
|
||||||
import { Context } from 'telegraf';
|
import { Context } from 'telegraf';
|
||||||
import { TelegrafParamtype } from '../enums/telegraf-paramtype.enum';
|
import { TelegrafParamtype } from '../enums/telegraf-paramtype.enum';
|
||||||
@ -5,9 +6,12 @@ import { TelegrafParamtype } from '../enums/telegraf-paramtype.enum';
|
|||||||
export class TelegrafParamsFactory implements ParamsFactory {
|
export class TelegrafParamsFactory implements ParamsFactory {
|
||||||
exchangeKeyForValue(
|
exchangeKeyForValue(
|
||||||
type: TelegrafParamtype,
|
type: TelegrafParamtype,
|
||||||
ctx: Context,
|
data: ParamData,
|
||||||
next: Function,
|
args: unknown[],
|
||||||
): unknown {
|
): unknown {
|
||||||
|
const ctx = args[0] as Context;
|
||||||
|
const next = args[1] as Function;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TelegrafParamtype.CONTEXT:
|
case TelegrafParamtype.CONTEXT:
|
||||||
return ctx;
|
return ctx;
|
||||||
|
Loading…
Reference in New Issue
Block a user