【发布时间】:2021-08-30 08:37:37
【问题描述】:
@commands.Cog.listener()
async def on_voice_state_update(self, channel, before, after, member):
channel = self.bot.get_channel([CHANNEL-ID])
member = VoiceChannel.members
if before.channel is None and after.channel is not None:
await channel.send(f'{member} JOINED {after.channel}')
错误:等待 coro(*args, **kwargs) 类型错误:on_voice_state_update() 缺少 1 个必需的位置参数:'member'
如果:没有问题:
@commands.Cog.listener()
async def on_voice_state_update(self, channel, before, after):
channel = self.bot.get_channel([CHANNEL-ID])
if before.channel is None and after.channel is not None:
await channel.send(f'someone JOINED {after.channel}')
那么我如何获取加入语音频道的成员的姓名
【问题讨论】:
-
我认为文档非常清楚
on_voice_state_update需要什么参数...
标签: python discord.py bots