Fix element name
All checks were successful
Build and push / changes (push) Successful in 2s
Build and push / Lint-Python (push) Successful in 5s
Build and push / Build-and-Push-Docker (push) Successful in 17s
Build and push / post-status-to-discord (push) Successful in 1s
Build and push / sync-argocd-app (push) Successful in 3s

This commit is contained in:
Luke Robles 2025-03-22 15:36:05 -07:00
parent c2e93532e4
commit 31e01fa5fc

View File

@ -70,16 +70,13 @@ class PalWorld(commands.Cog):
pal_elements_div = soup.find("div", class_="elements") pal_elements_div = soup.find("div", class_="elements")
element_icon = "https://palworld.gg" + pal_elements_div.find("img")["src"] element_icon = "https://palworld.gg" + pal_elements_div.find("img")["src"]
element_type = pal_elements_div.text element_type = pal_elements_div.find_next("div").text
elements[element_type] = element_icon elements[element_type] = element_icon
primary_element = list(elements.keys())[0]
# https://discordpy.readthedocs.io/en/latest/api.html?highlight=colour#discord.Colour # https://discordpy.readthedocs.io/en/latest/api.html?highlight=colour#discord.Colour
color_lookup = { color_lookup = {
"Dark": discord.Color.dark_purple(), "Dark": discord.Color.dark_purple(),
"Dragon": discord.Color.purple(), "Dragon": discord.Color.purple(),
"DragonDark": discord.Color.dark_purple(),
"Earth": discord.Color.greyple(), "Earth": discord.Color.greyple(),
"Electricity": discord.Color.yellow(), "Electricity": discord.Color.yellow(),
"Fire": discord.Color.red(), "Fire": discord.Color.red(),
@ -91,14 +88,14 @@ class PalWorld(commands.Cog):
embed = discord.Embed( embed = discord.Embed(
description="-------", description="-------",
color=color_lookup[primary_element], color=color_lookup[element_type],
type="rich", type="rich",
title=pal.capitalize(), title=pal.capitalize(),
) )
embed.set_author( embed.set_author(
name=", ".join(elements.keys()), name=", ".join(elements.keys()),
icon_url=elements[primary_element], icon_url=elements[element_type],
url=pal_url, url=pal_url,
) )