feat(decorators): TelegrafMention added

This commit is contained in:
Aleksandr Bukhalo
2020-03-19 16:58:27 +03:00
parent 8bd20131a1
commit f5d9cf13b6
4 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import { SetMetadata } from '@nestjs/common';
import { DECORATORS } from '../telegraf.constants';
/**
* Mention handling.
* @param username Username
*
* https://telegraf.js.org/#/?id=mention
*/
export function TelegrafMention(username: string | string[]): MethodDecorator {
return SetMetadata(DECORATORS.MENTION, { username });
}