1
0
Fork 0
mirror of synced 2024-05-05 13:12:34 +12:00

Correct error to catch when there's no result

This commit is contained in:
phxntxm 2018-04-25 22:11:27 -05:00
parent 8560f29e17
commit fc2c5b5e5f

View file

@ -51,7 +51,7 @@ class Spotify:
response = await utils.request(url, headers=headers, payload=opts)
try:
await ctx.send(response.get("tracks").get("items")[0].get("external_urls").get("spotify"))
except (KeyError, AttributeError):
except (KeyError, AttributeError, IndexError):
await ctx.send("Couldn't find a song for:\n{}".format(query))
@spotify.command()