Exemplo n.º 1
0
        public async Task RandomAsync(CommandContext ctx)
        {
            XkcdComic comic = await XkcdService.GetRandomComicAsync();

            if (comic == null)
            {
                throw new CommandFailedException("Failed to retrieve comic from xkcd.");
            }

            await ctx.RespondAsync(embed : comic.ToDiscordEmbed(this.ModuleColor));
        }
Exemplo n.º 2
0
        public async Task ByIdAsync(CommandContext ctx,
                                    [Description("Comic ID.")] int?id = null)
        {
            XkcdComic comic = await XkcdService.GetComicAsync(id);

            if (comic == null)
            {
                throw new CommandFailedException("Failed to retrieve comic from xkcd.");
            }

            await ctx.RespondAsync(embed : comic.ToDiscordEmbed(this.ModuleColor));
        }