TLSharp/TLSharp.Core/Network/Exceptions/FloodException.cs
CheshireCaat 8729b7d85b Exceptions moved to separate folders (#899)
Exceptions from MtProtoSender.cs to TLSharp.Core/Network/Exceptions
Exceptions from TelegramClient.cs to TLSharp.Core/Exceptions
2020-01-25 02:28:37 +08:00

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;
}
}
}