protected override async Task VerifyResponseToSendMessage() { int counterForNumberOfItemsInAList = 0; if (RecommendationList == null || RecommendationList.Recommendations.Count == 0) { await ReplyAsync("The anime was found but there are no recommendations like it."); return; } while (EmbedMessage.Fields.Count < LIMIT_OF_FIELDS_PER_EMBED_MESSAGE && EmbedMessage.Fields.Count < RecommendationList.Recommendations.Count) { EmbedMessage.AddField(x => { x.Name = RecommendationList.Recommendations[counterForNumberOfItemsInAList].Title; x.Value = RecommendationList.Recommendations[counterForNumberOfItemsInAList].URL; x.IsInline = false; }); ++counterForNumberOfItemsInAList; } await ReplyAsync("", false, EmbedMessage.Build()); }
private void PopulateEmbedMessageFieldsWithHighestScoreMangas() { int counterForCurrentFieldInTheEmbedMessage = 0; while (EmbedMessage.Fields.Count < LIMIT_OF_FIELDS_PER_EMBED_MESSAGE) { EmbedMessage.AddField(x => { x.Name = $"{MangaSearch.Results[counterForCurrentFieldInTheEmbedMessage].Title ?? MangaSearch.Results[counterForCurrentFieldInTheEmbedMessage].Name}"; x.Value = $"Link: {MangaSearch.Results[counterForCurrentFieldInTheEmbedMessage].URL}\nScore: {MangaSearch.Results[counterForCurrentFieldInTheEmbedMessage].Score}"; x.IsInline = false; }); ++counterForCurrentFieldInTheEmbedMessage; } }
public Task BuildEmbedMessageWithAnimeScheduledForSaturday() { Parallel.ForEach(Animes.Saturday, anime => { if (EmbedMessage.Fields.Count < LIMIT_OF_FIELDS_PER_EMBED_MESSAGE) { EmbedMessage.AddField(x => { x.Name = $"{anime.Title ?? anime.Name}"; x.Value = $"More Info: {anime.URL}\nEpisodes: {anime.Episodes}\nScore: {anime.Score}"; x.IsInline = false; }); } }); return(Task.CompletedTask); }
protected override async Task VerifyResponseToSendMessage() { int countNumberOfAddedAnimes = 0; if (TopAnimes == null || TopAnimes.Top.Count == 0) { throw new ArgumentNullException("Nothing was found inside the TopAnimes list."); } while (EmbedMessage.Fields.Count < LIMIT_OF_FIELDS_PER_EMBED_MESSAGE) { EmbedMessage.AddField(x => { x.Name = TopAnimes.Top[countNumberOfAddedAnimes].Title ?? TopAnimes.Top[countNumberOfAddedAnimes].Name; x.Value = $"Rank: {TopAnimes.Top[countNumberOfAddedAnimes].Rank}"; x.IsInline = false; }); ++countNumberOfAddedAnimes; } await ReplyAsync("", false, EmbedMessage.Build()); }