static async Task MainAsync() { try { PixeeSharpAppApi api = new PixeeSharpAppApi(); await api.Login("user_wmxv8884", "Rkd4BeQD4Ynr76u"); var a = await api.GetTrendingTags(); //await a.SearchAll(); //await a.SearchAll(); //await api.GetUserFollowing("10632654"); //await a.Illustrations[0].GetImage(); } catch (Exception ex) { } }
public async Task SearchPixivAsync(string search) { try { PixeeSharpAppApi client = new PixeeSharpAppApi(); await client.Login("*****@*****.**", "Jerwyk0526"); Random rnd = new Random(); var illusts = await client.SearchIllustration(search, offset : rnd.Next(300)); var illust = illusts.Result[rnd.Next(illusts.Result.Count)]; Stream imgStream = await illust.GetImage(PixeeSharp.Enums.ImageSize.Large); await Context.Channel.SendFileAsync(imgStream, "image.jpeg", embed : illust.CreateEmbed()); } catch (Exception ex) { } }