mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-09-23 09:49:06 +03:00
feat(decorators): TelegrafInlineQuery added
This commit is contained in:
@@ -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';
|
||||
|
14
lib/decorators/telegraf-inline-query.decorator.ts
Normal file
14
lib/decorators/telegraf-inline-query.decorator.ts
Normal 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 });
|
||||
}
|
Reference in New Issue
Block a user