Ejemplo n.º 1
0
        public async Task Recent(int count, [Remainder] string username)
        {
            if (string.IsNullOrEmpty(username))
            {
                await ReplyAsync("Username is null/empty, command usage is \"a.recent <count=1> [username]\"");

                return;
            }
            var user = await _api.GetUserByNameAsync(username);

            if (user == null)
            {
                return;
            }
            var recentScores = await _api.GetUserRecentAndBeatmapByUsernameAsync(username, limit : 1);

            if (recentScores.Count < 1)
            {
                return;
            }
            if (count == 1)
            {
                await ReplyAsync($"**Most recent play for {user.Username}:**", embed : CreateSinglePlayEmbed(user, recentScores[0].UserRecent, recentScores[0].Beatmap));
            }
            else
            {
                await ReplyAsync($"**Most recent plays for {user.Username}:**", embed : CreateMultiplePlayEmbed(user, recentScores));
            }
        }