Query for the bosses name, not ID, makes for a nicer embed
All checks were successful
Build and push / changes (push) Successful in 4s
Build and push / Lint-Python (push) Successful in 6s
Build and push / Build-and-Push-Docker (push) Successful in 1m12s
Build and push / sync-argocd-app (push) Successful in 3s

This commit is contained in:
Luke R 2024-11-06 08:05:27 -08:00
parent 24ca43d07b
commit 428d06e727

View File

@ -177,7 +177,7 @@ class Tarkov(commands.Cog):
bosses{
spawnChance
boss{
id
name
}
}
}
@ -186,12 +186,11 @@ class Tarkov(commands.Cog):
dont_care = [
"assault",
"ExUsec",
"infectedAssault",
"infectedCivil",
"infectedLaborant",
"Infected",
"infectedPmc",
"pmcBEAR",
"pmcUSEC",
"BEAR",
"USEC",
"Rogue",
]
headers = {"Content-Type": "application/json"}
response = tarkov.query_tarkov_api(query)["maps"]
@ -200,9 +199,9 @@ class Tarkov(commands.Cog):
levels = {}
for level in response:
levels[level["name"]] = {
boss["boss"]["id"]: boss["spawnChance"]
boss["boss"]["name"]: boss["spawnChance"]
for boss in level["bosses"]
if boss["boss"]["id"] not in dont_care
if boss["boss"]["name"] not in dont_care
}
for key, value in levels.items():
@ -210,7 +209,7 @@ class Tarkov(commands.Cog):
name=key,
value="\n".join(
f"{k}: **{str(round(v*100, 2))}%**" for k, v in value.items()
).replace("boss", ""),
),
inline=False,
)
embed.set_footer(text=f"Pulled from the api")