feat: add GlobalUpdate decorator (#2)

This commit is contained in:
2023-07-23 15:38:05 +03:00
committed by GitHub
parent 7f43458c55
commit dca35a0c7f
5 changed files with 44 additions and 2 deletions

View File

@@ -0,0 +1,9 @@
import { SetMetadata } from '@nestjs/common';
import { GLOBAL_UPDATE_METADATA } from '../../telegraf.constants';
/**
* `@GlobalUpdate` decorator, it's like `@Update` decorator,
* but processed before the scenes
*/
export const GlobalUpdate = (): ClassDecorator =>
SetMetadata(GLOBAL_UPDATE_METADATA, true);

View File

@@ -1,4 +1,5 @@
export * from './update.decorator';
export * from './global-update.decorator';
export * from './scene.decorator';
export * from './wizard.decorator';
export * from './inject-bot.decorator';