Skip to content

setAuthPhoneNumber

Sahri Riza Umami edited this page Dec 8, 2016 · 2 revisions

Sets user's phone number and sends authentication code to the user.

setAuthPhoneNumber(phone_number, allow_flash_call, is_current_phone_number)

Works only when authGetState returns authStateWaitPhoneNumber.
If phone number is not recognized or another error has happened, returns an error. Otherwise returns authStateWaitCode.

Option Description
  • phone_number User's phone number in any reasonable format.
  • allow_flash_call Pass True, if code can be sent via flash call to the specified phone number.
  • is_current_phone_number Pass true, if the phone number is used on the current device. Ignored if allow_flash_call is False

Example

Set phone number to 6285812345667 (+62 is a country code) which is not a phone where this message is sent, and allow Telegram to call if SMS or Telegram message are failed.

setAuthPhoneNumber(6285812345667, 1, 0)

Test script
Frequently Asked Questions
The Functions

Clone this wiki locally