Ejemplo n.º 1
0
Archivo: Web.cs Proyecto: ta1H3n/Namiko
        public async Task Iqdb(string url = null, [Remainder] string str = "")
        {
            await Context.Channel.TriggerTypingAsync();

            url ??= Context.Message.Attachments.FirstOrDefault()?.Url;

            if (url == null)
            {
                await Context.Channel.SendMessageAsync("Can't get your attachment, there probably isn't one. *Heh, dummy...*");

                return;
            }

            var result = await WebUtil.IqdbUrlSearchAsync(url);

            if (!result.IsFound)
            {
                await Context.Channel.SendMessageAsync("No results. Too bad.");

                return;
            }

            await Context.Channel.SendMessageAsync("", false, WebUtil.IqdbSourceResultEmbed(result, url).Build());
        }