added random cat command to searches module

This commit is contained in:
Kwoth 2016-01-10 16:14:51 +01:00
parent cadae7f67c
commit 0997a82513

View File

@ -78,6 +78,18 @@ namespace NadekoBot.Modules
}
await e.Send( result.ToString());
});
cgb.CreateCommand("~randomcat")
.Description("Shows a random cat image.")
.Do(async e => {
try {
await e.Send(JObject.Parse(new StreamReader(
WebRequest.Create("http://www.random.cat/meow")
.GetResponse()
.GetResponseStream())
.ReadToEnd())["file"].ToString());
} catch (Exception) { }
});
});
}