From d5eb0a9db1268d210224424d368d746e633ff320 Mon Sep 17 00:00:00 2001 From: Twentysix Date: Sun, 3 Jan 2016 08:30:15 +0100 Subject: [PATCH] Fixed !youtube !youtube wasn't working correctly with !pause, !resume and favorites --- red.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/red.py b/red.py index fd408b365..ff56f59c1 100644 --- a/red.py +++ b/red.py @@ -727,7 +727,7 @@ async def checkVoice(message): return True async def playVideo(message): - global musicPlayer + global musicPlayer, currentPlaylist if await checkVoice(message): pattern = "(?:youtube\.com\/watch\?v=)(.*)|(?:youtu.be/)(.*)" rr = re.search(pattern, message.content, re.I | re.U) @@ -742,11 +742,11 @@ async def playVideo(message): if canDeleteMessages(message): await client.send_message(message.channel, "`Playing youtube video {} requested by {}`".format(id, message.author.name)) await client.delete_message(message) + currentPlaylist = Playlist(singleSong=True) + currentPlaylist.playlist = ['https://www.youtube.com/watch?v=' + id] musicPlayer = client.voice.create_ytdl_player('https://www.youtube.com/watch?v=' + id, options=youtube_dl_options) musicPlayer.start() #!addfavorite compatibility stuff - currentPlaylist = Playlist(singleSong=True) - currentPlaylist.playlist = ['https://www.youtube.com/watch?v=' + id] async def playPlaylist(message, sing=False): global musicPlayer, currentPlaylist