public async Task <RandomData> GetTypesAsync(string type, IEnumerable <string> tags, FileType fileType, NsfwSearch nsfw, bool hidden) { await weebClient.Authenticate(Config.bot.wolkeToken, TokenType.Wolke); var result = await weebClient.GetRandomAsync(type, tags, fileType, hidden, nsfw); //hidden and nsfw are always defaulted to false if (result == null) { return(null); } return(result); }
internal async Task <DiscordEmbed> GetWeeb(string tipo, string msg) { WeebClient weeb = new WeebClient(); await weeb.Authenticate(DependencesSingleton.GetApiWeeb().Key, TokenType.Wolke); RandomData imgReceived = await weeb.GetRandomAsync(tipo, new string[] { }, FileType.Any, false, NsfwSearch.False); DiscordEmbedBuilder eb = new DiscordEmbedBuilder { Color = DiscordColor.HotPink, ImageUrl = imgReceived.Url }; if (Auto) { eb.WithTitle($"{Author.Username} {((UsuarioDestino == null) ? SelfMsg : msg + " " + UsuarioDestino.Username)}."); } else { eb.WithTitle(msg); } return(eb.Build()); }
public async Task <RandomData> GetRandImage(string type, string[] tags, FileType fileType, NsfwSearch nsfw) { return(await _weebClient.GetRandomAsync(type, tags, fileType, false, nsfw)); }