From 2d548b55de2c0eb8b188f8863c7eaefa5ddda07f Mon Sep 17 00:00:00 2001 From: Ene <4186225-Kieteyuku@users.noreply.gitlab.com> Date: Wed, 16 Aug 2023 07:00:57 +0000 Subject: [PATCH] Gifts character limiting fix for V5 --- .../Gambling/Waifus/WaifuClaimCommands.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuClaimCommands.cs b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuClaimCommands.cs index 9d014d086..5710480b2 100644 --- a/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuClaimCommands.cs +++ b/src/Nadeko.Bot.Modules.Gambling/Gambling/Waifus/WaifuClaimCommands.cs @@ -269,8 +269,9 @@ public partial class Gambling ? "-" : string.Join("\n", itemList.Where(x => waifuItems.TryGetValue(x.ItemEmoji, out _)) - .OrderBy(x => waifuItems[x.ItemEmoji].Price) + .OrderByDescending(x => waifuItems[x.ItemEmoji].Price) .GroupBy(x => x.ItemEmoji) + .Take(60) .Select(x => $"{x.Key} x{x.Count(),-3}") .Chunk(2) .Select(x => string.Join(" ", x))); @@ -283,8 +284,10 @@ public partial class Gambling var fansList = await _service.GetFansNames(wi.WaifuId); var fansStr = fansList - .Select((x) => claimsNames.Contains(x) ? $"{x} 💞" : x) - .Join('\n'); + .Shuffle() + .Take(30) + .Select((x) => claimsNames.Contains(x) ? $"{x} 💞" : x) + .Join('\n'); if (string.IsNullOrWhiteSpace(fansStr)) @@ -370,4 +373,4 @@ public partial class Gambling await ReplyErrorLocalizedAsync(strs.not_enough(CurrencySign)); } } -} \ No newline at end of file +}