コード例 #1
0
        public async Task ExecuteGroupAsync(CommandContext ctx)
        {
            string?joke = await JokesService.GetRandomJokeAsync();

            if (joke is null)
            {
                await ctx.FailAsync("cmd-err-res-none");
            }
            else
            {
                await ctx.Channel.EmbedAsync(joke, Emojis.Joy, this.ModuleColor);
            }
        }
コード例 #2
0
 public async Task GetRandomJokeAsyncTest()
 {
     Assert.IsNotNull(await JokesService.GetRandomJokeAsync());
 }
コード例 #3
0
        public async Task ExecuteGroupAsync(CommandContext ctx)
        {
            string joke = await JokesService.GetRandomJokeAsync();

            await this.InformAsync(ctx, joke, ":joy:");
        }