不和.py当我从不同的s断开连接时,断开语音客户端的连接结束

2024-09-28 22:10:39 发布

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

当我把我的机器人从一个频道断开时,它会停止其他频道的所有音乐。我目前正在使用create_ytdl_player()函数流式播放音乐。有什么帮助吗?在

当前代码:

elif message.startswith('~disconnect'):
for x in client.voice_clients:
    if x.server == msg.server:
        print("Found Server!")
        await x.disconnect()
        VoiceOn[msg.channel.server.id] = False #A Dictionary which I use to detect if music is currently playing in the server.
        break

Tags: 函数代码inifserver音乐create机器人
1条回答
网友
1楼 · 发布于 2024-09-28 22:10:39

你不知道这有什么不和谐。 https://github.com/Rapptz/discord.py/issues/477

(重新启动客户端应该会修复它,直到bot再次断开连接)。在

这里唯一真正的解决方法是在每个语音会话中使用不同的帐户。它不是超级优雅(也不是很好的缩放)。在

相关问题 更多 >