mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-09-23 09:49:06 +03:00
feat(decorators): TelegrafCommand added
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
export * from './telegraf-use.decorator';
|
||||
export * from './telegraf-on.decorator';
|
||||
export * from './telegraf-hears.decorator';
|
||||
export * from './telegraf-command.decorator';
|
||||
export * from './telegraf-start.decorator';
|
||||
|
12
lib/decorators/telegraf-command.decorator.ts
Normal file
12
lib/decorators/telegraf-command.decorator.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { SetMetadata } from '@nestjs/common';
|
||||
import { DECORATORS } from '../telegraf.constants';
|
||||
|
||||
/**
|
||||
* Command handling.
|
||||
* @param commands Commands
|
||||
*
|
||||
* https://telegraf.js.org/#/?id=command
|
||||
*/
|
||||
export function TelegrafCommand(commands: string | string[]): MethodDecorator {
|
||||
return SetMetadata(DECORATORS.COMMAND, { commands });
|
||||
}
|
Reference in New Issue
Block a user