/// <summary> /// Sends phone number confirmation code. Should be called when user presses "https://t.me/confirmphone?phone=*******&hash=**********" or "tg://confirmphone?phone=*******&hash=**********" link /// </summary> public static Task <AuthenticationCodeInfo> SendPhoneNumberConfirmationCodeAsync( this Client client, string hash = default, string phoneNumber = default, PhoneNumberAuthenticationSettings settings = default) { return(client.ExecuteAsync(new SendPhoneNumberConfirmationCode { Hash = hash, PhoneNumber = phoneNumber, Settings = settings })); }
/// <summary> /// Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code /// </summary> public static Task <AuthenticationCodeInfo> ChangePhoneNumberAsync( this Client client, string phoneNumber = default, PhoneNumberAuthenticationSettings settings = default) { return(client.ExecuteAsync(new ChangePhoneNumber { PhoneNumber = phoneNumber, Settings = settings })); }
/// <summary> /// Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, /// </summary> public static Task <Ok> SetAuthenticationPhoneNumberAsync( this Client client, string phoneNumber = default, PhoneNumberAuthenticationSettings settings = default) { return(client.ExecuteAsync(new SetAuthenticationPhoneNumber { PhoneNumber = phoneNumber, Settings = settings })); }
/// <summary> /// Sends a code to verify a phone number to be added to a user's Telegram Passport /// </summary> public static Task <AuthenticationCodeInfo> SendPhoneNumberVerificationCodeAsync(this Client client, string phoneNumber = default(string), PhoneNumberAuthenticationSettings settings = default(PhoneNumberAuthenticationSettings)) { return(client.ExecuteAsync(new SendPhoneNumberVerificationCode { PhoneNumber = phoneNumber, Settings = settings, })); }