Merge remote-tracking branch 'origin/lovecalculator_develop' into lovecalculator_develop

# Conflicts:
#	lovecalculator/lovecalculator.py
pull/129/head
bobloy 4 years ago
commit 88a2049a53

@ -34,9 +34,10 @@ class LoveCalculator(Cog):
) )
async with aiohttp.ClientSession(headers={"Connection": "keep-alive"}) as session: async with aiohttp.ClientSession(headers={"Connection": "keep-alive"}) as session:
async with session.get(url) as response: async with session.get(url) as response:
log.debug(f"{response=}")
assert response.status == 200 assert response.status == 200
soup_object = BeautifulSoup(await response.text(), "html.parser") resp = await response.text()
log.debug(f"{resp=}")
soup_object = BeautifulSoup(resp, "html.parser")
try: try:
description = ( description = (
soup_object.find("div", class_="result__score").get_text().strip() soup_object.find("div", class_="result__score").get_text().strip()
@ -60,8 +61,6 @@ class LoveCalculator(Cog):
except: except:
title = "Dr. Love has left a note for you." title = "Dr. Love has left a note for you."
em = discord.Embed(title=title, description=result_text, color=discord.Color.red()) em = discord.Embed(title=title, description=result_text, color=discord.Color.red(), url=f"https://www.lovecalculator.com/{result_image}")
if result_image:
em.set_image(url=f"https://www.lovecalculator.com/{result_image}")
await ctx.send(embed=em) await ctx.send(embed=em)

Loading…
Cancel
Save