Python 如何使discord机器人能够多次播放youtube音频(discord.py)
我试图让我的机器人播放音乐不止一次(在一首曲目结束后),但现在它只能播放一次,然后停止Python 如何使discord机器人能够多次播放youtube音频(discord.py),python,discord,discord.py,Python,Discord,Discord.py,我试图让我的机器人播放音乐不止一次(在一首曲目结束后),但现在它只能播放一次,然后停止 @bot.command(pass_context=True) async def play(ctx, url): author = ctx.message.author voice_channel = author.voice_channel vc = await bot.join_voice_channel(voice_channel) player = await vc.
@bot.command(pass_context=True)
async def play(ctx, url):
author = ctx.message.author
voice_channel = author.voice_channel
vc = await bot.join_voice_channel(voice_channel)
player = await vc.create_ytdl_player(url)
player.start()
你不能再次调用
player.start()
吗?在我看来,似乎没有一个合理的位置来放置它并让它工作…只需将它复制并粘贴到下面,看看它是否播放2次,然后你就可以使用循环播放N次