mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-25 07:24:39 +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 });
|
|
}
|