Disable !cat
This commit is contained in:
parent
6bc6fb69af
commit
f127e0c02b
1 changed files with 20 additions and 19 deletions
|
@ -24,25 +24,26 @@ namespace Geekbot.net.Commands
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (var client = new HttpClient())
|
// using (var client = new HttpClient())
|
||||||
{
|
// {
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
client.BaseAddress = new Uri("http://random.cat");
|
// client.BaseAddress = new Uri("http://random.cat");
|
||||||
var response = await client.GetAsync("/meow.php");
|
// var response = await client.GetAsync("/meow.php");
|
||||||
response.EnsureSuccessStatusCode();
|
// response.EnsureSuccessStatusCode();
|
||||||
|
//
|
||||||
var stringResponse = await response.Content.ReadAsStringAsync();
|
// var stringResponse = await response.Content.ReadAsStringAsync();
|
||||||
var catFile = JsonConvert.DeserializeObject<CatResponse>(stringResponse);
|
// var catFile = JsonConvert.DeserializeObject<CatResponse>(stringResponse);
|
||||||
var eb = new EmbedBuilder();
|
// var eb = new EmbedBuilder();
|
||||||
eb.ImageUrl = catFile.file;
|
// eb.ImageUrl = catFile.file;
|
||||||
await ReplyAsync("", false, eb.Build());
|
// await ReplyAsync("", false, eb.Build());
|
||||||
}
|
// }
|
||||||
catch (HttpRequestException e)
|
// catch (HttpRequestException e)
|
||||||
{
|
// {
|
||||||
await ReplyAsync($"Seems like the dog cought the cat (error occured)\r\n{e.Message}");
|
// await ReplyAsync($"Seems like the dog cought the cat (error occured)\r\n{e.Message}");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
await ReplyAsync("Command disabled for now because http://random.cat is down");
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue