Skip to content

Commit

Permalink
[Discord] Specify HTML parser to process API response for fact command
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Jan 25, 2019
1 parent ac1ad2c commit 54ea923
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Discord/cogs/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ async def fact(self, ctx):
# uses page, limit, and cb parameters, seemingly to no effect
async with clients.aiohttp_session.get(url) as resp:
data = await resp.json(content_type = "text/plain")
await ctx.embed_reply(BeautifulSoup(data[0]["fact"]).text, image_url = data[0]["primaryImage"])
await ctx.embed_reply(BeautifulSoup(data[0]["fact"], "lxml").text, image_url = data[0]["primaryImage"])

@fact.command(name = "cat", aliases = ["cats"])
@checks.not_forbidden()
Expand Down

0 comments on commit 54ea923

Please sign in to comment.