1
Fork 0
mirror of https://gitlab.com/Kwoth/nadekobot.git synced 2024-10-03 04:23:13 +00:00

fix to gift being character limited (!302), and fixes UserUpdated and UserPresence not correctly ignoring users that are logignored.

This commit is contained in:
Ene 2023-09-04 04:08:07 +00:00 committed by Kwoth
parent 9b09f223d9
commit 97ae7b5a5b
No known key found for this signature in database
2 changed files with 11 additions and 6 deletions

View file

@ -98,7 +98,8 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor
if (!GuildLogSettings.TryGetValue(gu.Guild.Id, out var logSetting) if (!GuildLogSettings.TryGetValue(gu.Guild.Id, out var logSetting)
|| before is null || before is null
|| after is null) || after is null
|| logSetting.LogIgnores.Any(ilc => ilc.LogItemId == gu.Id && ilc.ItemType == IgnoredItemType.User))
return; return;
ITextChannel? logChannel; ITextChannel? logChannel;
@ -350,7 +351,7 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor
var g = after.Guild; 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; return;
ITextChannel? logChannel; ITextChannel? logChannel;
@ -1356,4 +1357,4 @@ public sealed class LogCommandService : ILogCommandService, IReadyExecutor
GuildLogSettings.AddOrUpdate(guildId, newLogSetting, (_, _) => newLogSetting); GuildLogSettings.AddOrUpdate(guildId, newLogSetting, (_, _) => newLogSetting);
uow.SaveChanges(); uow.SaveChanges();
} }
} }

View file

@ -250,8 +250,9 @@ public partial class Gambling
? "-" ? "-"
: string.Join("\n", : string.Join("\n",
itemList.Where(x => waifuItems.TryGetValue(x.ItemEmoji, out _)) itemList.Where(x => waifuItems.TryGetValue(x.ItemEmoji, out _))
.OrderBy(x => waifuItems[x.ItemEmoji].Price) .OrderByDescending(x => waifuItems[x.ItemEmoji].Price)
.GroupBy(x => x.ItemEmoji) .GroupBy(x => x.ItemEmoji)
.Take(60)
.Select(x => $"{x.Key} x{x.Count(),-3}") .Select(x => $"{x.Key} x{x.Count(),-3}")
.Chunk(2) .Chunk(2)
.Select(x => string.Join(" ", x))); .Select(x => string.Join(" ", x)));
@ -264,7 +265,10 @@ public partial class Gambling
var fansList = await _service.GetFansNames(wi.WaifuId); var fansList = await _service.GetFansNames(wi.WaifuId);
var fansStr = fansList 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)) if (string.IsNullOrWhiteSpace(fansStr))
@ -350,4 +354,4 @@ public partial class Gambling
await ReplyErrorLocalizedAsync(strs.not_enough(CurrencySign)); await ReplyErrorLocalizedAsync(strs.not_enough(CurrencySign));
} }
} }
} }