mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-12-14 17:30:58 +03:00
feat: remove "Telegraf" prefix from decorator names
This commit is contained in:
27
lib/decorators/inline-query.decorator.ts
Normal file
27
lib/decorators/inline-query.decorator.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { SetMetadata } from '@nestjs/common';
|
||||
import { DECORATORS } from '../telegraf.constants';
|
||||
|
||||
export type TelegrafInlineQueryTriggers = string | string[] | RegExp | RegExp[];
|
||||
|
||||
export interface InlineQueryOptions {
|
||||
triggers: TelegrafInlineQueryTriggers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers middleware for handling inline_query actions with regular expressions.
|
||||
*
|
||||
* @see https://telegraf.js.org/#/?id=inlinequery
|
||||
*/
|
||||
export const InlineQuery = (
|
||||
triggers: TelegrafInlineQueryTriggers,
|
||||
): MethodDecorator => {
|
||||
return SetMetadata(DECORATORS.INLINE_QUERY, { triggers });
|
||||
};
|
||||
|
||||
/**
|
||||
* Registers middleware for handling inline_query actions with regular expressions.
|
||||
*
|
||||
* @see https://telegraf.js.org/#/?id=inlinequery
|
||||
* @deprecated since v2, use InlineQuery decorator instead.
|
||||
*/
|
||||
export const TelegrafInlineQuery = InlineQuery;
|
||||
Reference in New Issue
Block a user