【发布时间】:2021-02-01 23:16:35
【问题描述】:
如何让我的机器人(在 cog 中)加入用户所在的语音频道? 我有这个代码:
@commands.command(name='join')
async def join(self, ctx):
channel = ctx.author.channel
voice = discord.utils.get(ctx.guild.voice_channels, name=channel.name)
voice_client = discord.utils.get(self.client.voice_clients, guild=ctx.guild)
if voice_client == None:
await voice.connect()
else:
await voice_client.move_to(channel)
【问题讨论】:
标签: discord.py