mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-25 07:24:39 +03:00
14 lines
437 B
TypeScript
14 lines
437 B
TypeScript
import { SetMetadata } from '@nestjs/common';
|
|
import { DECORATORS } from '../telegraf.constants';
|
|
import { HearsTriggers } from 'telegraf';
|
|
|
|
/**
|
|
* Registers middleware for handling callback_data actions with regular expressions.
|
|
* @param triggers Triggers
|
|
*
|
|
* https://telegraf.js.org/#/?id=action
|
|
*/
|
|
export function TelegrafAction(triggers: HearsTriggers): MethodDecorator {
|
|
return SetMetadata(DECORATORS.ACTION, { triggers });
|
|
}
|