【发布时间】:2020-02-14 22:52:35
【问题描述】:
我想检查一下 ctx.author 是否连接到这个不和谐公会的任何语音频道。 机器人会这样做,但是对于 ctx.author 不存在的每个频道,机器人都会发送消息“您需要连接到语音频道!” 如何从机器人检查的成员列表中创建一个列表?
voice_channel_list = ctx.guild.voice_channels
for voice_channels in voice_channel_list:
if not ctx.author in voice_channels.members:
await ctx.send(embed=discord.Embed(color=discord.Color.red(), description=("You need to be connected to a voice-channel!")))
elif ctx.author in voice_channels.members:
pass #does something
【问题讨论】:
标签: python-3.x list discord.py discord.py-rewrite