Browse Source

Using Optional<T> now.

tags/1.0-rc
matt 9 years ago
parent
commit
4e75b086e1
2 changed files with 4 additions and 3 deletions
  1. +2
    -1
      src/Discord.Net/API/DiscordSocketApiClient.cs
  2. +2
    -2
      src/Discord.Net/API/Gateway/IdentifyParams.cs

+ 2
- 1
src/Discord.Net/API/DiscordSocketApiClient.cs View File

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


+ 2
- 2
src/Discord.Net/API/Gateway/IdentifyParams.cs View File

@@ -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<int[]> ShardingParams { get; set; }
}
}

Loading…
Cancel
Save