Add followers to the boss blurb
All checks were successful
Build and push / changes (push) Successful in 3s
Build and push / Lint-Python (push) Successful in 7s
Build and push / Build-and-Push-Docker (push) Successful in 18s
Build and push / sync-argocd-app (push) Successful in 3s

This commit is contained in:
Luke R 2024-11-03 12:26:39 -08:00
parent 9437ec58de
commit 84421f2cae

View File

@ -168,9 +168,7 @@ class Tarkov(commands.Cog):
)
embed.set_author(name="Boss Spawn chances by map")
embed.set_thumbnail(
url="https://i.ytimg.com/vi/Yis5rmgo_bM/maxresdefault.jpg"
)
embed.set_thumbnail(url="https://i.ytimg.com/vi/Yis5rmgo_bM/maxresdefault.jpg")
query = """
{
@ -239,7 +237,6 @@ class Tarkov(commands.Cog):
)
wiki_url = "https://escapefromtarkov.fandom.com/wiki/"
# boss_name = "Tagilla"
response = requests.get(wiki_url + boss_name).text
soup = BeautifulSoup(response, "html.parser")
@ -249,6 +246,13 @@ class Tarkov(commands.Cog):
health = soup.find("table", class_="wikitable").find_next("td").text.rstrip()
embed.add_field(name="Health", value=health, inline=False)
followers = "None"
if soup.find("span", id="Followers"):
# Find the amount of followers in the text
followers = soup.find("span", id="Followers").find_next("p").text
embed.add_field(name="Followers", value=followers, inline=False)
spawn_chance = "%\n".join(
soup.find("td", class_="va-infobox-label", string="Spawn chance")
.find_next("td", class_="va-infobox-content")
@ -256,6 +260,7 @@ class Tarkov(commands.Cog):
)
embed.add_field(name="Spawn Chance", value=spawn_chance, inline=False)
await ctx.send_followup(embed=embed)