fix issue if you typo a commodity name
This commit is contained in:
parent
f6dcd35ae0
commit
0ca8f3d50b
@ -218,11 +218,10 @@ async def calculate_trade_profies(commodity, scu=None):
|
||||
embed = discord.Embed(
|
||||
description="-------", color=discord.Color.blue(), type="rich"
|
||||
)
|
||||
try:
|
||||
response = requests.get(url, headers=headers).json()["data"]
|
||||
except Exception as e:
|
||||
print(e)
|
||||
embed.set_author(name="❌ Couldnt find that commodity")
|
||||
response = requests.get(url, headers=headers).json()["data"]
|
||||
if not response:
|
||||
embed.set_author(name="❌ Couldnt find that commodity: %s" % commodity)
|
||||
return embed
|
||||
|
||||
embed.set_author(name=commodity)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user