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); } }
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"]); } }
public async Task DadJoke() { JObject fact = await SimpleApiCall.Call("https://icanhazdadjoke.com/", provider); if (fact != null) { await ReplyAsync(fact["joke"].ToString()); } }
public async Task Geek() { string fact = await SimpleApiCall.Call <string>("https://geek-jokes.sameerkumar.website/api", provider); if (fact != null) { await ReplyAsync(fact); } }
public async Task Urgent() { JObject fact = await SimpleApiCall.Call("https://corporatebs-generator.sameerkumar.website/", provider); if (fact != null) { await ReplyAsync(fact["phrase"].ToString()); } }
public async Task Chuck() { ChuckFact fact = await SimpleApiCall.Call <ChuckFact>("https://api.chucknorris.io/jokes/random", provider); if (fact != null) { await ReplyAsync(fact.value); } }
public async Task Dumb() { JObject fact = await SimpleApiCall.Call("https://api.tronalddump.io/random/quote", provider); if (fact != null) { await ReplyAsync(fact["value"].ToString()); } }
public async Task DarkJoke() { JObject fact = await SimpleApiCall.Call(JokeUrl("Dark"), provider); if (fact != null) { await SendTwoPartJoke(fact); } }
public async Task MiscellaneousJoke() { JObject fact = await SimpleApiCall.Call(JokeUrl("Miscellaneous"), provider); if (fact != null) { await SendTwoPartJoke(fact); } }
public async Task ProgrammerJoke() { JObject fact = await SimpleApiCall.Call(JokeUrl("Programming"), provider); if (fact != null) { await SendTwoPartJoke(fact); } }
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()); } }
public async Task Advice() { JObject fact = await SimpleApiCall.Call("https://api.adviceslip.com/advice", provider); if (fact != null) { await ReplyAsync(fact["slip"]["advice"].ToString()); } }