Don't make command server only
This commit is contained in:
parent
6145ab3df3
commit
9e39888589
|
@ -34,7 +34,6 @@ class Spotify:
|
||||||
await asyncio.sleep(data.get("expires_in", 2400))
|
await asyncio.sleep(data.get("expires_in", 2400))
|
||||||
|
|
||||||
@commands.group(invoke_without_command=True)
|
@commands.group(invoke_without_command=True)
|
||||||
@commands.guild_only()
|
|
||||||
@utils.custom_perms(send_messages=True)
|
@utils.custom_perms(send_messages=True)
|
||||||
@utils.check_restricted()
|
@utils.check_restricted()
|
||||||
async def spotify(self, ctx, *, query):
|
async def spotify(self, ctx, *, query):
|
||||||
|
@ -55,7 +54,6 @@ class Spotify:
|
||||||
await ctx.send("Couldn't find a song for:\n{}".format(query))
|
await ctx.send("Couldn't find a song for:\n{}".format(query))
|
||||||
|
|
||||||
@spotify.command()
|
@spotify.command()
|
||||||
@commands.guild_only()
|
|
||||||
@utils.custom_perms(send_messages=True)
|
@utils.custom_perms(send_messages=True)
|
||||||
@utils.check_restricted()
|
@utils.check_restricted()
|
||||||
async def playlist(self, ctx, *, query):
|
async def playlist(self, ctx, *, query):
|
||||||
|
@ -71,7 +69,7 @@ class Spotify:
|
||||||
response = await utils.request(url, headers=headers, payload=opts)
|
response = await utils.request(url, headers=headers, payload=opts)
|
||||||
try:
|
try:
|
||||||
await ctx.send(response.get("playlists").get("items")[0].get("external_urls").get("spotify"))
|
await ctx.send(response.get("playlists").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))
|
await ctx.send("Couldn't find a song for:\n{}".format(query))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue