feat(decorators): TelegrafPhone added

This commit is contained in:
Aleksandr Bukhalo
2020-03-19 17:02:37 +03:00
parent f5d9cf13b6
commit 225c931dbb
5 changed files with 42 additions and 0 deletions

View File

@@ -4,4 +4,7 @@ export * from './telegraf-hears.decorator';
export * from './telegraf-command.decorator';
export * from './telegraf-start.decorator';
export * from './telegraf-help.decorator';
export * from './telegraf-settings.decorator';
export * from './telegraf-entity.decorator';
export * from './telegraf-mention.decorator';
export * from './telegraf-phone.decorator';

View File

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