我想通过输入用户 ID 将连接的语音通道输出到通道



我想通过输入用户 ID 将连接的语音通道输出到通道。

如何编码?

我正在使用谷歌翻译。请理解翻译很奇怪:)

导入不和谐

我:!s 用户IDbot :此用户正在连接到 #voicechannel。

您需要

检查member.voice.voice_channel

@bot.command(pass_context=True)
async def whatchannel(ctx, member: discord.Member):
    channel = member.voice.voice_channel
    if channel is None:
        await bot.say(f"{member.mention} is not connected to voice")
    else:
        await bot.say(f"{member.mention} is connected to {channel.name}")

相关内容

最新更新