@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'
答案 0 :(得分:0)
试试这个:
@client.command()
async def join(ctx):
voice_channel = ctx.author.voice.channel
vc = await voice_channel.connect()