TLSharp/TLSharp.Core/Network/Exceptions/FloodException.cs
CheshireCaat 366c937260 Exceptions moved to separate folders (#899)
Exceptions from MtProtoSender.cs to TLSharp.Core/Network/Exceptions
Exceptions from TelegramClient.cs to TLSharp.Core/Exceptions
2020-04-01 14:59:56 +04:30

16 lines
604 B
C#

using System;
namespace TLSharp.Core.Network.Exceptions
{
public class FloodException : Exception
{
public TimeSpan TimeToWait { get; private set; }
internal FloodException(TimeSpan timeToWait)
: base($"Flood prevention. Telegram now requires your program to do requests again only after {timeToWait.TotalSeconds} seconds have passed ({nameof(TimeToWait)} property)." +
" If you think the culprit of this problem may lie in TLSharp's implementation, open a Github issue please.")
{
TimeToWait = timeToWait;
}
}
}