nestjs-telegraf/lib/decorators/use.decorator.ts
2020-08-14 12:42:57 +03:00

20 lines
433 B
TypeScript

import { SetMetadata } from '@nestjs/common';
import { DECORATORS } from '../telegraf.constants';
/**
* Registers a middleware.
*
* @see https://telegraf.js.org/#/?id=use
*/
export const Use = (): MethodDecorator => {
return SetMetadata(DECORATORS.USE, {});
};
/**
* Registers a middleware.
*
* @see https://telegraf.js.org/#/?id=use
* @deprecated since v2, use Use decorator instead.
*/
export const TelegrafUse = Use;