{"action":"created","issue":{"url":"https://api.github.com/repos/sochix/TLSharp/issues/290","repository_url":"https://api.github.com/repos/sochix/TLSharp","labels_url":"https://api.github.com/repos/sochix/TLSharp/issues/290/labels{/name}","comments_url":"https://api.github.com/repos/sochix/TLSharp/issues/290/comments","events_url":"https://api.github.com/repos/sochix/TLSharp/issues/290/events","html_url":"https://github.com/sochix/TLSharp/issues/290","id":187429606,"number":290,"title":"TLSharp.Core.Network.PhoneMigrationException","user":{"login":"ivanovaleksey","id":11523473,"avatar_url":"https://avatars.githubusercontent.com/u/11523473?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanovaleksey","html_url":"https://github.com/ivanovaleksey","followers_url":"https://api.github.com/users/ivanovaleksey/followers","following_url":"https://api.github.com/users/ivanovaleksey/following{/other_user}","gists_url":"https://api.github.com/users/ivanovaleksey/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanovaleksey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanovaleksey/subscriptions","organizations_url":"https://api.github.com/users/ivanovaleksey/orgs","repos_url":"https://api.github.com/users/ivanovaleksey/repos","events_url":"https://api.github.com/users/ivanovaleksey/events{/privacy}","received_events_url":"https://api.github.com/users/ivanovaleksey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-04T20:22:30Z","updated_at":"2016-11-04T22:08:59Z","closed_at":null,"body":"Hi!\r\nThank for the nice library.\r\n\r\nI would like to use in order to check if phone is registered in Telegram.\r\nBut I've faced with an issue.\r\n\r\nHere is my simple code\r\n```\r\nint apiId = APP_ID;\r\nstring apiHash = APP_HASH;\r\n\r\nvar client = new TelegramClient(apiId, apiHash);\r\nawait client.ConnectAsync();\r\nvar result = await client.IsPhoneRegisteredAsync(PHONE_NUMBER);\r\n```\r\n\r\nUnfortunately I am getting an error\r\n```\r\nAn exception of type 'TLSharp.Core.Network.PhoneMigrationException' occurred in mscorlib.dll but was not handled in user code\r\n\r\nAdditional information: Phone number registered to a different DC: 2. See: https://github.com/sochix/TLSharp#i-get-a-xxxmigrationexception-or-a-migrate_x-error\r\n```\r\n\r\nIs said that the library should automatically handle these errors. But it doesn't happen.\r\n\r\nIn my application settings I have the following DC configuration.\r\n![image](https://cloud.githubusercontent.com/assets/11523473/20021307/4e71b19a-a2e6-11e6-9aab-171a4b48811f.png)\r\n \r\nCan I specify DC to be used? \r\nI have tried to google the error but I didn't find any solution.\r\nWhat can I do? Am I doing something wrong?\r\n\r\nThanks in advance."},"comment":{"url":"https://api.github.com/repos/sochix/TLSharp/issues/comments/258559882","html_url":"https://github.com/sochix/TLSharp/issues/290#issuecomment-258559882","issue_url":"https://api.github.com/repos/sochix/TLSharp/issues/290","id":258559882,"user":{"login":"ivanovaleksey","id":11523473,"avatar_url":"https://avatars.githubusercontent.com/u/11523473?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanovaleksey","html_url":"https://github.com/ivanovaleksey","followers_url":"https://api.github.com/users/ivanovaleksey/followers","following_url":"https://api.github.com/users/ivanovaleksey/following{/other_user}","gists_url":"https://api.github.com/users/ivanovaleksey/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanovaleksey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanovaleksey/subscriptions","organizations_url":"https://api.github.com/users/ivanovaleksey/orgs","repos_url":"https://api.github.com/users/ivanovaleksey/repos","events_url":"https://api.github.com/users/ivanovaleksey/events{/privacy}","received_events_url":"https://api.github.com/users/ivanovaleksey/received_events","type":"User","site_admin":false},"created_at":"2016-11-04T22:08:59Z","updated_at":"2016-11-04T22:08:59Z","body":"I have noticed that `SendCodeRequestAsync()` catches `PhoneMigrationException` exception and reconnects to proper DC. So I just added `SendCodeRequestAsync()` call and now it works fine.\r\n\r\nBut `IsPhoneRegisteredAsync()` should work without authorization. Is it correct that I should call `SendCodeRequestAsync()` anyway?"}}
{"actor":{"display_login":"ivanovaleksey"}}