mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-09-30 12:27:39 +03:00
feat!(): add custom execution context
This commit is contained in:
7
sample/common/decorators/from.decorator.ts
Normal file
7
sample/common/decorators/from.decorator.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { createParamDecorator, ExecutionContext } from '@nestjs/common';
|
||||
import { TelegrafExecutionContext } from '../../../lib/execution-context';
|
||||
|
||||
export const From = createParamDecorator(
|
||||
(_, ctx: ExecutionContext) =>
|
||||
TelegrafExecutionContext.create(ctx).getContext().from,
|
||||
);
|
Reference in New Issue
Block a user