我正在使用discord.py-rewrite制作一个不和谐的机器人,并将重点放在我的机器人的音乐部分。我检查了几次API,但我不知道如何在语音通道(而不是服务器静音或服务器耳聋)上使自己静音或自聋。有没有人能知道我是怎么让我的不和谐机器人自闭或自聋的?
发布于 2019-04-29 23:31:26
该应用程序接口看起来没有公开此功能,但websocket代码中有a method for doing this
@bot.command()
async def mute(ctx):
voice_client = ctx.guild.voice_client
if not voice_client:
return
channel = voice_client.channel
await voice_client.main_ws.voice_state(ctx.guild.id, channel.id, self_mute=True)我现在不能测试它,所以它可能不能工作。还要记住,即使在次要版本之间,也不能保证像这样的内部方法不会改变。
https://stackoverflow.com/questions/55904739
复制相似问题