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()); }
protected override async Task VerifyResponseToSendMessage() { if (MangaSearch == null || MangaSearch.Results.Count == 0) { await ReplyAsync("I didn't find any mangas. That's weird. :thinking:"); return; } PopulateEmbedMessageFieldsWithHighestScoreMangas(); await ReplyAsync("", false, EmbedMessage.Build()); }
public async Task GetBurinbotServers() { try { foreach (var server in Context.Client.CurrentUser.MutualGuilds) { Description.AppendLine($"{server.Name}"); } CreateDiscordEmbedMessage( $"Burinbot is currently in {Context.Client.CurrentUser.MutualGuilds.Count} servers!", Color.Green, Description.ToString()); await ReplyAsync("", false, EmbedMessage.Build()); } catch (Exception ex) { await SendExceptionMessageInDiscordChat(ex); } }
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()); }
protected override async Task VerifyResponseToSendMessage() => await ReplyAsync("", false, EmbedMessage.Build());