mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-24 23:14:39 +03:00
fix(params-factory): add data propery check (#231)
This commit is contained in:
parent
c7bc618c31
commit
0c50fca66e
@ -18,9 +18,9 @@ export class TelegrafParamsFactory implements ParamsFactory {
|
|||||||
case TelegrafParamtype.NEXT:
|
case TelegrafParamtype.NEXT:
|
||||||
return next;
|
return next;
|
||||||
case TelegrafParamtype.SENDER:
|
case TelegrafParamtype.SENDER:
|
||||||
return ctx.from ? ctx.from[data as string] : ctx.from;
|
return data && ctx.from ? ctx.from[data as string] : ctx.from;
|
||||||
case TelegrafParamtype.MESSAGE:
|
case TelegrafParamtype.MESSAGE:
|
||||||
return ctx.message ? ctx.message[data as string] : ctx.message;
|
return data && ctx.message ? ctx.message[data as string] : ctx.message;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user