示例#1
0
        public async Task NASA(CommandContext ctx)
        {
            var results = await NASAService.GetNASAImageAsync().ConfigureAwait(false);

            if (results is null)
            {
                await BotServices.SendEmbedAsync(ctx, Resources.ERR_NASA_API, EmbedType.Missing).ConfigureAwait(false);
            }
            else
            {
                var output = new DiscordEmbedBuilder()
                             .WithTitle(results.Title)
                             .WithImageUrl(results.ImageHD ?? results.ImageSD)
                             .WithFooter(results.Description)
                             .WithColor(new DiscordColor("#0B3D91"));
                await ctx.RespondAsync(embed : output.Build()).ConfigureAwait(false);
            }
        }
示例#2
0
 public void GetNASAData()
 {
     Assert.IsNotNull(NASAService.GetNASAImageAsync().Result);
 }