示例#1
0
 public async Task <ServiceResult <IDictionary <InfractionType, int> > > GetInfractionCountsForUserAsync(ulong subjectId)
 => await AuthorizationService.CheckClaims(AuthorizationClaim.ModerationRead)
 .ShortCircuitAsync(InfractionRepository.GetInfractionCountsAsync(new InfractionSearchCriteria
 {
     GuildId   = AuthorizationService.CurrentGuildId,
     SubjectId = subjectId,
     IsDeleted = false
 }));
示例#2
0
        public async Task <IDictionary <InfractionType, int> > GetInfractionCountsForUserAsync(ulong subjectId)
        {
            AuthorizationService.RequireClaims(AuthorizationClaim.ModerationRead);

            return(await InfractionRepository.GetInfractionCountsAsync(new InfractionSearchCriteria
            {
                GuildId = AuthorizationService.CurrentGuildId,
                SubjectId = subjectId,
                IsDeleted = false
            }));
        }