示例#1
0
        public async Task <Stream> GetAnime(string[] query)
        {
            var safe   = new BooruSharp.Booru.Safebooru();
            var result = await safe.GetRandomPostAsync(query);

            using var client = new HttpClient();
            {
                var resp = await client.GetAsync(result.FileUrl.AbsoluteUri);

                return(await resp.Content.ReadAsStreamAsync());
            }
        }
示例#2
0
        public async Task <BooruSharp.Search.Post.SearchResult> Safebooru(IUser usr, IGuild guild, ICommandContext context, string tag = "thighhighs")
        {
            var Booru = new BooruSharp.Booru.Safebooru();

            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);
        }
示例#3
0
        public SearchResult getRandomSafebooru(string[] tags)
        {
            var booru = new BooruSharp.Booru.Safebooru();

            return(booru.GetRandomPostAsync(tags).Result);
        }