mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-26 15:58:09 +03:00
20 lines
433 B
TypeScript
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;
|