Query for the bosses name, not ID, makes for a nicer embed
This commit is contained in:
parent
24ca43d07b
commit
428d06e727
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user