From 6e8ea72c11f4e61ef6dffff4530f5359a5ae2229 Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Sat, 22 Mar 2025 17:15:58 -0700 Subject: [PATCH] Fix element type in pal embed --- app/cogs/palworld.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/cogs/palworld.py b/app/cogs/palworld.py index 536dc012..ec5cf1a0 100755 --- a/app/cogs/palworld.py +++ b/app/cogs/palworld.py @@ -70,8 +70,8 @@ class PalWorld(commands.Cog): pal_elements_div = soup.find("div", class_="elements") element_icon = "https://palworld.gg" + pal_elements_div.find("img")["src"] - element_type = pal_elements_div.find_next("div").text - elements[element_type] = element_icon + element_type = pal_elements_div.find_next("div") + elements[element_type.text] = element_icon # https://discordpy.readthedocs.io/en/latest/api.html?highlight=colour#discord.Colour color_lookup = { @@ -88,14 +88,16 @@ class PalWorld(commands.Cog): embed = discord.Embed( description="-------", - color=color_lookup[element_type], + color=color_lookup[element_type.text], type="rich", title=pal.capitalize(), ) embed.set_author( - name=", ".join(elements.keys()), - icon_url=elements[element_type], + name="/".join( + [x.text for x in pal_elements_div.find_all("div", class_="name")] + ), + icon_url=elements[element_type.text], url=pal_url, )