我在C#.Net中创建了一个电报客户端,并使用带TeleSharp的电报API来通过代码对用户进行身份验证。 经过4次电报后,我无法验证用户身份,并说“太快”(等待24小时)。 有没有办法进行一次身份验证并保存代码或创建不会被阻止的测试客户端?
private TelegramClient NewClient()
{
try
{
return new TelegramClient(793924, "df6abda591c5e87782fe9368f264fdb8");
}
catch
{
MessageBox.Show("Credantials Not Valid");
return null;
}
}
TelegramClient client;
string hash;
private async void CodeButton_Click(object sender, EventArgs e)
{
client = new TelegramClient(793924, "df6abda591c5e87782fe9368f264fdb8");
await client.ConnectAsync();
hash = await client.SendCodeRequestAsync(PhoneText.Text);
MessageBox.Show("Sent!");
}
private async void SignButton_Click(object sender, EventArgs e)
{
var user = await client.MakeAuthAsync(PhoneText.Text, hash, CodeText.Text);
MessageBox.Show("Connected");
Form1 Main = new Form1(user, client);
//Form1 Main = new Form1();
this.Hide();
Main.Show();
}