【发布时间】:2019-12-08 15:47:45
【问题描述】:
当我输入!join 时,我想让我的不和谐机器人连接到我所在的语音频道。
我试图用下面的代码来做,但我得到了这个错误:
bot: BotInstance of 'Bot' has no 'voice_client_int' memberpylint(no-member)
我发现我的代码与 rewrite discord 版本不兼容。
@bot.command(pass_context = True)
async def join(ctx):
channel = ctx.message.author.voice.voice_channel
await bot.join_voice_channel(channel)
@bot.command(pass_context = True)
async def leave(ctx):
server = ctx.message.server
voice_client = bot.voice_client_int(server)
await voice_client.disconnect()
有人可以帮我吗?
【问题讨论】:
标签: python discord discord.py discord.py-rewrite