From 32dff133a9996ce70b4a47562e35e0536a1ab9c2 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Fri, 29 Jul 2016 14:18:30 +0200 Subject: [PATCH] Print no results properly, removed leftover rule34 --- NadekoBot/Modules/NSFW/NSFWModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/NadekoBot/Modules/NSFW/NSFWModule.cs b/NadekoBot/Modules/NSFW/NSFWModule.cs index daf2d99c..ac688fb7 100644 --- a/NadekoBot/Modules/NSFW/NSFWModule.cs +++ b/NadekoBot/Modules/NSFW/NSFWModule.cs @@ -4,6 +4,7 @@ using NadekoBot.Classes; using NadekoBot.Modules.Permissions.Classes; using Newtonsoft.Json.Linq; using System; +using System.Linq; using System.Threading.Tasks; namespace NadekoBot.Modules.NSFW @@ -29,9 +30,9 @@ namespace NadekoBot.Modules.NSFW { var tag = e.GetArg("tag")?.Trim() ?? ""; - var links = await Task.WhenAll(SearchHelper.GetGelbooruImageLink("rating%3Aexplicit+" + tag), SearchHelper.GetDanbooruImageLink("rating%3Aexplicit+" + tag), SearchHelper.GetRule34ImageLink(tag)).ConfigureAwait(false); + var links = await Task.WhenAll(SearchHelper.GetGelbooruImageLink("rating%3Aexplicit+" + tag), SearchHelper.GetDanbooruImageLink("rating%3Aexplicit+" + tag)).ConfigureAwait(false); - if (links.Length == 0) + if (links.All(l => l == null)) { await e.Channel.SendMessage("`No results.`"); return;