private EmbedBuilder BuildGoogleImages(GResults results, string query) { var list = results.Items.Take(10).ToList(); var eb = new EmbedBuilder() .WithColor(Program.embedColor) .WithTitle($"Google image search - \"{query}\"") .WithUrl("https://www.google.com/search?q=" + System.Net.WebUtility.UrlEncode(query)) .WithImageUrl(list[new Random().Next(0, list.Count)].Link) .WithFooter(new EmbedFooterBuilder() .WithText($"Search time: {results.SearchInformation.SearchTime.ToString()}s")); return(eb); }
private EmbedBuilder BuildGoogle(GResults results, string query) { var eb = new EmbedBuilder() .WithColor(Program.embedColor) .WithTitle($"Google search - \"{query}\"") .WithUrl("https://www.google.com/search?q=" + System.Net.WebUtility.UrlEncode(query)) .WithDescription("") .WithFooter(new EmbedFooterBuilder() .WithText($"Search time: {results.SearchInformation.SearchTime.ToString()}s")); foreach (var item in results.Items.Take(5)) { eb.Description += $"[{item.Title}]({item.Link})\n{item.Snippet}\n\n"; } return(eb); }