Fix /paldeck, the author of the site chnaged a bunch of his divs
This commit is contained in:
parent
4c0fcf271b
commit
cadd750e0c
@ -33,7 +33,7 @@ class PalWorld(commands.Cog):
|
||||
for pal in x:
|
||||
all_pals.append(pal.text)
|
||||
|
||||
return set(all_pals)
|
||||
return sorted(set(all_pals))
|
||||
|
||||
@palworld.command(
|
||||
guild_ids=None,
|
||||
@ -96,9 +96,6 @@ class PalWorld(commands.Cog):
|
||||
)["src"]
|
||||
)
|
||||
|
||||
# pal_description = soup.find("h3", class_="text-lg mt-2 text-slate-300").text
|
||||
# embed.add_field(name="**Description**", value=pal_description, inline=False)
|
||||
|
||||
# embed.add_field(name="Work Skills", value="-----", inline=False)
|
||||
# work skills
|
||||
skills_emojis = {
|
||||
@ -116,13 +113,14 @@ class PalWorld(commands.Cog):
|
||||
"Watering": "💦",
|
||||
}
|
||||
|
||||
specialties = soup.find("div", class_="grid grid-cols-2 grid-rows-6 gap-2")
|
||||
for work_skill in specialties.find_all(
|
||||
"div",
|
||||
class_="inline-flex flex-row gap-1 items-center bg-black-300 border border-amber-300 break-all",
|
||||
skill_table = soup.find("div", class_="flex flex-col gap-2")
|
||||
for div in skill_table.find_all(
|
||||
"div", class_=re.compile(".*border-amber-300\s+break-all")
|
||||
):
|
||||
skill_name = work_skill.text.split("Lv")[0]
|
||||
skill_level = work_skill.text.split("Lv")[1]
|
||||
skill_name = div.find("p", class_="text-base sm:text-lg").text
|
||||
skill_level = div.find(
|
||||
"p", class_="text-base sm:text-lg mr-2 md:mr-4"
|
||||
).text.split("Lv")[-1]
|
||||
|
||||
embed.add_field(
|
||||
name=skills_emojis[skill_name] + " " + skill_name,
|
||||
@ -141,11 +139,15 @@ class PalWorld(commands.Cog):
|
||||
value=skill_description,
|
||||
inline=False,
|
||||
)
|
||||
|
||||
# Drops
|
||||
embed.add_field(name="Drops", value="-----", inline=False)
|
||||
for div in soup.find("div", class_="flex flex-col gap-2"):
|
||||
for div in soup.find_all(
|
||||
"div",
|
||||
class_="inline-flex flex-col gap-1 items-center bg-black-300 border border-amber-300 break-all p-2",
|
||||
):
|
||||
embed.add_field(
|
||||
name=div.text.split("(")[0],
|
||||
name=div.text.split("Quantity")[0],
|
||||
value="",
|
||||
inline=False,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user