From e004b7c451267d31b8ec502fc5b950778dd3f13b Mon Sep 17 00:00:00 2001 From: Brandon Smith Date: Wed, 23 Sep 2015 15:06:55 -0300 Subject: [PATCH 1/2] Use API v3 --- src/Discord.Net/Net/WebSockets/Commands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discord.Net/Net/WebSockets/Commands.cs b/src/Discord.Net/Net/WebSockets/Commands.cs index d214c5199..2fe053c92 100644 --- a/src/Discord.Net/Net/WebSockets/Commands.cs +++ b/src/Discord.Net/Net/WebSockets/Commands.cs @@ -26,7 +26,7 @@ namespace Discord.Net.WebSockets [JsonProperty(PropertyName = "token")] public string Token; [JsonProperty(PropertyName = "v")] - public int Version = 2; + public int Version = 3; [JsonProperty(PropertyName = "properties")] public Dictionary Properties = new Dictionary(); } From 539d8eff74f5afb4c3077a4deda51f83d5ce0533 Mon Sep 17 00:00:00 2001 From: Brandon Smith Date: Wed, 23 Sep 2015 15:36:58 -0300 Subject: [PATCH 2/2] Improved Close Message description --- src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs b/src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs index 2a04b114d..36b28ca8d 100644 --- a/src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs +++ b/src/Discord.Net/Net/WebSockets/WebSocket.BuiltIn.cs @@ -85,7 +85,8 @@ namespace Discord.Net.WebSockets } if (result.MessageType == WebSocketMessageType.Close) - throw new Exception($"Got Close Message ({result.CloseStatus?.ToString() ?? "Unexpected"}): {result.CloseStatusDescription ?? "No Reason"}"); + throw new Exception($"Got Close Message ({result.CloseStatus?.ToString() ?? "Unexpected"}): " + + result.CloseStatusDescription != "" ? result.CloseStatusDescription : "No Reason"); else builder.Append(Encoding.UTF8.GetString(buffer.Array, buffer.Offset, result.Count));