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

Merge branch 'v4' into 'v4'

Fixes for MRs 298 / 303 and 305

See merge request Kwoth/nadekobot!307
This commit is contained in:
Kwoth 2023-09-04 04:08:08 +00:00
commit 201aa45c6b
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)
|| 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();
}
}
}

View file

@ -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));
}
}
}
}