🟢 spotify playlists now working

This commit is contained in:
2023-11-10 14:22:12 +00:00
parent 77e2175ab6
commit a40679ee11
5 changed files with 45 additions and 26 deletions

View File

@@ -278,6 +278,15 @@ async def grab_songs(server_id):
return max, songs
# call play on ffmpeg exit
class AstroPlayer(discord.FFmpegPCMAudio):
def __init__(self, ctx, source, options) -> None:
self.ctx = ctx
super().__init__(source, **options)
def _kill_process(self):
super()._kill_process()
asyncio.run(play(self.ctx))
# Play and loop songs in server
async def play(ctx):
@@ -297,14 +306,4 @@ async def play(ctx):
# else play next song and call play again
await ctx.voice_client.play(
AstroPlayer(ctx, url, FFMPEG_OPTS))
# call play on ffmpeg exit
class AstroPlayer(discord.FFmpegPCMAudio):
def __init__(self, ctx, source, options) -> None:
self.ctx = ctx
super().__init__(source, **options)
def _kill_process(self):
super()._kill_process()
asyncio.run(play(self.ctx))
AstroPlayer(ctx, url, FFMPEG_OPTS))