From 0997a82513937ab7ab6c0300c97862804afc41b2 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Sun, 10 Jan 2016 16:14:51 +0100 Subject: [PATCH] added random cat command to searches module --- NadekoBot/Modules/Searches.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/NadekoBot/Modules/Searches.cs b/NadekoBot/Modules/Searches.cs index 97b312ee..afc025d8 100644 --- a/NadekoBot/Modules/Searches.cs +++ b/NadekoBot/Modules/Searches.cs @@ -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) { } + }); }); }