tdlib / td

Cross-platform library for building Telegram clients
https://core.telegram.org/tdlib
Boost Software License 1.0
6.96k stars 1.43k forks source link

Invalid phone number error on fragment numbers #3022

Open ne0c0de opened 1 month ago

ne0c0de commented 1 month ago

Hi,

I'm getting Invalid phone number when I try to login with a telegram account with the phone number purchased from fragment.com (whis is an official Telegram project too, and it's an active Telegram account)

Is there any solution for this?

levlam commented 1 month ago

You can receive the error only if you entered the number incorrectly. Make sure that you chosen the correct country +888.

ne0c0de commented 1 month ago

I'm using the number as +888 0513 XXYY and the number is correct (hence it's able to login via telegram app) but tdlib is still saying it's incorrect

levlam commented 1 month ago

What error do you receive?

IRGC commented 1 month ago

@ne0c0de it happens when receive login code is disabled on fragment.com website. so make sure it is enabled here. fragment.com > my numbers > get login code

ne0c0de commented 1 month ago

What error do you receive?

when Telegram asks for phone number and I entered it Telegram says that Invalid phone number

levlam commented 1 month ago

TDLib can't say "Invalid phone number".

ne0c0de commented 1 month ago

I'm using nodejs wrapper for tdlib (https://github.com/Bannerets/tdl) and thios is the error when I entered the phone number, so you say that library checkl the phone number (I guess it's because country code) and giving that error?

levlam commented 1 month ago

TDLib doesn't check phone number. It can't return the error. And the server can't return the error with text "Invalid phone number" either.

ne0c0de commented 4 weeks ago

TDLib doesn't check phone number. It can't return the error. And the server can't return the error with text "Invalid phone number" either.

is there any error case for PHONE_NUMBER_INVALID ?

I asked same question on tdl repo and the developer said that if tdl get that error code then it gives output as Invalid phone number: https://github.com/Bannerets/tdl/issues/171

eilvelia commented 4 weeks ago

TDLib doesn't check phone number. It can't return the error. And the server can't return the error with text "Invalid phone number" either.

tdl has a simple (optional) login wrapper that prints Invalid phone number in case PHONE_NUMBER_INVALID is received from TDLib.

levlam commented 3 weeks ago

@ne0c0de As @IRGC explained, you must check that login codes aren't disabled on the fragment.com site for the phone number.