Example #1
0
        public async Task InternalDapiCommand(string tag, Searches.Searches.DapiSearchType type)
        {
            tag = tag?.Trim() ?? "";

            var url = await Searches.Searches.InternalDapiSearch(tag, type).ConfigureAwait(false);

            if (url == null)
            {
                await ReplyErrorLocalized("not_found").ConfigureAwait(false);
            }
            else
            {
                await Context.Channel.EmbedAsync(new EmbedBuilder().WithOkColor()
                                                 .WithDescription(Context.User + " " + tag)
                                                 .WithImageUrl(url)
                                                 .WithFooter(efb => efb.WithText(type.ToString()))).ConfigureAwait(false);
            }
        }
Example #2
0
        public async Task InternalDapiCommand(IUserMessage umsg, string tag, Searches.Searches.DapiSearchType type)
        {
            var channel = umsg.Channel;

            tag = tag?.Trim() ?? "";

            var url = await Searches.Searches.InternalDapiSearch(tag, type).ConfigureAwait(false);

            if (url == null)
            {
                await channel.SendErrorAsync(umsg.Author.Mention + " " + GetText("no_results"));
            }
            else
            {
                await channel.EmbedAsync(new EmbedBuilder().WithOkColor()
                                         .WithDescription(umsg.Author.Mention + " " + tag)
                                         .WithImageUrl(url)
                                         .WithFooter(efb => efb.WithText(type.ToString()))).ConfigureAwait(false);
            }
        }