I'm doing this discord bot and I'm trying to find out how to just continuously check if the song is playing and when it ends, check if there is a song in the queue, and if it is, play it if not, do nothing. I wanna know if there's like an event for when an audio ends? I have tried a while loop but that won't work.
AN EVENT FOR WHEN AUDIO STOPS PLAYING OR SOME LOOP:
if len(queue):
voice = discord.utils.get(client.voice_clients, guild=ctx.guild)
source = FFmpegPCMAudio(f"{next(next_song)}.wav")
voice.stop()
voice.play(source)
await ctx.send("Next Song Playing")
queue.remove(source)