mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
Fixed !youtube
!youtube wasn't working correctly with !pause, !resume and favorites
This commit is contained in:
parent
6f6963b1af
commit
d5eb0a9db1
6
red.py
6
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user