public async Task Execute(SocketUserMessage msg, SocketCommandContext context, IServiceProvider provider)
        {
            CatFact fact = await SimpleApiCall.Call <CatFact>("https://catfact.ninja/fact", provider);

            if (fact != null)
            {
                await context.Channel.SendMessageAsync(fact.fact);
            }
        }
Example #2
0
        public async Task Prog()
        {
            JObject fact = await SimpleApiCall.Call("https://programming-quotes-api.herokuapp.com/quotes/random", provider);

            if (fact != null)
            {
                await ReplyAsync("> " + fact["en"] + "\n" + fact["author"]);
            }
        }
Example #3
0
        public async Task DadJoke()
        {
            JObject fact = await SimpleApiCall.Call("https://icanhazdadjoke.com/", provider);

            if (fact != null)
            {
                await ReplyAsync(fact["joke"].ToString());
            }
        }
Example #4
0
        public async Task Geek()
        {
            string fact = await SimpleApiCall.Call <string>("https://geek-jokes.sameerkumar.website/api", provider);

            if (fact != null)
            {
                await ReplyAsync(fact);
            }
        }
Example #5
0
        public async Task Urgent()
        {
            JObject fact = await SimpleApiCall.Call("https://corporatebs-generator.sameerkumar.website/", provider);

            if (fact != null)
            {
                await ReplyAsync(fact["phrase"].ToString());
            }
        }
Example #6
0
        public async Task Chuck()
        {
            ChuckFact fact = await SimpleApiCall.Call <ChuckFact>("https://api.chucknorris.io/jokes/random", provider);

            if (fact != null)
            {
                await ReplyAsync(fact.value);
            }
        }
Example #7
0
        public async Task Dumb()
        {
            JObject fact = await SimpleApiCall.Call("https://api.tronalddump.io/random/quote", provider);

            if (fact != null)
            {
                await ReplyAsync(fact["value"].ToString());
            }
        }
Example #8
0
        public async Task DarkJoke()
        {
            JObject fact = await SimpleApiCall.Call(JokeUrl("Dark"), provider);

            if (fact != null)
            {
                await SendTwoPartJoke(fact);
            }
        }
Example #9
0
        public async Task MiscellaneousJoke()
        {
            JObject fact = await SimpleApiCall.Call(JokeUrl("Miscellaneous"), provider);

            if (fact != null)
            {
                await SendTwoPartJoke(fact);
            }
        }
Example #10
0
        public async Task ProgrammerJoke()
        {
            JObject fact = await SimpleApiCall.Call(JokeUrl("Programming"), provider);

            if (fact != null)
            {
                await SendTwoPartJoke(fact);
            }
        }
Example #11
0
        public async Task Gif(string term)
        {
            JObject fact = await SimpleApiCall.Call(GiphyUrl(term), provider);

            if (fact != null)
            {
                await ReplyAsync(fact["data"]["images"]["fixed_height"]["url"].ToString());
            }
        }
Example #12
0
        public async Task Advice()
        {
            JObject fact = await SimpleApiCall.Call("https://api.adviceslip.com/advice", provider);

            if (fact != null)
            {
                await ReplyAsync(fact["slip"]["advice"].ToString());
            }
        }