mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-25 15:34:38 +03:00
feat: add new @Update decorator
This commit is contained in:
parent
63bac9e760
commit
05d7ae7b12
@ -14,3 +14,4 @@ export * from './telegraf-cashtag.decorator';
|
|||||||
export * from './telegraf-action.decorator';
|
export * from './telegraf-action.decorator';
|
||||||
export * from './telegraf-inline-query.decorator';
|
export * from './telegraf-inline-query.decorator';
|
||||||
export * from './telegraf-game-query.decorator';
|
export * from './telegraf-game-query.decorator';
|
||||||
|
export * from './update.decorator';
|
||||||
|
8
lib/decorators/update.decorator.ts
Normal file
8
lib/decorators/update.decorator.ts
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { SetMetadata } from '@nestjs/common';
|
||||||
|
import { DECORATORS } from '../telegraf.constants';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* `@Update` decorator, it's like NestJS `@Controller` decorator,
|
||||||
|
* only for Telegram Bot API updates.
|
||||||
|
*/
|
||||||
|
export const Update = (): ClassDecorator => SetMetadata(DECORATORS.UPDATE, {});
|
@ -18,4 +18,5 @@ export const DECORATORS = {
|
|||||||
ACTION: `${DECORATORS_PREFIX}/ACTION`,
|
ACTION: `${DECORATORS_PREFIX}/ACTION`,
|
||||||
INLINE_QUERY: `${DECORATORS_PREFIX}/INLINE_QUERY`,
|
INLINE_QUERY: `${DECORATORS_PREFIX}/INLINE_QUERY`,
|
||||||
GAME_QUERY: `${DECORATORS_PREFIX}/GAME_QUERY`,
|
GAME_QUERY: `${DECORATORS_PREFIX}/GAME_QUERY`,
|
||||||
|
UPDATE: `${DECORATORS_PREFIX}/UPDATE`,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user