Using Optional<T> now.
This commit is contained in:
@@ -191,8 +191,9 @@ namespace Discord.API
|
|||||||
Properties = props,
|
Properties = props,
|
||||||
LargeThreshold = largeThreshold,
|
LargeThreshold = largeThreshold,
|
||||||
UseCompression = useCompression,
|
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);
|
await SendGatewayAsync(GatewayOpCode.Identify, msg, options: options).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace Discord.API.Gateway
|
|||||||
public int LargeThreshold { get; set; }
|
public int LargeThreshold { get; set; }
|
||||||
[JsonProperty("compress")]
|
[JsonProperty("compress")]
|
||||||
public bool UseCompression { get; set; }
|
public bool UseCompression { get; set; }
|
||||||
[JsonProperty("shard", NullValueHandling = NullValueHandling.Ignore)]
|
[JsonProperty("shard")]
|
||||||
public int[] ShardingParams { get; set; }
|
public Optional<int[]> ShardingParams { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user