【问题标题】:i cant do a python bot, voice chat我不会做 python 机器人,语音聊天
【发布时间】:2021-05-24 04:50:11
【问题描述】:
@client.command(pass_context=True)
async def join(ctx):
    channel = ctx.message.author.voice.voice_channel
    await client.join_voice_channel(channel)

我有这样的回应

raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'Member' object has no attribute 'voice_channel'

【问题讨论】:

    标签: python-3.x discord discord.py bots


    【解决方案1】:

    试试这个:

    @client.command()
    async def join(ctx):
        voice_channel = ctx.author.voice.channel
        vc = await voice_channel.connect()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-11-20
      • 1970-01-01
      • 2021-12-02
      • 2017-12-15
      • 1970-01-01
      • 1970-01-01
      • 2021-09-13
      相关资源
      最近更新 更多