Error PHONE_MIGRATE_X when using TLsharp to program telegrams

I started using TLSharp in C # for Telegram. When I authenticate a user using this function:

public async Task AuthUser()
{
   var store = new FileSessionStore();
   var client = new TelegramClient(store, "session");

   await client.Connect();

   var hash = await client.SendCodeRequest(NumberToAuthenticate);
   var code = "123"; // you can change code in debugger

   var user = await client.MakeAuth(NumberToAuthenticate, hash, code);

   Assert.IsNotNull(user);
}

In SendCodeRequestto my phone number I get an error PHONE_MIGRATE_4. How can i fix this?

The Telegram website for this error says that I need to switch my data center. How can I do this in TLsharp?

+4
source share
2 answers

I did not use TLSharp, but according to its documentation you need to update the data center address in the TLSharp.Core.Network.TcpTransport.csfile provided by the TLSharp library.

:

I get an error MIGRATE_X?

You should change the telegram server address to X. X server address you can get from InitResponse or from Server addresses list. Address should be changed in `TLSharp.Core.Network.TcpTransport.cs`

Server addresses:

    Server 1: 149.154.175.50:443
    Server 2: 149.154.167.51:443
    Server 3: 149.154.175.100:443
    Server 4: 149.154.167.91:443
    Server 5: 91.108.56.165:443

, TLSharp.Core.Network.TcpTransport.cs, 91.108.56.165, .. server 5.

0

help.getNearestDC, DC.

MIGRATE_X, , , DataCenter, , .

0

Source: https://habr.com/ru/post/1623643/


All Articles