【问题标题】:I want to output the connected voice channel to the channel by inputting the user ID我想通过输入用户ID将连接的语音通道输出到通道
【发布时间】:2018-12-30 18:45:19
【问题描述】:

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

如何编码?

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

导入不和谐

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

【问题讨论】:

    标签: discord.py


    【解决方案1】:

    您需要查看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}")
    

    【讨论】:

      猜你喜欢
      • 2020-10-19
      • 1970-01-01
      • 2019-09-23
      • 2021-09-18
      • 1970-01-01
      • 2014-01-04
      • 2022-01-05
      • 2012-01-11
      • 2021-02-19
      相关资源
      最近更新 更多