Esempio n. 1
0
 /// <summary>
 /// Creates a new instance which spawns a range of Shards from id.
 /// </summary>
 /// <param name="token">The token of the bot.</param>
 /// <param name="shardCount">The shard count to use.</param>
 /// <param name="shardIds">The ids of shards to spawn.</param>
 /// <param name="identifyOptions">Options to send while Identifying</param>
 /// <param name="shardingSystem">The Sharding System to use by the Gateway</param>
 public Cluster(string token, int shardCount, IEnumerable <int> shardIds, IdentifyOptions identifyOptions = null, ShardingSystem shardingSystem = ShardingSystem.DEFAULT) : this(token, shardCount, identifyOptions, shardingSystem)
     => ShardIds = shardIds;
Esempio n. 2
0
 /// <summary>
 ///     Creates an instance of Shard.
 /// </summary>
 /// <param name="token">The Token to use.</param>
 /// <param name="id">The Id of this Shard.</param>
 /// <param name="shardCount">The shard count that is used.</param>
 /// <param name="identifyOptions">Options to send while Identifying</param>
 /// <param name="shardingSystem">The Sharding System to use by the Gateway</param>
 // ReSharper disable once UnusedMember.Global
 public Shard(string token, int id, int shardCount, IdentifyOptions identifyOptions = null, ShardingSystem shardingSystem = ShardingSystem.DEFAULT)
 {
     IdentifyOptions = identifyOptions;
     ShardGateway    = Util.GetGateway(token, shardCount, shardingSystem);
     Id = id;
 }
Esempio n. 3
0
 /// <summary>
 ///     Creates a new instance and uses either provided or recommended shard count.
 /// </summary>
 /// <param name="token">The token of the bot.</param>
 /// <param name="shardCount">The shard count to use.</param>
 /// <param name="identifyOptions">Options to send while Identifying</param>
 /// <param name="shardingSystem">The Sharding System to use by the Gateway</param>
 public Cluster(string token, int?shardCount = null, IdentifyOptions identifyOptions = null, ShardingSystem shardingSystem = ShardingSystem.DEFAULT)
 {
     Gateway         = Util.GetGateway(token, shardCount, shardingSystem);
     IdentifyOptions = identifyOptions;
 }
Esempio n. 4
0
 /// <summary>
 ///     Creates an instance from a Cluster.
 /// </summary>
 /// <param name="cluster">The Cluster this Shard is part of.</param>
 /// <param name="id">The Id of this Shard.</param>
 /// <param name="identifyOptions">Options to send while Identifying</param>
 public Shard(Cluster cluster, int id, IdentifyOptions identifyOptions = null)
 {
     IdentifyOptions = identifyOptions;
     Cluster         = cluster;
     Id = id;
 }