mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-27 08:18:08 +03:00
14 lines
411 B
TypeScript
14 lines
411 B
TypeScript
import { SetMetadata } from '@nestjs/common';
|
|
import { DECORATORS } from '../telegraf.constants';
|
|
import { HearsTriggers } from 'telegraf';
|
|
|
|
/**
|
|
* Registers middleware for handling text messages.
|
|
* @param triggers Triggers
|
|
*
|
|
* https://telegraf.js.org/#/?id=hears
|
|
*/
|
|
export function TelegrafHears(triggers: HearsTriggers): MethodDecorator {
|
|
return SetMetadata(DECORATORS.HEARS, { triggers: triggers });
|
|
}
|