feat: show total shards from cluster configuration if present
This commit is contained in:
		@@ -30,6 +30,7 @@ public class BotConfig
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public record ClusterSettings
 | 
					    public record ClusterSettings
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
 | 
					        // this is zero-indexed
 | 
				
			||||||
        public string NodeName { get; set; }
 | 
					        public string NodeName { get; set; }
 | 
				
			||||||
        public int TotalShards { get; set; }
 | 
					        public int TotalShards { get; set; }
 | 
				
			||||||
        public int TotalNodes { get; set; }
 | 
					        public int TotalNodes { get; set; }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -100,7 +100,7 @@ public class Misc
 | 
				
			|||||||
        var now = SystemClock.Instance.GetCurrentInstant().ToUnixTimeSeconds();
 | 
					        var now = SystemClock.Instance.GetCurrentInstant().ToUnixTimeSeconds();
 | 
				
			||||||
        var shardUptime = Duration.FromSeconds(now - shardInfo?.LastConnection ?? 0);
 | 
					        var shardUptime = Duration.FromSeconds(now - shardInfo?.LastConnection ?? 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        var shardTotal = shards.Count();
 | 
					        var shardTotal = _botConfig.Cluster?.TotalShards ?? shards.Count();
 | 
				
			||||||
        int shardClusterTotal = ctx.Cluster.Shards.Count;
 | 
					        int shardClusterTotal = ctx.Cluster.Shards.Count;
 | 
				
			||||||
        var shardUpTotal = shards.Where(x => x.Up).Count();
 | 
					        var shardUpTotal = shards.Where(x => x.Up).Count();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user