mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-24 15:04:38 +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:
|
||||
return next;
|
||||
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:
|
||||
return ctx.message ? ctx.message[data as string] : ctx.message;
|
||||
return data && ctx.message ? ctx.message[data as string] : ctx.message;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user