示例#1
0
        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);
        }
示例#2
0
 public bool CanIgnoreSelfUnverifyItem(UnverifyAuditItem item, bool ignoreSelfUnverify)
 {
     return(ignoreSelfUnverify && item.IsSelfUnverify());
 }