Minor adjustments

This commit is contained in:
Twentysix 2016-02-16 18:09:46 +01:00
parent bb4e8aa376
commit 0443a95c99

View File

@ -248,10 +248,14 @@ class Audio:
self.queue.append(link) self.queue.append(link)
msg = ctx.message msg = ctx.message
result = await self.get_song_metadata(link) result = await self.get_song_metadata(link)
try: # In case of invalid SOUNDCLOUD ID
if result["title"] != []: if result["title"] != []:
await self.bot.say("{} has been put into the queue by {}.".format(result["title"], msg.author)) await self.bot.say("{} has been put into the queue by {}.".format(result["title"], msg.author))
else: else:
await self.bot.say("The song has been put into the queue by {}, however it may error.".format(msg.author)) await self.bot.say("The song has been put into the queue by {}, however it may error.".format(msg.author))
except:
await self.bot.say("A song has been put into the queue by {}.".format(msg.author))
else: else:
await self.bot.say("I'm already playing a playlist.") await self.bot.say("I'm already playing a playlist.")
@ -405,7 +409,7 @@ class Audio:
@audioset.command() @audioset.command()
@checks.is_owner() @checks.is_owner()
async def soundcloud(self, ID : str): async def soundcloud(self, ID : str=None):
"""Sets the SoundCloud Client ID """Sets the SoundCloud Client ID
""" """
self.settings["SOUNDCLOUD_CLIENT_ID"] = ID self.settings["SOUNDCLOUD_CLIENT_ID"] = ID
@ -678,7 +682,7 @@ class Audio:
url = "http://api.soundcloud.com/resolve.json?url={0}&client_id={1}".format(song_url, self.settings["SOUNDCLOUD_CLIENT_ID"]) url = "http://api.soundcloud.com/resolve.json?url={0}&client_id={1}".format(song_url, self.settings["SOUNDCLOUD_CLIENT_ID"])
result = await self.get_json(url) result = await self.get_json(url)
else: else:
result = {"title": "Couldn't get title"} result = {"title": "A song "}
return result return result
class EmptyPlayer(): #dummy player class EmptyPlayer(): #dummy player