Esempio n. 1
0
        public async Task RandomDogAsync(CommandContext ctx)
        {
            string url = await PetImagesService.GetRandomDogImageAsync();

            if (url is null)
            {
                throw new CommandFailedException("Connection to random.dog failed!");
            }

            await ctx.RespondAsync(embed : new DiscordEmbedBuilder {
                Description = DiscordEmoji.FromName(ctx.Client, ":dog:"),
                ImageUrl    = url,
                Color       = this.ModuleColor
            });
        }
Esempio n. 2
0
        public async Task RandomCatAsync(CommandContext ctx)
        {
            string?url = await PetImagesService.GetRandomCatImageAsync();

            if (url is null)
            {
                throw new CommandFailedException(ctx, "cmd-err-image");
            }

            await ctx.RespondAsync(embed : new DiscordEmbedBuilder {
                Description = DiscordEmoji.FromName(ctx.Client, ":cat:"),
                ImageUrl    = url,
                Color       = this.ModuleColor
            });
        }
Esempio n. 3
0
 public async Task GetRandomDogImageAsync()
 {
     Assert.IsNotNull(await PetImagesService.GetRandomDogImageAsync());
 }