public async Task GetRandomGifAsyncTest() { if (this.giphy.IsDisabled()) { Assert.Inconclusive("Service has not been properly initialized."); } RandomImageData data = await this.giphy.GetRandomGifAsync(); Assert.IsNotNull(data?.Url); }
public async Task RandomAsync(CommandContext ctx) { if (this.Service.IsDisabled()) { throw new ServiceDisabledException(); } GiphyDotNet.Model.GiphyRandomImage.Data res = await this.Service.GetRandomGifAsync(); await ctx.RespondAsync(embed : new DiscordEmbedBuilder { Title = "Random gif:", ImageUrl = res.Url, Color = this.ModuleColor }.Build()); }