예제 #1
0
        public async Task <Embed> GetRecentRecordEmbedAsync()
        {
            try
            {
                var recentRecords = await _justJumpDataAccess.GetRecentRecordsAsync(10);

                var recentRecordsString = recentRecords.Aggregate("",
                                                                  (currentString, nextHighscore) => currentString +
                                                                  $"{SimplyHelper.ClassToShortString(nextHighscore.Class)} | **__{TempusHelper.TimeSpanToFormattedTime(SimplyHelper.GetTimeSpan(nextHighscore.RunTime))}__** | **{nextHighscore.Map}** | **{nextHighscore.Name}**" +
                                                                  Environment.NewLine);

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

                builder.WithDescription(recentRecordsString)
                .WithColor(ColorConstants.InfoColor)
                .WithFooter("Updated " + DateTime.Now.ToShortTimeString());
                return(builder.Build());
            }
            catch (Exception e)
            {
                return(Logger.LogException(e));
            }
        }
예제 #2
0
 public override string ToString() =>
 $"{SimplyHelper.ClassToShortString(Class)} | {Name} | {TempusHelper.TimeSpanToFormattedTime(SimplyHelper.GetTimeSpan(RunTime))}";