So I'm attempting to write a raiding bot for my raiding discord using the discord.py library in python. This scripts is supposed to be forming a list of members in the voice channel for raiding. For some reason, this script is not working. Whenever memids is printed, it just prints an empty list.
If anyone is familiar with discord.py and could tell me why this isn't working, please do. It's really troubling me and I have tried everything in my knowledge to fix it.
#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)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…