more stats

This commit is contained in:
13xforever 2019-03-06 15:18:12 +05:00
parent e128633471
commit 8895d9679d
2 changed files with 23 additions and 1 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Threading.Tasks;
using CompatApiClient.Utils;
@ -30,7 +31,10 @@ namespace CompatBot.Commands
.AddField("Discord latency", $"{ctx.Client.Ping} ms", true)
.AddField("GitHub rate limit", $"{GithubClient.Client.RateLimitRemaining} out of {GithubClient.Client.RateLimit} calls available\nReset in {(GithubClient.Client.RateLimitResetTime - DateTime.UtcNow).AsShortTimespan()}", true)
.AddField("Google Drive API", File.Exists(Config.GoogleApiConfigPath) ? "✅ Configured" : "❌ Not configured")
.AddField(".NET versions", $"Runtime {System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion()}\n{System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}", true);
.AddField(".NET versions", $"Runtime {System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion()}\n" +
$"{System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription}\n" +
$"SIMD Acceleration:{(Vector.IsHardwareAccelerated ? " Supported" : " Not supported")}\n" +
$"Confinement: {SandboxDetector.Detect() ?? "None"}", true);
AppendPiracyStats(embed);
AppendCmdStats(ctx, embed);
AppendExplainStats(embed);

View File

@ -0,0 +1,18 @@
using System;
namespace CompatBot.Utils
{
public static class SandboxDetector
{
public static string Detect()
{
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("SNAP")))
return "Snap";
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("FLATPAK_SYSTEM_DIR")))
return "Flatpak";
return null;
}
}
}