This is my code:
async def tracklooper(ctx, timesPlayedTrack):
voice = get(bot.voice_clients, guild=ctx.guild)
if (timesPlayedTrack <= totaltime):
if voice and voice.is_playing():
voice.stop()
print(str(timesPlayedTrack))
run_coroutine_threadsafe(msg.edit(content="Playing "+vTT+" for "+str(timesPlayedTrack)+" time/s"), bot.loop)
voice.play(discord.FFmpegPCMAudio(audio), after=lambda e: asyncio.run_coroutine_threadsafe(tracklooper(ctx, timesPlayedTrack+1)), bot.loop)
voice.is_playing()
else:
run_coroutine_threadsafe(msg.delete(), bot.loop)
run_coroutine_threadsafe(ctx.send("Finished playing "+vTT+" for "+str(totaltime)+" times"), bot.loop)
run_coroutine_threadsafe(looptrack_set_times.delete(), bot.loop)
run_coroutine_threadsafe(ply.delete(), bot.loop)
This is the error:
voice.play(discord.FFmpegPCMAudio(audio), after=lambda e: asyncio.run_coroutine_threadsafe(tracklooper(ctx, timesPlayedTrack+1)), bot.loop)
^
SyntaxError: positional argument follows keyword argument
I am not very familiar with python language so I am having trouble finding the fix.