mirror of
https://gitlab.com/Kwoth/nadekobot.git
synced 2024-10-02 20:13: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:
parent
9b09f223d9
commit
97ae7b5a5b
2 changed files with 11 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue