Fixed !loop, added title to !song

Audio now recognizes owner
This commit is contained in:
Twentysix 2016-02-11 07:36:50 +01:00
parent f7fa78403d
commit 6385c3614f

View File

@ -63,9 +63,8 @@ class Audio:
if self.is_playlist_valid([link]): # reusing a function
if await self.is_alone_or_admin(msg.author):
self.queue = []
self.playlist = []
self.current = -1
await self.play_video(link)
self.playlist = [link]
else:
self.playlist = []
self.current = -1
@ -79,7 +78,9 @@ class Audio:
"""Shows song title
"""
if self.downloader["TITLE"]:
await self.bot.say(self.downloader["TITLE"])
url = ""
if self.downloader["URL"]: url = 'Link : "' + self.downloader["URL"] + '"'
await self.bot.say(self.downloader["TITLE"] + "\n" + url)
else:
await self.bot.say("No title available.")
@ -182,10 +183,7 @@ class Audio:
msg = ctx.message
if self.music_player.is_playing():
if await self.is_alone_or_admin(msg.author):
if self.playlist:
self.playlist = self.playlist[[self.current]]
elif self.queue:
self.playlist = self.playlist[[self.queue[0]]]
self.playlist = [self.downloader["URL"]]
await self.bot.say("I will play this song on repeat.")
else:
await self.bot.say("I'm in queue mode. Controls are disabled if you're in a room with multiple people.")
@ -254,6 +252,8 @@ class Audio:
async def is_alone_or_admin(self, author): #Direct control. fix everything
if not self.settings["QUEUE_MODE"]:
return True
elif author.id == checks.settings["OWNER"]:
return True
elif discord.utils.get(author.roles, name=checks.settings["ADMIN_ROLE"]) is not None:
return True
elif discord.utils.get(author.roles, name=checks.settings["MOD_ROLE"]) is not None: