Пример #1
0
        public async Task <IActionResult> Get()
        {
            var roleCounts = await _statService.GetGuildMemberDistributionAsync(UserGuild);

            var messageCounts = await _statService.GetTopMessageCounts(UserGuild, ModixUser.UserId);

            return(Ok(new GuildStatApiData
            {
                GuildName = UserGuild.Name,
                GuildRoleCounts = roleCounts,
                TopUserMessageCounts = messageCounts,
            }));
        }
Пример #2
0
        public async Task <IActionResult> Get()
        {
            var roleCounts = await _statService.GetGuildMemberDistributionAsync(UserGuild);

            var messageCounts = await _statService.GetTopMessageCounts(UserGuild);

            return(Ok(new GuildStatApiData
            {
                GuildName = UserGuild.Name,
                GuildRoleCounts = roleCounts,
                TopUserMessageCounts = messageCounts.ToDictionary
                                       (
                    d => $"{d.Key.User.Username}#{d.Key.User.Discriminator}",
                    d => d.Value
                                       )
            }));
        }