From da0eff4339c05562a0e5ba1576b9fb3f5d3c7846 Mon Sep 17 00:00:00 2001
From: Toastie <toastie@toastiet0ast.com>
Date: Sat, 1 Mar 2025 12:45:14 +1300
Subject: [PATCH] Bot version retrieved via --version will now match the
 version in .stats

---
 src/EllieBot/Program.cs                            | 7 +------
 src/EllieBot/_common/Services/Impl/StatsService.cs | 2 +-
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/EllieBot/Program.cs b/src/EllieBot/Program.cs
index bb49ad9..a3ee8f1 100644
--- a/src/EllieBot/Program.cs
+++ b/src/EllieBot/Program.cs
@@ -1,13 +1,8 @@
 using System.Reflection;
 
-static string GetAppVersion()
-{
-    return Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "unknown";
-}
-
 if (args.Length > 0 && args[0] == "--version")
 {
-    Console.WriteLine(GetAppVersion());
+    Console.WriteLine(StatsService.BotVersion);
     return;
 }
 
diff --git a/src/EllieBot/_common/Services/Impl/StatsService.cs b/src/EllieBot/_common/Services/Impl/StatsService.cs
index 62d4a07..b7e6c5c 100644
--- a/src/EllieBot/_common/Services/Impl/StatsService.cs
+++ b/src/EllieBot/_common/Services/Impl/StatsService.cs
@@ -7,7 +7,7 @@ namespace EllieBot.Services;
 public sealed class StatsService : IStatsService, IReadyExecutor, IEService
 {
     public static string BotVersion
-        => typeof(Bot).Assembly.GetName().Version?.ToString(3) ?? "Custom";
+        => typeof(Bot).Assembly.GetName().Version?.ToString(3) ?? "custom";
 
     public string Author
         => "toastie_t0ast";