feat(decorators): TelegrafInlineQuery added

This commit is contained in:
Aleksandr Bukhalo
2020-03-19 17:25:47 +03:00
parent 76e0eee3ad
commit f65905ed0d
5 changed files with 44 additions and 0 deletions

View File

@@ -11,3 +11,4 @@ export * from './telegraf-phone.decorator';
export * from './telegraf-hashtag.decorator';
export * from './telegraf-cashtag.decorator';
export * from './telegraf-action.decorator';
export * from './telegraf-inline-query.decorator';

View File

@@ -0,0 +1,14 @@
import { SetMetadata } from '@nestjs/common';
import { DECORATORS } from '../telegraf.constants';
export type Triggers = string | string[] | RegExp | RegExp[];
/**
* Registers middleware for handling inline_query actions with regular expressions.
* @param triggers Triggers
*
* https://telegraf.js.org/#/?id=inlinequery
*/
export function TelegrafInlineQuery(triggers: Triggers): MethodDecorator {
return SetMetadata(DECORATORS.INLINE_QUERY, { triggers });
}