mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-25 23:44:39 +03:00
19 lines
459 B
TypeScript
19 lines
459 B
TypeScript
import { SetMetadata } from '@nestjs/common';
|
|
import { DECORATORS } from '../telegraf.constants';
|
|
|
|
export type TelegrafPhonePhone = string | string[];
|
|
|
|
export interface TelegrafPhoneMetadata {
|
|
phone: TelegrafPhonePhone;
|
|
}
|
|
|
|
/**
|
|
* Phone number handling.
|
|
* @param phone Phone number
|
|
*
|
|
* https://telegraf.js.org/#/?id=phone
|
|
*/
|
|
export function TelegrafPhone(phone: TelegrafPhonePhone): MethodDecorator {
|
|
return SetMetadata(DECORATORS.PHONE, { phone });
|
|
}
|