Exemplo n.º 1
0
        public async Task GetCat(CommandContext ctx)
        {
            await ctx.TriggerTypingAsync();

            var results = MiscService.GetCatFactAsync().Result;
            var output  = new DiscordEmbedBuilder()
                          .WithFooter($"Fact: {JObject.Parse(results)["fact"]}")
                          .WithColor(DiscordColor.Orange);

            var image = MiscService.GetCatPhotoAsync().Result;

            if (!string.IsNullOrWhiteSpace(image))
            {
                output.WithImageUrl(image);
            }

            await ctx.RespondAsync(output.Build()).ConfigureAwait(false);
        }