【发布时间】:2018-12-30 18:45:19
【问题描述】:
我想通过输入用户ID将连接的语音通道输出到通道。
如何编码?
我正在使用谷歌翻译。 请理解翻译很奇怪:)
导入不和谐
我:!s 用户 ID bot : 此用户正在连接到#voicechannel。
【问题讨论】:
标签: discord.py
我想通过输入用户ID将连接的语音通道输出到通道。
如何编码?
我正在使用谷歌翻译。 请理解翻译很奇怪:)
导入不和谐
我:!s 用户 ID bot : 此用户正在连接到#voicechannel。
【问题讨论】:
标签: discord.py
您需要查看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}")
【讨论】: