From fc2c5b5e5fedf9d3612524216aaec8cab3783e28 Mon Sep 17 00:00:00 2001 From: phxntxm Date: Wed, 25 Apr 2018 22:11:27 -0500 Subject: [PATCH] Correct error to catch when there's no result --- cogs/spotify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cogs/spotify.py b/cogs/spotify.py index e9c421a..ea28b53 100644 --- a/cogs/spotify.py +++ b/cogs/spotify.py @@ -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()