public async Task <List <UnverifyAuditItem> > GetAuditLogAsync(UnverifyAuditFilterRequest filter) { var data = Repository.GetOperationsLog(filter.GuildID, filter.FromUserID, filter.DestUserID, filter.Operation, filter.DateTimeFrom, filter.DateTimeTo, 200); var result = new List <UnverifyAuditItem>(); foreach (var item in data) { var auditItem = new UnverifyAuditItem(item, DiscordClient); if (CanIgnoreSelfUnverifyItem(auditItem, filter.IgnoreSelfUnverify)) { continue; } auditItem.FromUser = await auditItem.Guild.GetUserFromGuildAsync(item.FromUserIDSnowflake); auditItem.ToUser = await auditItem.Guild.GetUserFromGuildAsync(item.DestUserIDSnowflake); result.Add(auditItem); } return(result); }
public bool CanIgnoreSelfUnverifyItem(UnverifyAuditItem item, bool ignoreSelfUnverify) { return(ignoreSelfUnverify && item.IsSelfUnverify()); }