Added catfact, ref #101

This commit is contained in:
Master Kwoth 2016-03-29 14:02:45 +02:00
parent 6989e978e3
commit af0e3c4c98

View File

@ -321,6 +321,17 @@ $@"🌍 **Weather for** 【{obj["target"]}】
e.Channel.SendMessage( e.Channel.SendMessage(
NadekoBot.Config.Quotes[new Random().Next(0, NadekoBot.Config.Quotes.Count)].ToString()); 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()}`");
});
}); });
} }
} }