不和.py声音随机停止

2024-09-27 19:10:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试着用一些语音命令编写一个不和谐的机器人。其中一个工作正常:

async def padoru(ctx):
    if not bot.is_voice_connected(ctx.message.server):
        vc = await bot.join_voice_channel(ctx.message.author.voice_channel)
    else:
        await vc.move_to(ctx.message.author.voice_channel)
    player = vc.create_ffmpeg_player('padoru.mp3',after=lambda:print("padoru started"))
    player.start()
    while not player.is_done():
        pass
    await vc.disconnect()

而另一个会使机器人崩溃(在播放歌曲一段时间后):

^{pr2}$

崩溃不会真正打印任何内容,机器人只是停止响应任何命令以及停止语音命令本身。在


Tags: 命令messageisbotchannelnot机器人语音

热门问题