Flood prevention!
When I get the image ID from the chat record and download it, the server returns this message. What should I do?
Flood prevention. Telegram now requires your program to do requests again only after 5 seconds have passed (TimeToWait property). If you think the culprit of this problem may lie in TLSharp's implementation, open a Github issue please.

LocalId:6781 Secret:3101091358733321214 VolumeId:500041600961 Size:56140
Code:
public virtual async Task Telegram_Download_Photo(string name,int LocalId,long Secret,long VolumeId)
{
var client = NewClient();
await client.ConnectAsync();
BinaryWriter bw;
bw = new BinaryWriter(new FileStream(name, FileMode.Create));
try
{
TLAbsInputFileLocation TLAbsInputFileLocation = new TLInputFileLocation()
{
LocalId = LocalId,
Secret = Secret,
VolumeId = VolumeId
};
TLInputFileLocation TLInputFileLocation = TLAbsInputFileLocation as TLInputFileLocation;
var buffer = await client.GetFile(TLInputFileLocation, 1024*512);
bw.Write(buffer.Bytes);
bw.Close();
}
catch (Exception ee)
{
bw.Close();
throw ee;
}
}
Why do you think this is a bug in TLSharp?
You should set Timeout for call API. If you call it continuously without a gap time, you may block from Telegram for many times.
You should set Timeout for call API. If you call it continuously without a gap time, you may block from Telegram for many times.
Thanks !
You should set Timeout for call API. If you call it continuously without a gap time, you may block from Telegram for many times.
Can you add example code ?
You should set Timeout for call API. If you call it continuously without a gap time, you may block from Telegram for many times.
Can you add example code ?
I need code example too!