From 97ae7b5a5b22519929a9b9eda46658bf79cf9103 Mon Sep 17 00:00:00 2001 From: Ene <4186225-Kieteyuku@users.noreply.gitlab.com> Date: Mon, 4 Sep 2023 04:08:07 +0000 Subject: [PATCH] fix to gift being character limited (!302), and fixes UserUpdated and UserPresence not correctly ignoring users that are logignored. --- .../ServerLog/ServerLogCommandService.cs | 7 ++++--- .../Modules/Gambling/Waifus/WaifuClaimCommands.cs | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs b/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs index eb56ce2bb..03e21ccf3 100644 --- a/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs +++ b/src/NadekoBot/Modules/Administration/ServerLog/ServerLogCommandService.cs @@ -98,7 +98,8 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor if (!GuildLogSettings.TryGetValue(gu.Guild.Id, out var logSetting) || before is null - || after is null) + || after is null + || logSetting.LogIgnores.Any(ilc => ilc.LogItemId == gu.Id && ilc.ItemType == IgnoredItemType.User)) return; ITextChannel? logChannel; @@ -350,7 +351,7 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor var g = after.Guild; - if (!GuildLogSettings.TryGetValue(g.Id, out var logSetting) || logSetting.UserUpdatedId is null) + if (!GuildLogSettings.TryGetValue(g.Id, out var logSetting) || logSetting.UserUpdatedId is null || logSetting.LogIgnores.Any(ilc => ilc.LogItemId == after.Id && ilc.ItemType == IgnoredItemType.User)) return; ITextChannel? logChannel; @@ -1356,4 +1357,4 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor GuildLogSettings.AddOrUpdate(guildId, newLogSetting, (_, _) => newLogSetting); uow.SaveChanges(); } -} \ No newline at end of file +} diff --git a/src/NadekoBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs b/src/NadekoBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs index 84d8499e9..d3115eef6 100644 --- a/src/NadekoBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs +++ b/src/NadekoBot/Modules/Gambling/Waifus/WaifuClaimCommands.cs @@ -250,8 +250,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))); @@ -264,7 +265,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)) @@ -350,4 +354,4 @@ public partial class Gambling await ReplyErrorLocalizedAsync(strs.not_enough(CurrencySign)); } } -} \ No newline at end of file +}