~hentai speed improved by 0.3-0.5 seconds :D
This commit is contained in:
parent
93a75ba92a
commit
6002ee2ed2
@ -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.Threading.Tasks;
|
||||||
|
|
||||||
namespace NadekoBot.Modules.NSFW
|
namespace NadekoBot.Modules.NSFW
|
||||||
{
|
{
|
||||||
@ -27,16 +28,16 @@ namespace NadekoBot.Modules.NSFW
|
|||||||
.Do(async e =>
|
.Do(async e =>
|
||||||
{
|
{
|
||||||
var tag = e.GetArg("tag")?.Trim() ?? "";
|
var tag = e.GetArg("tag")?.Trim() ?? "";
|
||||||
var gel = await SearchHelper.GetGelbooruImageLink("rating%3Aexplicit+" + tag).ConfigureAwait(false);
|
|
||||||
if (gel != null)
|
var links = await Task.WhenAll(SearchHelper.GetGelbooruImageLink("rating%3Aexplicit+" + tag), SearchHelper.GetDanbooruImageLink("rating%3Aexplicit+" + tag), SearchHelper.GetRule34ImageLink(tag)).ConfigureAwait(false);
|
||||||
await e.Channel.SendMessage(":heart: Gelbooru: " + gel)
|
|
||||||
.ConfigureAwait(false);
|
if (links.Length == 0)
|
||||||
var dan = await SearchHelper.GetDanbooruImageLink("rating%3Aexplicit+" + tag).ConfigureAwait(false);
|
{
|
||||||
if (dan != null)
|
|
||||||
await e.Channel.SendMessage(":heart: Danbooru: " + dan)
|
|
||||||
.ConfigureAwait(false);
|
|
||||||
if (dan == null && gel == null)
|
|
||||||
await e.Channel.SendMessage("`No results.`");
|
await e.Channel.SendMessage("`No results.`");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await e.Channel.SendMessage(String.Join("\n\n", links)).ConfigureAwait(false);
|
||||||
});
|
});
|
||||||
cgb.CreateCommand(Prefix + "danbooru")
|
cgb.CreateCommand(Prefix + "danbooru")
|
||||||
.Description($"Shows a random hentai image from danbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +) | `{Prefix}danbooru yuri+kissing`")
|
.Description($"Shows a random hentai image from danbooru with a given tag. Tag is optional but preffered. (multiple tags are appended with +) | `{Prefix}danbooru yuri+kissing`")
|
||||||
|
Loading…
Reference in New Issue
Block a user