public async Task TestBooruTypo() { BooruSharp.Booru.Gelbooru booru = new BooruSharp.Booru.Gelbooru(); Random rand = new Random(); var resultSearch = await Booru.SearchBooru(false, new string[] { "tsutsukakushi_tsuki" }, booru, rand); Assert.Equal(Error.Booru.None, resultSearch.error); var resultTags = await Booru.SearchTags(new string[] { resultSearch.answer.saveId.ToString() }); Assert.Equal(Error.BooruTags.None, resultTags.error); Assert.Contains("tsutsukakushi_tsukiko", resultTags.answer.characTags); }
public async Task TestBooruTag() { BooruSharp.Booru.Gelbooru booru = new BooruSharp.Booru.Gelbooru(); Random rand = new Random(); var resultSearch = await Booru.SearchBooru(false, new string[] { "hibiki_(kantai_collection)" }, booru, rand); var resultTags = await Booru.SearchTags(new string[] { resultSearch.answer.saveId.ToString() }); Assert.Equal(Error.BooruTags.None, resultTags.error); Assert.Contains("hibiki_(kantai_collection)", resultTags.answer.characTags); Assert.Contains("kantai_collection", resultTags.answer.sourceTags); Assert.Equal("Gelbooru", resultTags.answer.booruName); }
public async Task <BooruSharp.Search.Post.SearchResult> GelBooru(IUser usr, IGuild guild, ICommandContext context, string tag = "thighhighs") { BooruSharp.Booru.Gelbooru Booru = new BooruSharp.Booru.Gelbooru(); BooruSharp.Search.Post.SearchResult result = new BooruSharp.Search.Post.SearchResult(); try { result = await Booru.GetRandomPostAsync(tag.Split(',')); return(result); } catch (Exception e) { Console.WriteLine(e); await SearchTag(context, tag); } return(result); }
public SearchResult getRandomGelbooru(string[] tags) { var booru = new BooruSharp.Booru.Gelbooru(); return(booru.GetRandomPostAsync(tags).Result); }