Bug fixes in !wiki and errorHandler

This commit is contained in:
runebaas 2018-04-28 02:46:30 +02:00
parent 4548c6083a
commit f5fd9ba017
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
4 changed files with 9 additions and 5 deletions

View file

@ -29,7 +29,7 @@ namespace Geekbot.net.Commands
sb.AppendLine("https://geekbot.pizzaandcoffee.rocks/commands");
var dm = await Context.User.GetOrCreateDMChannelAsync();
await dm.SendMessageAsync(sb.ToString());
Context.Message.AddReactionAsync(new Emoji("✅"));
await Context.Message.AddReactionAsync(new Emoji("✅"));
}
catch (Exception e)
{

View file

@ -59,12 +59,12 @@ namespace Geekbot.net.Commands
{
Title = article.Title,
Description = article.Extract,
ImageUrl = article.Thumbnail.Source.ToString(),
ImageUrl = article.Thumbnail?.Source.ToString(),
Url = article.ContentUrls.Desktop.Page.ToString()
};
await ReplyAsync("", false, eb.Build());
}
catch (HttpRequestException e)
catch (HttpRequestException)
{
await ReplyAsync("I couldn't find that article");
}
@ -79,6 +79,7 @@ namespace Geekbot.net.Commands
var doc = new HtmlDocument();
doc.LoadHtml(extractHtml);
var nodes = doc.DocumentNode.SelectNodes("//li");
if (nodes == null) return "(List is to long to show)";
var sb = new StringBuilder();
foreach (var node in nodes)
{