Closed mx-key closed 2 years ago
There is no bug. The error comes from Telegram and it works as intended.
If so, why does a client that is authorized from a phone from Ukraine throw a PhoneMigrateError exception when trying to register from any phone in some countries. Only numbers that are located in the same data center where the account is registered from which registration is made are available for registration.
If api_id, api_hash are linked to a Ukrainian phone number, I can't register accounts using phones in 80% of countries. What to do in this case?
API ID and hash are not linked to specific data centers as far as I know. Raw API does not automatically handle DC migrations, but client.sign_up
should. This is offtopic here.
problem with SendCodeRequest - does it automatically handle DC migrations? API ID and hash are not linked - Then why DC is listed at https://my.telegram.org/apps and I can't change it?
That's the test server. The library has a hardcoded datacenter but switches to others at runtime if necessary. Friendly methods do this. Raw API does not.
I am trying to register telegram accounts using phone numbers from different countries. For most phones, a PhoneMigrateError is thrown when a SendCodeRequest is requested. In my opinion, this occurs when the client's phone number and the phone number to which the code is sent are in different data centers.
Code that causes the issue