Bug fixes in !wiki and errorHandler
This commit is contained in:
parent
4548c6083a
commit
f5fd9ba017
4 changed files with 9 additions and 5 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue