mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-26 07:48:11 +03:00
15 lines
392 B
TypeScript
15 lines
392 B
TypeScript
|
import { SetMetadata } from '@nestjs/common';
|
||
|
import { DECORATORS } from '../telegraf.constants';
|
||
|
|
||
|
export type Entity = string | string[] | RegExp | RegExp[] | Function;
|
||
|
|
||
|
/**
|
||
|
* Entity handling.
|
||
|
* @param entity Entity name
|
||
|
*
|
||
|
* https://telegraf.js.org/#/?id=entity
|
||
|
*/
|
||
|
export function TelegrafEntity(entity: Entity): MethodDecorator {
|
||
|
return SetMetadata(DECORATORS.ENTITY, { entity });
|
||
|
}
|