From 4e75b086e17319617f3727302c8cfcbe80577937 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 29 Jul 2016 12:09:50 -0700 Subject: [PATCH] Using Optional now. --- src/Discord.Net/API/DiscordSocketApiClient.cs | 3 ++- src/Discord.Net/API/Gateway/IdentifyParams.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Discord.Net/API/DiscordSocketApiClient.cs b/src/Discord.Net/API/DiscordSocketApiClient.cs index f6040081e..be149607d 100644 --- a/src/Discord.Net/API/DiscordSocketApiClient.cs +++ b/src/Discord.Net/API/DiscordSocketApiClient.cs @@ -191,8 +191,9 @@ namespace Discord.API Properties = props, LargeThreshold = largeThreshold, UseCompression = useCompression, - ShardingParams = totalShards > 1 ? new int[] { shardID, totalShards } : null }; + if (totalShards > 1) + msg.ShardingParams = new int[] { shardID, totalShards }; await SendGatewayAsync(GatewayOpCode.Identify, msg, options: options).ConfigureAwait(false); } diff --git a/src/Discord.Net/API/Gateway/IdentifyParams.cs b/src/Discord.Net/API/Gateway/IdentifyParams.cs index 26e2952a1..2681b6708 100644 --- a/src/Discord.Net/API/Gateway/IdentifyParams.cs +++ b/src/Discord.Net/API/Gateway/IdentifyParams.cs @@ -14,7 +14,7 @@ namespace Discord.API.Gateway public int LargeThreshold { get; set; } [JsonProperty("compress")] public bool UseCompression { get; set; } - [JsonProperty("shard", NullValueHandling = NullValueHandling.Ignore)] - public int[] ShardingParams { get; set; } + [JsonProperty("shard")] + public Optional ShardingParams { get; set; } } }