From 31023bc960a73d12f1e579972dd8ec76791f0d91 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Fri, 9 Jan 2026 18:52:17 -0600 Subject: [PATCH] Use Humanizer for enum --- .../Commands/Kasino/LegitCheckCommand.cs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/KfChatDotNetBot/Commands/Kasino/LegitCheckCommand.cs b/KfChatDotNetBot/Commands/Kasino/LegitCheckCommand.cs index 390b90e..8d69d13 100644 --- a/KfChatDotNetBot/Commands/Kasino/LegitCheckCommand.cs +++ b/KfChatDotNetBot/Commands/Kasino/LegitCheckCommand.cs @@ -1,6 +1,7 @@ using System.ComponentModel; using System.Reflection; using System.Text.RegularExpressions; +using Humanizer; using KfChatDotNetBot.Extensions; using KfChatDotNetBot.Models; using KfChatDotNetBot.Models.DbModels; @@ -121,7 +122,7 @@ public class LegitCheckCommand : ICommand if (luckiestGame != null) { - var gameName = GetGameDisplayName(luckiestGame.Game); + var gameName = luckiestGame.Game.Humanize(); response += $" | Luckiest: {gameName} ({luckiestGame.Rtp:F2}% RTP, {luckiestGame.WagerCount:N0} wagers, {await luckiestGame.TotalWagered.FormatKasinoCurrencyAsync()} wagered)"; } @@ -129,18 +130,6 @@ public class LegitCheckCommand : ICommand await botInstance.SendChatMessageAsync(response, true); } - /// - /// Gets the display name for a WagerGame enum value. - /// Uses the [Description] attribute if present (e.g., LambChop -> "Lambchop"), - /// otherwise falls back to the enum name itself. - /// - private static string GetGameDisplayName(WagerGame game) - { - var memberInfo = typeof(WagerGame).GetMember(game.ToString()).FirstOrDefault(); - var descriptionAttribute = memberInfo?.GetCustomAttribute(); - return descriptionAttribute?.Description ?? game.ToString(); - } - /// /// Helper class to hold per-game statistics during calculation. ///