PluralKit/Myriad/Gateway/GatewayCloseException.cs

32 lines
1008 B
C#
Raw Permalink Normal View History

namespace Myriad.Gateway;
2020-12-22 12:15:26 +00:00
// TODO: unused?
public class GatewayCloseException: Exception
2020-12-22 12:15:26 +00:00
{
public GatewayCloseException(int closeCode, string closeReason) : base($"{closeCode}: {closeReason}")
2020-12-22 12:15:26 +00:00
{
CloseCode = closeCode;
CloseReason = closeReason;
2020-12-22 12:15:26 +00:00
}
public int CloseCode { get; }
public string CloseReason { get; }
}
public class GatewayCloseCode
{
public const int UnknownError = 4000;
public const int UnknownOpcode = 4001;
public const int DecodeError = 4002;
public const int NotAuthenticated = 4003;
public const int AuthenticationFailed = 4004;
public const int AlreadyAuthenticated = 4005;
public const int InvalidSeq = 4007;
public const int RateLimited = 4008;
public const int SessionTimedOut = 4009;
public const int InvalidShard = 4010;
public const int ShardingRequired = 4011;
public const int InvalidApiVersion = 4012;
public const int InvalidIntent = 4013;
public const int DisallowedIntent = 4014;
2020-12-22 12:15:26 +00:00
}