Move portraits ot a new method and then use that picture if you select the spawns for a single boss
All checks were successful
Build and push / changes (push) Successful in 4s
Build and push / Lint-Python (push) Successful in 2s
Build and push / Build-and-Push-Docker (push) Successful in 20s
Build and push / post-status-to-discord (push) Successful in 2s
Build and push / sync-argocd-app (push) Successful in 2s

This commit is contained in:
Luke R 2025-02-08 15:24:51 -08:00
parent 9d544e3bf7
commit 8c46a898f9
2 changed files with 18 additions and 9 deletions

View File

@ -147,10 +147,15 @@ class Tarkov(commands.Cog):
type="rich", type="rich",
) )
embed.set_author(name="🎲 Boss Spawn chances by map 🎲") embed.set_author(name="🎲 Boss Spawn chances by map 🎲")
embed.set_thumbnail(url="https://i.ytimg.com/vi/Yis5rmgo_bM/maxresdefault.jpg")
if boss_name: if boss_name:
for item in tarkov.get_boss_pictures():
if item["name"] == boss_name:
embed.set_thumbnail(url=item["imagePortraitLink"])
break
embed.set_author(name=f"🎲 Spawn chance for {boss_name} 🎲") embed.set_author(name=f"🎲 Spawn chance for {boss_name} 🎲")
embed.set_thumbnail(url="https://i.ytimg.com/vi/Yis5rmgo_bM/maxresdefault.jpg")
levels = tarkov.get_tarkov_boss_info() levels = tarkov.get_tarkov_boss_info()
@ -217,14 +222,7 @@ class Tarkov(commands.Cog):
# ) # )
# break # break
portraits = tarkov.query_tarkov_api( portraits = tarkov.get_boss_pictures()
"""{
bosses(lang: en, gameMode:pve) {
name
imagePortraitLink
}
}"""
)["bosses"]
for boss in portraits: for boss in portraits:
if boss["name"] == boss_name: if boss["name"] == boss_name:

View File

@ -18,6 +18,17 @@ def query_tarkov_api(query):
).json()["data"] ).json()["data"]
def get_boss_pictures():
return query_tarkov_api(
"""{
bosses(lang: en, gameMode:pve) {
name
imagePortraitLink
}
}"""
)["bosses"]
def get_tarkov_boss_info(): def get_tarkov_boss_info():
""" """
Returns a dict of boss spawn chances per map, and their escorts Returns a dict of boss spawn chances per map, and their escorts