From af0e3c4c984fedae426f326ad57b768b276caa6c Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Tue, 29 Mar 2016 14:02:45 +0200 Subject: [PATCH] Added catfact, ref #101 --- NadekoBot/Modules/Searches.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NadekoBot/Modules/Searches.cs b/NadekoBot/Modules/Searches.cs index fe5b158d..6a709c16 100644 --- a/NadekoBot/Modules/Searches.cs +++ b/NadekoBot/Modules/Searches.cs @@ -321,6 +321,17 @@ $@"🌍 **Weather for** 【{obj["target"]}】 e.Channel.SendMessage( NadekoBot.Config.Quotes[new Random().Next(0, NadekoBot.Config.Quotes.Count)].ToString()); }); + + cgb.CreateCommand(Prefix + "catfact") + .Description("Shows a random catfact from http://catfacts-api.appspot.com/api/facts") + .Do(async e => + { + var response = await SearchHelper.GetResponseStringAsync("http://catfacts-api.appspot.com/api/facts"); + if (response == null) + return; + await e.Channel.SendMessage($"🐈 `{JObject.Parse(response)["facts"][0].ToString()}`"); + + }); }); } }