mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2025-12-17 02:39:52 +03:00
feat(decorators): metadata typings added
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
import { SetMetadata } from '@nestjs/common';
|
||||
import { DECORATORS } from '../telegraf.constants';
|
||||
|
||||
export type TelegrafMentionUsername = string | string[];
|
||||
|
||||
export interface TelegrafMentionMetadata {
|
||||
username: TelegrafMentionUsername;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mention handling.
|
||||
* @param username Username
|
||||
*
|
||||
* https://telegraf.js.org/#/?id=mention
|
||||
*/
|
||||
export function TelegrafMention(username: string | string[]): MethodDecorator {
|
||||
export function TelegrafMention(
|
||||
username: TelegrafMentionUsername,
|
||||
): MethodDecorator {
|
||||
return SetMetadata(DECORATORS.MENTION, { username });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user