Print no results properly, removed leftover rule34

This commit is contained in:
Kwoth 2016-07-29 14:18:30 +02:00
parent 6002ee2ed2
commit 32dff133a9

View File

@ -4,6 +4,7 @@ using NadekoBot.Classes;
using NadekoBot.Modules.Permissions.Classes; using NadekoBot.Modules.Permissions.Classes;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace NadekoBot.Modules.NSFW namespace NadekoBot.Modules.NSFW
@ -29,9 +30,9 @@ namespace NadekoBot.Modules.NSFW
{ {
var tag = e.GetArg("tag")?.Trim() ?? ""; 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.`"); await e.Channel.SendMessage("`No results.`");
return; return;