feat(decorators): TelegrafHashtag added

This commit is contained in:
Aleksandr Bukhalo
2020-03-19 17:14:34 +03:00
parent 225c931dbb
commit 68690da83e
5 changed files with 40 additions and 0 deletions

View File

@@ -8,3 +8,4 @@ export * from './telegraf-settings.decorator';
export * from './telegraf-entity.decorator';
export * from './telegraf-mention.decorator';
export * from './telegraf-phone.decorator';
export * from './telegraf-hashtag.decorator';

View File

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