mirror of
https://github.com/Maks1mS/nestjs-telegraf.git
synced 2024-12-27 08:18:08 +03:00
26 lines
594 B
TypeScript
26 lines
594 B
TypeScript
import { SetMetadata } from '@nestjs/common';
|
|
import { DECORATORS } from '../telegraf.constants';
|
|
|
|
export type TelegrafPhonePhone = string | string[];
|
|
|
|
export interface PhoneOptions {
|
|
phone: TelegrafPhonePhone;
|
|
}
|
|
|
|
/**
|
|
* Phone number handling.
|
|
*
|
|
* @see https://telegraf.js.org/#/?id=phone
|
|
*/
|
|
export const Phone = (phone: TelegrafPhonePhone): MethodDecorator => {
|
|
return SetMetadata(DECORATORS.PHONE, { phone });
|
|
};
|
|
|
|
/**
|
|
* Phone number handling.
|
|
*
|
|
* @see https://telegraf.js.org/#/?id=phone
|
|
* @deprecated since v2, use Phone decorator instead.
|
|
*/
|
|
export const TelegrafPhone = Phone;
|