diff --git a/src/AzzyBot.Core/Utilities/SoftwareStats.cs b/src/AzzyBot.Core/Utilities/SoftwareStats.cs index 21dac5fe..e00364ea 100644 --- a/src/AzzyBot.Core/Utilities/SoftwareStats.cs +++ b/src/AzzyBot.Core/Utilities/SoftwareStats.cs @@ -7,8 +7,10 @@ namespace AzzyBot.Core.Utilities; public static class SoftwareStats { + private static readonly string AppFilePath = $"{Path.Combine(AppContext.BaseDirectory, AppDomain.CurrentDomain.FriendlyName)}.dll"; + public static string GetAppAuthors - => FileVersionInfo.GetVersionInfo(GetAppFilePath).CompanyName ?? "Bot authors not found"; + => FileVersionInfo.GetVersionInfo(AppFilePath).CompanyName ?? "Bot authors not found"; public static string GetAppDotNetVersion => Environment.Version.ToString() ?? ".NET version not found"; @@ -17,10 +19,10 @@ public static string GetAppEnvironment => (GetAppName.EndsWith("Dev", StringComparison.OrdinalIgnoreCase)) ? Environments.Development : Environments.Production; public static string GetAppName - => FileVersionInfo.GetVersionInfo(GetAppFilePath).ProductName?.Split('.')[0] ?? "Bot name not found"; + => FileVersionInfo.GetVersionInfo(AppFilePath).ProductName?.Split('.')[0] ?? "Bot name not found"; public static string GetAppVersion - => FileVersionInfo.GetVersionInfo(GetAppFilePath).ProductVersion ?? "Bot version not found"; + => FileVersionInfo.GetVersionInfo(AppFilePath).ProductVersion ?? "Bot version not found"; public static double GetAppMemoryUsage() { @@ -35,7 +37,4 @@ public static DateTimeOffset GetAppUptime() return app.StartTime; } - - private static string GetAppFilePath - => $"{Path.Combine(AppContext.BaseDirectory, AppDomain.CurrentDomain.FriendlyName)}.dll"; }