Пример #1
0
        private async Task SendRecentRecords(IMessageChannel channel)
        {
            var recentRecords = await _simplyDataAccess.GetRecentRecords(10);

            var recentRecordsString = recentRecords.Aggregate("",
                                                              (currentString, nextHighscore) => currentString +
                                                              $"{ClassConstants.ToString(nextHighscore.Class)} **#{nextHighscore.Position + 1}** on **{nextHighscore.Map}** in **__{nextHighscore.GetTimeSpan:c}__** run by **{nextHighscore.Name}**" +
                                                              Environment.NewLine);

            var builder = new EmbedBuilder {
                Title = "**Recent Map Records**"
            };

            builder.WithDescription(recentRecordsString)
            .WithFooter("Updated " + DateTime.Now.ToShortTimeString());
            await channel.SendMessageAsync("", embed : builder);
        }
Пример #2
0
        private async Task SendRecentPersonalBests(IMessageChannel channel)
        {
            // TODO: Rename these
            var recentPersonalBest = await _simplyDataAccess.GetRecentPersonalBests(15);

            var recentRecordsString = recentPersonalBest.Aggregate("",
                                                                   (currentString, nextHighscore) => currentString +
                                                                   $"**{nextHighscore.Name}** got a **{ClassConstants.ToString(nextHighscore.Class)}** personal best of **{nextHighscore.GetTimeSpan:c}** on **{nextHighscore.Map}**" +
                                                                   Environment.NewLine);

            var builder = new EmbedBuilder {
                Title = "**Recent Personal Bests**"
            };

            builder.WithDescription(recentRecordsString)
            .WithFooter("Updated " + DateTime.Now.ToShortTimeString());
            await channel.SendMessageAsync("", embed : builder);
        }