所以我尝试使用 python 中的discord.py 库为我的raiddiscord 编写一个raid 机器人。该脚本应该形成语音频道中的成员列表以进行袭击。由于某种原因,该脚本无法正常工作。每当打印 memids 时,它只会打印一个空列表。
如果有人熟悉 discord.py 并且可以告诉我为什么这不起作用,请告诉我。这真的让我很困扰,我已经尽我所知尝试了一切来解决它。
#find raiding
voice_channel = discord.utils.get(ctx.message.server.channels, id = '440014722587426816')
#finds the members
members = voice_channel.voice_members
memids = []
for member in members:
memids.append(member.id)
print(memids)
Run Code Online (Sandbox Code Playgroud)