我正在使用TLSharp庫實現自定義電報客戶端。當我運行下面的代碼:TLSharp數據中心(dc)異常
public async Task<string> SendCodeRequest(string phoneNumber)
{
var completed = false;
TL.AuthSendCodeRequest request = null;
while (!completed)
{
request = new TL.AuthSendCodeRequest(phoneNumber, 5, _apiId, _apiHash, "en");
await _sender.Send(request);
await _sender.Receive(request);
completed = true;
}
// TODO handle other types (such as SMS)
if (request.Result is TL.AuthSentCodeType)
{
var result = (TL.AuthSentCodeType)request.Result;
return result.PhoneCodeHash;
}
else
{
var result = (TL.AuthSentAppCodeType)request.Result;
return result.PhoneCodeHash;
}
}
我給了我以下異常:註冊{} dcIdx直流
您的電話號碼。請更新設置。 請參閱https://github.com/sochix/TLSharp#i-get-an-error-migrate_x對於 的詳細信息。
提到的github頁面說TLSharp自己處理這些異常。所以我猜這個庫核心有些問題,因爲代碼本身不會產生異常來解決數據中心IP問題。
任何幫助,將不勝感激。